

The value of the resistors is not really critical anything from 1k8 to 47k can be used, their values depend on the length of the bus line. You only need one set of pull-up resistors for the whole I2C bus, not for each device, as illustrated above. One resistor from the SCL line to the 5V line and another from the SDA line to the 5V line. For the line to be able to go high you must provide pull-up resistors to the 5V supply. This basically means that the chip can drive its output low, but it cannot drive it high.
#Mplab xc8 peripheral libraries pdf serial
In our illustration, the first device with address 1 is a digital temperature sensor, the second one is a real time clock and the third one is a serial LCD display and the bus could carry on even more devices.Ĭommunication takes place from the master (PIC) to the individual selected slave only as shown in this illustration, the master sends data to the slave address 2 only.įigure 1: Slave devices connected to PIC with I☬ busīoth SCL and SDA lines are “open drain” drivers. The devices don’t have to be identical as long as they support I☬ protocol. Figure 1 below demonstrates how many devices can be connected with this simple two wire systems using only two pins of the microcontroller. I2C enables communication between electronic components or IC to IC. I2C has become one of the most common serial communication protocols in electronics. I☬ is sometimes called Two Wire Interface. I☬ (pronounced I-squared-C) created by Philips Semiconductors for use in communication of peripheral devices within a TV-set and commonly written as ‘I2C’ stands for Inter-Integrated Circuit and allows communication of data between I2C devices over two wires. Watch the Video Tutorial: Introduction to I 2C SCHEMATIC & PRINTED CIRCUIT BOARD DESIGN.
