Strange I2C output

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

Strange I2C output

跳至解决方案
3,134 次查看
AndyPeeps
Contributor I

Hi,

I am trying to get the I2C (channel 3) working in master mode on an iMXRT1062. I have used the interrupt example (evkmimxrt1060_lpi2c_interrupt) as a starting point and the port appears to initialise OK. When I try to start it with LPI2C_MasterStart() It seems to start off OK but the clocking goes awry after the first rising edge and seems to be forced back to zero and never finishes. The interface is held busy so I cannot write anything further. Master start is used with the following parameters.

LPI2C_MasterStart(I2C3_BASE, address, kLPI2C_Write);

where address = 0x48 (slave is LM75 at address 0)

I am using 100kHz baudrate (10us period) and 10MHz I2C clock source (see attached setup screenshot)

The attached output.jpg file shows the output on an oscilloscope. The top trace is data and the bottom trace is clock. The data appears to start OK with the start bit, followed by 0 then 1 as expected but then gets interrupted as the clock goes obviously wrong.

I'm using MCUexpresso and set up the interface using the peripheral/ clock tools with no errors or warnings.

Any help appreciated. I'm sure it's a setup problem but having fiddled with everything I can think of I am stumped.

Cheers AndyPeeps

标签 (1)
0 项奖励
回复
1 解答
3,098 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
Unfortunately, I wasn´t able to use the same pins as you since they are not available in the EVK, but the issue was similar to the other pins available for LPI2C3.
I solved this issue by changing the pin configuration in config tools. The module settings were in the same state as the SDK example.

Omar_Anguiano_0-1651710397816.png

I attached the pin configuration used.
If you have more questions do not hesitate to ask me.
Best regards,
Omar

在原帖中查看解决方案

0 项奖励
回复
4 回复数
3,106 次查看
AndyPeeps
Contributor I

Hi Omar,

Thanks for the response. Yes I am using the config tools to configure everything, including the pins. My pinout is (obviously) different from the EVK, so that could be it, yes. I have attached a screenshot of the pins tool configuration for the I2C I'm using, let me know if you see any problems with it.

Many thanks Andy

0 项奖励
回复
3,099 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
Unfortunately, I wasn´t able to use the same pins as you since they are not available in the EVK, but the issue was similar to the other pins available for LPI2C3.
I solved this issue by changing the pin configuration in config tools. The module settings were in the same state as the SDK example.

Omar_Anguiano_0-1651710397816.png

I attached the pin configuration used.
If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 项奖励
回复
3,091 次查看
AndyPeeps
Contributor I

Ah yes thanks Omar, the key bit to change appears to be the 'Software Input ON' bit in the pins tool, which I had disabled.

I am not getting full 'words' out.

Many thanks Andy

 

0 项奖励
回复
3,109 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
Hope you are well. I replicated this issue with the EVK changing only the pin to use LPI2C3. I had a similar issue, I believe that this is caused by the pin configuration. Let me check in detail so we can find the root of the issue.
Were you using config tools to configure the LPI2C3 pins?

Best regards,
Omar

0 项奖励
回复