In reality, nothing is "swaped", its just that PBP has chosen to label the bytes in their software I2C in a "non-standard manner". This is because they use the labels used for EEPROMs. (worth looking at a datasheet)Originally Posted by mrx23
I2CREAD DataPin,ClockPin,Control,{Address,}[Var{,Var...}]{,Label}
As listed, Control is the first byte sent. Bit 0 of this byte controls the direction of communication, either a read or write operation. In many I2C devices, the first byte sent, with bit 0 as the R/W bit, is called the slave address (but not with EEPROMs).
Address is also confusing, since PBP uses this to refer to the internal register address being accessed in the device, not the actual bus address of the device. It will be the byte/word sent after the slave-address/control byte, and is called different things based on the device, but "command-byte" or "control-byte" are common. (but not with EEPROMs)
You definately need a good understanding of the I2C protocol to translate PBPs I2C commands to a device other than an EEPROM
Yes, it looks that way to me.Originally Posted by mrx23
Hope this clears it up a little more,
Steve






Bookmarks