January 30, 2011
University of California Davis
En Fr NL
asm C perl php
about 2 years ago
Page 2 “The accelerometer is initialized to log data at 100 Hz with +/- 2g range.”
Each column is data from one of the three axes and each word is a hexadecimal ascii representation of the acceleration value. To decode this, capture the data into a text file and then read it into Excel. Refer to the post above that starts with “The simplest way I found” and write back if that’s not clear enough.
From the description “The evaluation board includes everything you’ll need to adjust the ADXL345’s settings, and monitor and log its outputs. The on-board ATmega328 … will also log the x-, y-, and z-axis acceleration values onto a uSD card.”
What is it you’re missing?
about 4 years ago
The simplest way I found was to use a spreadsheet program like Excel and use the built-in function hex2dec(). You may need to follow that up with an if() to do the two’s complement adjustment, as my Excel didn’t seem to recognize negatives.
A1 contains fffd
A2 contains =hex2dec(A1)
A2 shows 65533
A3 contains =if(A2>32767;A2-65536;A2)
A3 shows -3
When plotting, you may also want to calculate the absolute magnitude of the three channels by squaring the signed decimal value of each channel using =power(), summing all the squared values and then taking the square root using =sqrt().
Thanks for a great board and especially for sharing the schematics and code. I’d like to share some novice gotchas:
1. Beware of the Pocket Programmer and its ‘Power Target’ switch which will apply 5V to the board. While the ‘328 doesn’t mind, the ADXL345 has an absolute maximum rating of 3.9V. I feel lucky.
2. Beware of the labels on the header socket JP1 - the signals labelled 'PC6’ and ‘PC7’ go to ADC6 and ADC7 on the 328P and not to PORTC. Although there is a PC6, it does not come out on the header (you can’t use it anyway because it’s shared with !RESET) and there’s no such thing as PC7.
No public wish lists :(
Forgot your password?
No account? Register one!