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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

672 Views
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?

Labels (1)
0 Kudos
3 Replies

540 Views
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 Kudos

540 Views
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 Kudos

540 Views
estrooisma
NXP Employee
NXP Employee

Please move the ticket back to unanswerred.

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

0 Kudos