PDA

View Full Version : Newbie with an I2C question



andywpg
- 2nd February 2012, 03:06
I'm new to PBP (but not to PIC MCU's or BASIC) - so be gentle.

I have searched the FAQ but have not seen the answers to two questions.

1) When doing an I2C write to a slave device, there is an ACK sent by the device after every byte, does PBP automatically process this and go to the FAIL label if its not received?

2) I am using a Dallas DS1307 real time clock for a Numitron clock that I am building. The datasheet for the DS1307 indicates that when the chip is transmitting the data (7 bytes) for the date and time that "The DS1307 must receive a 'not acknowledge' to end a read".
Does PBP know to do this (as well as sending the STOP) as I assume it knows to send an ACK after each byte sent by the slave?

Thanks for any help, as I said, I searched the archive and couldn't find this.

Andy

mackrackit
- 2nd February 2012, 14:01
Yes, the PBP I2C command takes care of everything for you.
This might help.
http://www.picbasic.co.uk/forum/content.php?r=165-Serial-EEPROM-Part-1

andywpg
- 2nd February 2012, 20:30
Yes, the PBP I2C command takes care of everything for you.
This might help.
http://www.picbasic.co.uk/forum/content.php?r=165-Serial-EEPROM-Part-1

Thank you! VERY helpful.