LPI2C keeps on sending clocks while tx fifo count is 0

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

LPI2C keeps on sending clocks while tx fifo count is 0

跳至解决方案
1,492 次查看
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,449 次查看
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,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 项奖励
回复
1,457 次查看
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 项奖励
回复