I2C Configuration

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

I2C Configuration

跳至解决方案
2,996 次查看
riz1231
Contributor I

Hi,


We are having issues getting I2C to transfer any data on SDA line.  We do following configuration for its most basic function to transfer a byte:

Enable I2C module: Clear I2Cx_IBCR_MDIS bit

Generate START condition: Set (I2Cx_IBCR_MSSL | I2Cx_IBCR_TXRX)     i.e   I2Cx_IBCR has value 0x30

After this point voltage on both SCL and SDA lines is pulled low when START condition is generated.

Load Data Register: I2Cx_IBDR = 0x30 (for TX to a slave at 0x18 address )

But no activity happens at this point, voltage on both lines remains pulled low and I can’t do anything further. I am connected to Aardvark slave and Beagle analyzer shows 0 bytes. No data shows up on line.

What could be possibly wrong with this fairly simple setup to try transfer a byte? I am doing following IOMUX settings:

IOMUXC_PTB14 = 0x002011A3

IOMUXC_PTB15 = 0x002011A3

Clock enable: CCM_CCGR4_CG6 = 1

Kindly let us know correct GPIO/ baud rate setting (to configure I2C for 100 or 400KHz data from 66MHz IPS clock) if they have got anything to do with this issue or anything else that might help resolve this issue.


Thanks,

Rizwan


0 项奖励
回复
1 解答
2,535 次查看
anthony_huereca
NXP Employee
NXP Employee

Hi,

  Try using the attached code as an example. This was used with a demo with the TWR-LCD-RGB to talk to the CRTouch chip via I2C. Hope it helps!

在原帖中查看解决方案

0 项奖励
回复
1 回复
2,536 次查看
anthony_huereca
NXP Employee
NXP Employee

Hi,

  Try using the attached code as an example. This was used with a demo with the TWR-LCD-RGB to talk to the CRTouch chip via I2C. Hope it helps!

0 项奖励
回复