I'm starting to learn how to use I2c, but I'm at a loss as to writing of the command byte and data byte, I'm using a pic16f886 master to a LTC2990 slave. The address byte was easy, but the command and data byte are a little confusing as to which is which for there is quite a few different registers to access but not much in the way of an example, or not sinking in to me I want to set the registers to read a current differential and a voltage, The reading of the slave seems pretty straight forward.
thank you
assembly, I've looked over a lot of routines, which seem pretty straight forward. but in the data sheet there is no example that I can see? Like, do I write to just one register or do I have to write to all of them, and what do I write to them..they give you the register address but what would I put in for the data?
When you read a byte it will be the value that register 0x6 contains... V1 ( msb ) if you send an ack after receiving V1 ( msb ) just reading the byte again it will be V1 ( lsb )
Write device address
Wait for ack
Write internal address (6)
Wait for ack
Send restart
Write device address + RW
wait for ack
Receive Byte ( V1 ) msb
Send ack
Receive Byte ( V1 ) lsb
Send nack ( No more bytes )
Send stop