Sunday, October 19, 2014

I2C in ARDUINO UNO & PIC Microcontroller with Proteus simulation


HOME    I  ALL IN ONE TAB


I2C in ARDUINO UNO & PIC Microcontroller with Proteus simulation


ARDUINO UNO


PIC Microcontroller



Simulation files :

1. ARDUINO UNO R3          - DOWNLOAD

2. PIC MICROCONTROLLER - DOWNLOAD

3  FILE BUNDLE -------(ALL FILES )

                      ARDUINO   :   DOWNLOAD

                      PIC           :    DOWNLOAD

Explanation about I2C



The physical I2C bus
                     

                                           This is just two wires, called SCL and SDA. SCL is the clock line. It is used to synchronize all data transfers over the I2C bus. SDA is the data line. The SCL & SDA lines are connected to all devices on the I2C bus. There needs to be a third wire which is just the ground or 0 volts. There may also be a 5volt wire is power is being distributed to the devices. Both SCL and SDA lines are "open drain" drivers. What this means is that the chip can drive its output low, but it cannot drive it high. For the line to be able to go high you must provide pull-up resistors to the 5v supply. There should be a resistor from the SCL line to the 5v line and another from the SDA line to the 5v line. You only need one set of pull-up resistors for the whole I2C bus, not for each device, as illustrated below:




Masters and Slaves


                           The devices on the I2C bus are either masters or slaves. The master is always the device that drives the SCL clock line. The slaves are the devices that respond to the master. A slave cannot initiate a transfer over the I2C bus, only a master can do that. There can be, and usually are, multiple slaves on the I2C bus, however there is normally only one master. It is possible to have multiple masters, but it is unusual and not covered here. 

Here master is arduino uno and pic microcontroller , DS1621 is slaves

For example,






Software protocol


                            ARDUINO UNO R3(Arduino IDE 1. 57) Vs PIC MICROCONTROLLER(CCS C compiler)







ADDRESSING OF DS1621


                   DS1621 DEVICE_ID(DEV_ID) is Higher nibble is 9h(1001) and lower nibble(A2,A1,A0) is optional for selecting more than on DS1621 on I2C BUS and last bit indicating write or read (R/W)




You must know the "COMMENT SET" or "ACCESS CONFIG" of  DS1621 IC




THANK U FOR WATCHING AND DOWNLOADING ............



8 comments:

  1. EXCELLENT EXPLANATION THANK U

    ReplyDelete
  2. how many ds1621 can use in this design

    ReplyDelete
  3. A2,A1,A0 are three optional address selector then 000 t0 111 can use that is 7 DS1621 slaves can used in one I2C BUS

    ReplyDelete
  4. Hi, can you send me a hex file? I try simulate arduino Wire library, but I have a problem. So I download your project for arduino, but still I have the same problem. I2C terminal.. start cond., address, this OK, but 3. byte is all 0. and continous Stop cond. Don't you know where can you be the problem. THX

    ReplyDelete
  5. hey, can u pls send me library file of i2c for protuse..

    ReplyDelete
  6. hola buenas noches una pregunta como hiciste para sacar Arduino en proteus

    ReplyDelete