jayanth.devarayanadurga
Banned
- Joined
- Dec 4, 2012
- Messages
- 4,280
- Helped
- 822
- Reputation
- 1,654
- Reaction score
- 791
- Trophy points
- 1,393
- Location
- Bangalore, India
- Activity points
- 0
I have written a program in CCS C. It is for I2C communication between One Master PIC16F887 and two Slave PICs PIC16F887. When I use any one of the slaves the master reads the data from slave and displays it on masters uart but if I use both the slaves then it reads data from slaves and prints it on uart the first time and after that it reads 0 from the slaves and slaves hang. The i2c debugger shows that nack is being performed where ack has to be performed but If I use only one slave (any slave) then ack and nack happens properly as desired and I see data sent by slave is updated in master whenever the data in slave changes. Actually the slaves send the adc reading which is a float value.
See the images. I have pointed where nack's is being performed if two slaves are used (first time the data is read properly after that it reads 0) The 0.0000 0.0000 is the data read the second time.
See the images. I have pointed where nack's is being performed if two slaves are used (first time the data is read properly after that it reads 0) The 0.0000 0.0000 is the data read the second time.