LPC845 I2C 8 Extra Clocks after Repeated Start

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC845 I2C 8 Extra Clocks after Repeated Start

跳至解决方案
5,591 次查看
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.

标记 (2)
0 项奖励
回复
1 解答
5,472 次查看
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 项奖励
回复
6 回复数
5,473 次查看
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 项奖励
回复
5,497 次查看
kk7xo
Contributor III

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

 

0 项奖励
回复
5,545 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @kk7xo ,

What about your code and signal by logic analyzer?

 

BR

Alice

0 项奖励
回复
5,538 次查看
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 项奖励
回复
5,498 次查看
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 项奖励
回复
5,492 次查看
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 项奖励
回复