I2C on LPC1769 with adxl345

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

I2C on LPC1769 with adxl345

440 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Harukana on Fri Apr 12 23:45:36 MST 2013
I'm currently working on a project dealing with adxl345 on lpc1769 and i'm using LPCXpresso to write the program. However i did not manage to read the data from the adxl345 itself and the result keeps returning just the decimal value of the register address. Is it because the i2cread() function is not working or it is because of some initialization problem? Anybody could offer some help T.T ? thank you in prior . and here attached is my code
0 Kudos
Reply
3 Replies

403 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Tue Apr 16 00:09:51 MST 2013
Did you shift the 7-bit device address to the left and added the read/write bit? because otherwise your ADXL345 will not respond.
I scanned quickly through your code and found a few things

Quote:

#define DEVICE 0x00 // Device address as specified in data sheet


where the device address should be 0x53 and a little bit further in your code:

Quote:

/*Send slave address first
datval[0] = 0xE5;
I2CWrite([COLOR=red]DEVICE[/COLOR], datval, 1);



Better take a good look at your code and when you modify samples read them over and over.

Or i misinterpreted something...
0 Kudos
Reply

403 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alpha ads on Mon Apr 15 22:33:23 MST 2013
Waow


Bus Shelter
0 Kudos
Reply

403 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by daniel.widyanto on Mon Apr 15 21:27:51 MST 2013
Hook your oscilloscope and see whether the signal match the adxl345 spec ?
0 Kudos
Reply