![]() ![]() Wire library is used to communicate with I2C devices. Master judge whether variable c is 1 or 0, master light up a led when c is 1. Then the byte x is transmitted to master and assigned to variable c when slave is requested data by master. When slave device receive the data, it is displayed on the serial monitor as below. Character string “light is” and byte x which is 0 or 1 is sent from master device to slave device repeatingly. ![]() Here we do a simple I2C experiment in which I2C bidirectional communication is completely demonstrated. ![]() It is obvious that two or more masters are not allowed. In the procedure of data transmission, IC connected to I2C bus can be either master(slave) or transmitter(receiver) at the same time which depends on the function it performs. Varieties of controlled IC is connected to this bus in parallel, just like telephone is connected up when its number is dialed up, each IC connected to I2C bus has a unique address. ![]() I2C is serial bus which is constituted of data line(SDA- Serial Data line) and clock line(SCL- serial clock line) ,with which microcontroller and controlled IC, IC and IC are able to communicate bidirectional at the data transmission rate up to 100kb/s. In this master-host communication mode, multiple I2C devices can be connected to I2C bus, which is identified by assigned unique address. I2C (pronounced I-squared-C) created by Philips Semiconductors(now NXP) and commonly written as “I2C” stands for Inter Integrated Circuit and allows communication of data between micro-controller and peripheral unit over two wires. Existence and flexibility of SPI and I2C reflect the idea of ‘Enough is enough’. There is no evidence that ‘small protocols’ is replaced necessarily by these ‘big protocols’. ‘Big protocol’ is employed as communication between systems, ‘small protocols’ is used as communication between IC within systems. However, we couldn’t forget the purpose of these kinds of protocols bus. I2C and SPI protocol are commonly recognized as ‘small protocol’ relative to such Ethernet, USB, SATA, PCI-E protocol bus and etc that their transmission rate is up to hundreds or thousands Mbits/s. There are many different forms of digital communication protocols and they differ based on application. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |