dpaul
Joined: 15 Mar 2005 Posts: 12
|
I2C Multi-byte Slave to Master? |
Posted: Mon Apr 18, 2005 2:47 pm |
|
|
Is it possible to program a I2C Master-Slave system with multi-byte Slave to Master communications with the compilier I2C_XX() functions? If so, could code snippets be posted?
I have no trouble with multi-byte Master to Slave communications, but going the other way, things are limited. Following a Master I2C_Write() with the seven bit address and LSB set followed in the Master with an I2C_Read (), I can communicate a single byte from the from the Slave with a I2C_Write() call. The Master does not Acknowledge, and investigation with a scope shows the SCL line remains low, which renders my I2C bus in an permanent "Clock Stretching" mode.
I've tried a days worth of various register twiddling in conjunction with the I2C_XX() function calls to no avail. Can multi-byte Slave to Master be done with the high level compiler functions? Searching this forum shows only code examples with elaborate register bit manipulation claiming multi-byte Slave to Master communications. Is this the only way to get this done?
Thanks for any advice, or hopefully code.
Doug |
|