Part # Application Notes Access Control Audio Accessories Adapters Broadcast Computer Power Supply Corded Terminals Cordless Terminal D datasheet

Part Manufacturer: ST Microelectronics

ST Microelectronics

Part Description: STM32F10xxx I²C application examples


Part Details:

AN2570 Application note STM32F10xxx I²C application examples Introduction This application note is intended to provide practical application examples of theSTM32F10xxx I²C peripheral use. This document, its associated firmware, and other such application notes are written toaccompany the STM32F10xxx firmware library. These are available for download from theSTMicroelectronics website: www.st.com. June 2007 Rev 1 1/10 www.st.com STM32F10xxx I²C-I²C communication using interrupts in 7-bit addressing modeAN2570 - Applica- 1 STM32F10xxx I²C-I²C communication using interrupts in 7-bit addressing mode 1.1 Overview This section describes how to set an I²C-I²C communication from a master transmitter to a slave receiver, using interrupts in 7-bit addressing mode. The PEC is transmitted at the end of the transfer. 1.2 Hardware description Figure 1 shows a typical connection between the STM32F10xxx I2C1 and I2C2. The I2C1 and I2C2 data (SDA) pins are connected together. The I2C1 and I2C2 clock (SCL) pins are also connected together. A pull-up resistor is connected to each line (SDA and SCL). Figure 1. STM32F10xxx I2C-I2C communication 3.3 V 3.3 V 4.7 K 4.7 K I2C1_SDA I2C1_SCL I2C2_SCL I2C2_SDA STM32F10xxx ai14326 1.3 Firmware description The provided firmware includes the I²C driver that supports all I²C communications through a set of functions. After enabling the two I²C peripherals and the two event and buffer interrupts, the transfer in 7-bit addressing mode starts after the I2C1 start condition is generated. Each time an event occurs on the master or the slave, it is managed in the I2C1 or I2C2 interrupt routine, respectively. In this application, I2C1 Tx_Buffer is transmitted from the master (I2C1) to the slave (I2C2) and stored into I2C2 Rx_Buffer. At the end of the transfer, the PEC is transmitted from master to slave. It is then saved in the PEC_Value variable. All transmitted and received buffers are compared to check that all data have been correctly transferred. This firmware is provided as I2C example 1 in the STM32F10xxx firmware library, available from the STMicroelectronics microcontrollers site. 1.4 Conclusion The use of interrupts in I²C communication makes it easier the check each generated event. PEC is another way of checking the reliability of the exchanged data. 2/10 AN2570 - Application note STM32F10xxx I²C-I²C communication in dual addressing mode 2 STM32F10xxx I²C-I²C communication in dual addressing mode 2.1 Overview This section describes how to set an I²C-I²C communication by addressing the slave with its two addresses. 2.2 Hardware description Figure 2 shows a typical connection between the STM32F10xxx I2C1 and I2C2. The I2C1 and I2C2 data (SDA) pins are connected together. The I2C1 and I2C2 clock (SCL) pins are also connected together. A pull-up resistor is connected to each line (SDA and SCL). Figure 2. STM32F10xxx I2C-I2C communication 3.3 V


Please click the following link to download the datasheet:

Application Notes Access Control Audio Accessories Adapters Broadcast Computer Power Supply Corded Terminals Cordless Terminal D.pdf Datasheet