LPC845 I2C 8 Extra Clocks after Repeated Start

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

LPC845 I2C 8 Extra Clocks after Repeated Start

ソリューションへジャンプ
1,130件の閲覧回数
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 解決策
1,019件の閲覧回数
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 返答(返信)
1,020件の閲覧回数
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 件の賞賛
1,044件の閲覧回数
kk7xo
Contributor III

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

 

0 件の賞賛
1,092件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @kk7xo ,

What about your code and signal by logic analyzer?

 

BR

Alice

0 件の賞賛
1,086件の閲覧回数
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 件の賞賛
1,046件の閲覧回数
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 件の賞賛
1,040件の閲覧回数
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 件の賞賛