How to implement SMBus blockread with LEN=1 on i.MX 6

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

How to implement SMBus blockread with LEN=1 on i.MX 6

1,047件の閲覧回数
estrooisma
NXP Employee
NXP Employee

My goal is to implement a SMBus blockread operation using the I2C controller of i.MX 6. In this operation the slave indicates the amount of bytes of the transfer by the first byte it returns.

The level for the acknowledge bit needs to be set before starting that transfer. Reading from the I2DR register returns the value of the LAST byte and starts the transfer of the NEXT byte. To set a NACK for the last byte (LEN) of the I2C read operation I have to write to the configuration register (I2CR) before reading byte LEN-1.

I run into a problem when LEN is 1, because in that case I need to write to I2CR before reading the length byte. This is obviously impossible because I do not know in that case that the next byte will be the last one.

How could I implement this SMBus with LEN=1 such that the acknowledge bit of the last byte is set properly?

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

915件の閲覧回数
gusarambula
NXP TechSupport
NXP TechSupport

Hello E Strooisma,

There is an unpublished Application Note that uses I2C as an example for a driver implementation. Maybe it will help, please find it attached.

0 件の賞賛
返信

915件の閲覧回数
estrooisma
NXP Employee
NXP Employee

Thanks for the application note. However, it only illustrates how to use the I2C driver, whereas I am interested in details about the I2C controller (hardware) and I2C driver implementation itself.

0 件の賞賛
返信

915件の閲覧回数
estrooisma
NXP Employee
NXP Employee

Please move the ticket back to unanswerred.

- and sorry for the delay, I was on holiday -

0 件の賞賛
返信