LPI2C keeps on sending clocks while tx fifo count is 0

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

LPI2C keeps on sending clocks while tx fifo count is 0

ソリューションへジャンプ
1,493件の閲覧回数
MKlem
Contributor III

Hi!

I'm working to use the RT1010 in a custom application where I2C is used to communicate with a motor driver. The root clock of the LPI2C module is 8MHz (derived from the 24MHz clock), and the I2C bus clock should be 100KHz. To make sure the pullups are correct, i've installed 2k2 ohms. 

Copied from the I2C polling example i've initialised the module like this:

LPI2C_MasterGetDefaultConfig(&gI2cMasterConfig);
gI2cMasterConfig.baudRate_Hz = 100000;
LPI2C_MasterInit(LPI2C1, &gI2cMasterConfig, 8000000);

 Then; 

if(LPI2C_MasterStart(LPI2C1, 0x0, kLPI2C_Write) != kStatus_Success){
return 1;
}

 And then checking in a while loop (like in the example) wether the fifo TX count is zero. And it is, but the MasterSend call will be stuckin the while() loop. 

Looking with a logic analyzer, I saw this:

MKlem_0-1671635700666.png

The peripheral sends a start condition with a 0 (as requested) but then keeps sending clocks. Keeps sending. After 10 minutes, the clocks are stil transmitted. 

When I change the address to 0x55 (0b01010101), the 0's that are transmit change into 1's. Might be the last bit I'm seeing? 

 

I have played a bit with the sclGlitchFilterWidth_ns and sdaGlitchFilterWidth_ns values, but this gave no other result. 

What could be the culprit here?

Thanks!

 

Marcel

タグ(1)
0 件の賞賛
返信
1 解決策
1,450件の閲覧回数
MKlem
Contributor III

Hi Edwin, 

Thanks for your response. 

I've looked into the example code from the SDK and loaded it to my custom board. There, it seems to work (until the first NAK, because the address is not right). After looking into the differences, I found out that the pin configuration has got the inputOnfield bit set. After setting this bit in the application code, the issue was resolved.

 

Thanks!

 

Marcel

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,451件の閲覧回数
MKlem
Contributor III

Hi Edwin, 

Thanks for your response. 

I've looked into the example code from the SDK and loaded it to my custom board. There, it seems to work (until the first NAK, because the address is not right). After looking into the differences, I found out that the pin configuration has got the inputOnfield bit set. After setting this bit in the application code, the issue was resolved.

 

Thanks!

 

Marcel

0 件の賞賛
返信
1,458件の閲覧回数
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @MKlem,

Do you experience the same issues when using the LPI2C example codes provided in our SDKs?

Also, I believe the recommended pull-up resistor value is 4.7kOhms, please try changing the resistor values.

 

BR,

Edwin.

0 件の賞賛
返信