I2C problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C problem

349 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by straw_hat on Wed Jun 13 22:02:26 MST 2012
Hi all!!

Can somebody help me about I2C, it seems that my i2c is not working properly. It always detect timeout. It started when I optimize the compiler (MDK) to level 3 "O3". Can anyone please help me????thank you
0 Kudos
5 Replies

331 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by straw_hat on Thu Jun 14 01:56:33 MST 2012
Thank you Angelo for the reply. Thats my solution, I declare global variables to be volatile and that's it, my I2C works.
0 Kudos

331 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Thu Jun 14 01:44:31 MST 2012
Usuals problems when going from -O0 to -Ox:
-delays implemented as empty loops running faster.
-global variables which should be declared as volatile.
-....

Angelo
0 Kudos

331 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Jun 14 00:11:19 MST 2012
I am afraid that at the moment i am not able to test anything. I just noted that all my lpcxpresso boards are stolen from my car last night.:eek: Meaning i have to order new ones .... :mad:
Looks like even thiefs like NXP's LPC controllers...

So if someone else can help...
0 Kudos

331 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by straw_hat on Wed Jun 13 23:43:38 MST 2012
Thank you for the reply sir. I am using the LPC1343 and the I2C driver came from nxp code bundle. Before when I'm using the Level 0 optimization, everything works fine. But when I started using the Level 1, the I2C state is always busy. Can you please tell me what causes this problem???Thank You
0 Kudos

331 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Wed Jun 13 23:38:19 MST 2012
Can you please export your program (or part of it) and post it here so we can have a look at it?
All we know is that you have a I2C problem. We don't know wich processor you use and without looking at the code ... we can't help you.
0 Kudos