I2C on LPC11U14

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

I2C on LPC11U14

377 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnGrand on Tue Mar 19 12:33:00 MST 2013
Hi everyone,

I'm trying to get the I2C bus to run on the embeddedArtists LPCXpresso LPC11[B]U[/B]14 for days now.

I am using the I2C example code for the LPC1114,  and -[I]it kind of[/I]- seems to work, but
I'm not getting successful signals or flags:

My I2CSTAT register shows the value 0x18 once (which means transmitted command/data and received ACK), but only once if I step through the programm using the debugger.
If I just run the programm, 0x18 is never occours, it remains 0x8F (no useful data on bus).
(I also use this information to toggle/switch/CLR/SET an LED for external debugging).

I am starting to think, it has something to do with the LPC11U14 instead of the LPC1114, even though registers and functions seem all to be the exact same.

I tested two different I2C devices. Both of them "react" the same, well, if they react at all.

Has anyone working I2C code for the LPC11[B]U[/B]14?
I appreciate any clous!

Best regards,
Stefan
0 Kudos
Reply
4 Replies

342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Sun Mar 31 23:24:01 MST 2013

Quote: JohnGrand

Of course, I can post the example code I use when I am on my home computer again.
The main part is the same posted in thread 3016 http://knowledgebase.nxp.com/showthread.php?t=3016



The code I linked to in that thread you mentioned does work with the LPC11U14.
You just need to change i2c.h to include LPC11Uxx.h instead of LPC11xx,h

Which devices have you tried?
0 Kudos
Reply

342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Wed Mar 20 16:27:09 MST 2013
Is your slave generating a ACK or NACK condition?
The clock is not really critical in I2C communication since there exists something like clock stretching in I2C.
0 Kudos
Reply

342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnGrand on Wed Mar 20 06:34:20 MST 2013
Thank you for your reply.

I use 3.6k pullups, but also tried different values. Yes, I did scope everything.
SCL and SDA send out clock/data the first 7-bit + R/W#. Furthermore nothing happens.

I am using the I2C example code for the LPC1114. It is actually pretty neat. Of course I applied the matching addresses and read/write-pointer-registers for the devices I have been testing. I also tried several different values for the I2C timings for the Clock and Serial Data.

Of course, I can post the example code I use when I am on my home computer again.
The main part is the same posted in thread 3016 http://knowledgebase.nxp.com/showthread.php?t=3016

This is not the first time I set up a working I2C-Bus. In general I know what to do, what not to and how to solve problems. But it is the first time using a NXP ARM. And things happening here don't make sense to me at all...
0 Kudos
Reply

342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Tue Mar 19 12:40:22 MST 2013
First of all did you scope the signals?
Is your hardware ok? (external pull up resistors)

And of course you can always export your project and post it here so we can take a look at it.
0 Kudos
Reply