LPC845 I2C 8 Extra Clocks after Repeated Start

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

LPC845 I2C 8 Extra Clocks after Repeated Start

Jump to solution
1,131 Views
kk7xo
Contributor III

I am using the LPC845 I2C port to read my EEPROM.  In order to read I must first write a data pointer to the device, so my transaction consists of a write, followed by a repeated start, followed by a read.  However, after issuing the repeated start, the LPC845 outputs the EEPROM address and read bit, followed by 8 additional clocks.  I found a post that is similar but it did not solve my problem.

I am using an interrupt based driver.

Do you know about this issue, what causes it, and how to fix it?

Edit: It also turns out that the 8 extra clocks appear immediately after the next start command even if preceded by a stop.  So it is not just repeated starts, its any start following the first one.

Tags (2)
0 Kudos
1 Solution
1,020 Views
kk7xo
Contributor III

I figured this out.  Refer to the attached code file.  When reading from I2C on the LPC845 it is not necessary to bump the "continue" flag to read the first byte after giving the address and r/w flag (which is 1 in the case of a read).  Just wait for "pending" status and then you can read the first byte.  After that you must bump the "continue" flag on subsequent reads.  This was not clear from the LPC845 User Manual, but anyway, that's it.

View solution in original post

0 Kudos
6 Replies
1,021 Views
kk7xo
Contributor III

I figured this out.  Refer to the attached code file.  When reading from I2C on the LPC845 it is not necessary to bump the "continue" flag to read the first byte after giving the address and r/w flag (which is 1 in the case of a read).  Just wait for "pending" status and then you can read the first byte.  After that you must bump the "continue" flag on subsequent reads.  This was not clear from the LPC845 User Manual, but anyway, that's it.

0 Kudos
1,045 Views
kk7xo
Contributor III

The LPC845 generates the clock, not the EEPROM.  The 8 extra clocks are coming from the LPC845.

 

0 Kudos
1,093 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @kk7xo ,

What about your code and signal by logic analyzer?

 

BR

Alice

0 Kudos
1,087 Views
kk7xo
Contributor III

I have attached my code and a scope snapshot.  In the scope snapshot, the SCL is the top trace and SDA is the bottom trace.

 

0 Kudos
1,047 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @kk7xo 

 

Please check how to read EEPROM data from EEPROM datasheet. 

From your screenshot, only after Read command, there is  8 extra clocks. 

 

BR

Alice

0 Kudos
1,041 Views
kk7xo
Contributor III

The 8 extra clocks are being produced by the LPC845 which is operating as the I2C master.  The I2C master produces all of the clocks.  The EEPROM does not produce any clocks.

It could be caused by "10 bit" addressing, which is a feature of the LPC845 I2C module.  However, I do not see a way to either enable or disable "10 bit" addressing.  My EEPROM requires "8 bit" addressing, which is the normal behavior for I2C.

Maybe you should have an engineer that is familiar with the LPC845 I2C module look at this.

 

0 Kudos