KSDK 2.0 I2C Slave Interrupt - Works except can't read multiple bytes

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

KSDK 2.0 I2C Slave Interrupt - Works except can't read multiple bytes

1,794件の閲覧回数
lucasrangit
Contributor III

Here is an implementation of an I2C EEPROM slave based on the KSDK_2.0.0-FRDM-KL27Z/boards/frdmkl27z/driver_examples/i2c/interrupt project requested in I need an I2C Slave sample  . It uses 1 byte data addresses and supports reading an writing simulating an EEPROM or other register mapped device device.

 

SDK: http://cache.nxp.com/lgfiles/sdk/SDK_2.0_FRDM-KL27Z.zip 

 

Single and multi-byte writes work. Single and no data address byte reads work. However, multi-byte reads do not work.

 

Single-byte read: S 0x77 [A] 0x02 [A] S 0x77 [A] [0x03] N P

166048_166048.pngsingle-byte-read.png

 

Multi-byte read: S 0x77 [A] 0x02 [A] S 0x77 [A] [0x03] A

166118_166118.pngmulti-byte-read.png

 

I suspect my issue is in how/where I handle the ACK/NAK from the host after writing the data to the I2C->D register.

 

 

Attached is my code which to replace the i2c_interrupt.c in the KSDK_2.0.0-FRDM-KL27Z/boards/frdmkl27z/driver_examples/i2c/interrupt project.

Original Attachment has been moved to: i2c_interrupt.c.zip

ラベル(1)
タグ(2)
0 件の賞賛
返信
3 返答(返信)

1,126件の閲覧回数
bobpaddock
Senior Contributor III

Are you running into the https://community.nxp.com/thread/377611 ?

0 件の賞賛
返信

1,126件の閲覧回数
lucasrangit
Contributor III

For completeness here is another version that uses 16-bit data addresses since that is what was originally requested. It does not support 8-bit data addresses. And it's not able to address more then the current 32 byte transfer buffer (or simulated EEPROM) but that's easy to change.

0 件の賞賛
返信

1,126件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello Lucas,

are you still having issues? was it related to Double Buffered I2C Difficulties (eg. KL27)?

Regards,

Isaac

0 件の賞賛
返信