I2C sample question

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

I2C sample question

1,324 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by avass on Sat Feb 02 19:44:17 MST 2013
I wonder if any of you came across the same problem
I hooked up my LIS331DL to my board in I2C mode.
I am running the I2C sample CMSIS ( after changing the target address ).
SCL-SCL (pull-up), SDA-SDA (pull-up), SDO-GND, CS-GND
The I2CInit(comes back), but the I2CEngine hangs in waiting.
I checked and there is no INTR at all. Again, I'm using the i2c sample.

Your help is appreciated.

Thanks,

-A
标签 (1)
0 项奖励
回复
6 回复数

1,283 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kwinchell on Tue Jun 18 14:11:06 MST 2013

It sounds like you solved your problem.


But for the benefit of others who might never be getting their I2C interrupt, Check how you left the state of your AA Flag.


If you cleared this flag (LPC_I2C->CONCLR = 1 << 2, or LPC_I2C->CONCLR = 4), then it will not receive a new command, and no interrupt.


0 项奖励
回复

1,283 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mozmck on Thu Jun 13 14:53:57 MST 2013

Ok, my problem turned out to be a dumb mistake.  One part of the mistake I believe is that I did not clear the SI interrupt flag in one part of the interrupt handler (which happened to be the part that was being executed due to another dumb mistake), so the interrupt kept being called which put the chip into an endless loop.


So, maybe one thing to check if the chip seems to hang is to make sure the SI flag is cleared in all possible cases in the I2C interrupt handler.

0 项奖励
回复

1,283 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mozmck on Thu Jun 13 10:39:07 MST 2013

I'm having a similar problem with a LPC1114 I believe.  I've stripped my code down to just initializing the I2C and trying to send some data.


I have a systick timer running and toggling a pin, and when I set LPC_I2C->CONSET = I2CONSET_STA to start transmission, the pin quits toggling which indicates to me that the systick timer quits.  The I2C interrupt does not get run either.  What can I look for to fix this?

0 项奖励
回复

1,283 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by WHolderness on Tue Jun 04 13:58:35 MST 2013

I'm having a similar issue now, after I set the start bit, the interrupt never fires to say its ready. Oddly, it works for a few transfers, then stops working and hangs in I2C_Start on a LPC4300. 


Did you ever resolve your issue?

0 项奖励
回复

1,283 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by avass on Sun Feb 03 23:23:53 MST 2013
Sorry, my mistake, you are right. As a matter of fact, I have CS on VDD... There is no interrupt coming in after the initial START condition.
0 项奖励
回复

1,283 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by martinho on Sun Feb 03 07:43:37 MST 2013
According to the datasheet You need to set CS to Vdd_IO not GND to put the LIS331DL in I2C mode!

Martin
0 项奖励
回复