
ADXL345 Evaluation Board
2009.09.14
© 2009 SparkFun Electronics, Inc. All Rights Reserved. Product features, specifications, system requirements and availability are subject to change without notice.
ADXL345 (SEN-09364) is a trademark of SparkFun Electronics, Inc. All other trademarks contained herein are the property of their respective owners.
ADXL345_UG_090914
command interface. After the ADXL345 registers are initialized, the accelerometer is put into measurement mode.
ADXL345 Register (Hex Address) Initialization Value (Different than the registers
'default' value)
Data Format(0x31) 0x20
Interrupt Enable (0x2E) 0x80
Once the accelerometer is put into measurement mode the evaluation board begins logging accelerometer data from
all three axis to the log file at 100 Hz. Data is logged to the csv file in the format 'XXXX\tYYYY\tZZZZ\n.' That is 4
characters representing the integer value of the accelerometer reading are logged for each axis. The X value is
logged first, followed by a 'TAB' character and the Y value, followed by another 'TAB' character and then the Z value,
finally the log is finished with the New Line character. The measurement rate is determined by the ADXL345 registers
and can be changed by modifying the BW_RATE register value. The maximum bandwidth that the evaluation board
supports using the default firmware is 200 Hz. This limitation is imposed by the UART (set to 57600 bps) and can be
changed by writing custom firmware that bypasses the printing statements that occur after every reading.
Once the accelerometer enters the logging mode, logging will continue until either the device is turned off, reset, or
the user interrupts the logging mode by using the command interface. The command interface provides the user with
a means of changing the register values of the ADXL345 through a serial command set. The command interface will
be covered in depth in the next section.
There are three status LEDs on board the ADXL345 Evaluation Board. The STAT1 LED (Red), is used to tell the user
when data is logged to the SD card. Every time the device logs a buffer to the SD card, the LED will flash on and off.
The STAT2 and STAT3 LEDs are used to indicate to the user when the ADXL345 triggers an interrupt on the INT1
and INT2 pins respectively. By default, the Data Ready interrupt is enabled and mapped to the INT1 pin, however this
interrupt does not trigger the LED so that it can more easily be used as an interrupt indicator for other interrupts. If
enabled, the Overrun and Watermark interrupts will not trigger the INT1 LED either, however Data Ready, Overrun
and Watermark interrupts will trigger the INT2 LED if they are mapped to the INT2 pin.
Keep in mind that the Data Ready interrupt is used to trigger accelerometer readings on the evaluation board only
while it is enabled and mapped to the INT1 pin. If the Data Ready interrupt is disabled, or mapped to the INT2 pin,
accelerometer data will no longer be read, logged or displayed.
Using the Command Interface to Modify Register Settings
The Command Interface on the ADXL345 Evaluation Board provides the user a way to modify the registers on the
ADXL345 Accelerometer in order to evaluate the different operating modes of the device. The command interface is
accessed from the USB connector via a Virtual Com Port. It's easy to use this interface: plug a mini USB cable from a
computer into the evaluation board. Once the cable is plugged in, turn the evaluation board on. On the computer,
open your favorite terminal program (around here, the terminal program of choice is TeraTerm). Create a connection
to the Virtual Com Port using the settings for 8 bit characters, no parity, 1 stop bit, and set the baud rate to 57600
bps. Once you've set up your terminal program for these settings, open your connection. If the device is on you
should see the accelerometer values streaming across the first line of the terminal. The values should be updating at
100 Hz. If you don't see the accelerometer values, try unplugging the USB cable from the evaluation board and
plugging it back in (you may also have to restart the terminal program).
Once you've successfully created a terminal connection you can access the command interface. Press any key while
the terminal is active to halt the accelerometer readings. When a key is pressed, the evaluation board puts the
Figure 3