The wire.write() function transmit current value of ‘x’ on I2C bus. After this, the value of x has been queued for transmission over the I2C bus. Here transmission has been initiated with the slave address of 9. Here wire.begin() function has been called. This picture shows master and slave devices connected with the I2C bus. In this picture, Arduino and Raspberry Pi are acting as a master and MPU6050, sensor devices as a slave. The communication between specific devices using two wires is accomplished by the fact that each device has its own unique device ID or address and using this address master can choose any specific device to communicate. Each slave device which is connected with the bus will have a unique 8-bit address. These lines are open-drain lines which means these need to be connected to pull up resistors if devices are active low. One wire is SCL (serial clock line) which synchronizes the transmission of data between devices and the other wire is SDA (serial data) which carries the actual data to be transmitted. The distinguishing feature of I2C over SPI is that it uses only two wires to carry out communication. It is only applicable for short distance data transmission. Many Sensors use this serial communication protocol to transfer their data to microcontrollers or through this protocol different slave circuits are able to communication with master circuits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |