Sample I2C code for ADXL345 and TMP102

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

Sample I2C code for ADXL345 and TMP102

2,352 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tkreyche on Wed Mar 03 10:38:40 MST 2010
See attached zip files for some minimal but working sample I2C code. Just drop into LPCXpresso I2C sample project - works with V1.20. I haven't worked with I2C for a while, but this was pretty easy to get  running. The LPCXpresso  provided I2C code seems to be working fine

Includes functions and calls for the Texas Instruments TMP102 digital temperature sensor and Analog Devices ADXL345 3-axis accelerometer. There are screen shots of I2C bus monitor for the ADXL345 but I didn't bother to do it for the TMP102. The two devices work with I2C somewhat differently, thus two separate sets of functions. Sparkfun has breakout boards for the sensors.

.
0 Kudos
Reply
7 Replies

2,227 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ninja on Wed Jun 27 18:33:27 MST 2012
Question for tkreyche.

You mention its LPCXpresso. Which board is it? I am trying to interface ADXL345 with LPC 11C24. I am assuming your sample code will work on that as well with minor changes.
0 Kudos
Reply

2,227 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Apr 27 10:11:25 MST 2011

Quote: chandru
Hello,

I have tried using the sample code you have posted with my mcb2300 kit and code bundle v 1.6 (strangely the version nos of files still remain 1.0:confused:) But I have been unsuccessful till now. I have worked on this three days straight,to no avail. Desperately in need of help. Please help me out!



:eek:Rob65 we did go off topic and chandru's question still needs an answer.  tkreyche may have to answer it though.
0 Kudos
Reply

2,227 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Apr 27 09:33:02 MST 2011

Quote: Rob65
Nice, I've just been talking to Larry (he[B] [COLOR=red]LARRY[/COLOR][/B] are you awake already ;))



Just barely. I need more coffee.:D
0 Kudos
Reply

2,227 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Apr 27 08:48:11 MST 2011

Quote: tkreyche
The screen shots are from USBee Suite - I have a USBee AX Pro. It's a bit pricey and their signal decoding is not always accurate (at least on SPI, I2C seems ok). There may be better/cheaper products out there.



Nice, I've just been talking to Larry (he[B] [COLOR=Red]LARRY[/COLOR][/B] are you awake already ;)) about the USBee, I have a LogicPort, works great for I2C, but that one has a limited sample buffer (2048 events - being 1-0 or 0-1 transitions) so I am limited as to the size of the transactions that I can monitor.

I enhanced and debugged the I2C driver for the LPCXpresso (here is a link to my web page), there you'll find a bigger image of the one below.

[IMG]http://myvoice.nl/software/LPCXpresso/images/i2ctransaction_m.png[/IMG]

Maybe a bit off topic, but can you trigger on a given I2C slave address with the USBee ? That's one thing I am missing in my LogicPort.

Rob
0 Kudos
Reply

2,227 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by chandru on Wed Apr 27 07:50:12 MST 2011
Hello,

I have tried using the sample code you have posted with my mcb2300 kit and code bundle v 1.6 (strangely the version nos of files still remain 1.0:confused:) But I have been unsuccessful till now. I have worked on this three days straight,to no avail. Desperately in need of help. Please help me out!
0 Kudos
Reply

2,227 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tkreyche on Sun Mar 14 21:46:23 MST 2010
The screen shots are from USBee Suite - I have a USBee AX Pro. It's a bit pricey and their signal decoding is not always accurate (at least on SPI, I2C seems ok). There may be better/cheaper products out there.

I do a lot of work with I2C and SPI and it's essential to have a some kind of logic analyzer to avoid brain meltdowns - seems that just about every peripheral chip vendor has some slightly customized implementation.
0 Kudos
Reply

2,227 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bonystedt on Sun Mar 14 11:55:47 MST 2010

Quote: tkreyche

There are screen shots of I2C bus monitor for the ADXL345 but I didn't bother to do it for the TMP102. The two devices work with I2C somewhat differently, thus two separate sets of functions. Sparkfun has breakout boards for the sensors.

.


Nice screen shots!
Please tell me how did you set up the I2C monitor and did you produce sceenshots in Windows? I'm used Linux,
0 Kudos
Reply