LPC824, I2C1 issue

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

LPC824, I2C1 issue

1,092 次查看
scottbates
Contributor I

Hi, I am using an LPC824 and would like to use I2C functionality. I started with the "Example_I2C_MasterSlave" example. This uses I2C0 on pins P0_10 and P0_11. I modified the code a little bit, and it worked beautifully. I then tried to switch to I2C1 on pins P0_25 and P0_26. The code is the same except that I am referencing LPC_I2C1 instead of LPC_I2C0. It now seems that the interrupt is not firing and the LPC_I2C1->STAT pending bit never gets set. I have fiddled with the code and poured over the manual but have found no hint as to what might be wrong. I did find someone else having a similar problem (Problem Using all I2C Ports on LPC824 ) but the solution ("Had to drop the LPC824 MAX board driver library") is cryptic and I don't understand it. I am using the LPCXpresso IDE along with the LPC824 demo board. Any help would be greatly appreciated. 

0 项奖励
回复
1 回复

932 次查看
miguel_mendoza
NXP Employee
NXP Employee

Hi Scott Bates,

I switch the "Example_I2C_MasterSlave" for use it with I2C1 on pins P0_25 and P0_26 and works fine, my interrupt was firing.

There is some mistake in SYSAHBCLKCTRL register bits in "lpc8xx_syscon.h" define the clock for IC21 in the bit 20, but really this bit is reserved, the clock is in the bit 21, so you have to change that, maybe this was the problem, another recommendation is to be careful with the function (Pinassign) with which you assign the pin for SDA and SCL in I2C1, it is a little different than pinanable in I2C0.

Tell me if you can solve it, and if you still having problems please give more details about what are the exact changes that do for switch to I2C1.

regards,
Miguel.

0 项奖励
回复