# ADXL345 range configuration

Document created by analog-archivist on Feb 23, 2016
Version 1Show Document

### Q

I have some questions about the 0x31 DATA_FORMAT register of our ADXL345.
If I set DATA_FORMAT = 0x00, make the Gee Range = +/-2g, then I can get 1g =
256 and this is reasonable (2^10/4g=256)

If I set DATA_FORMAT = 0x02, make the Gee Range = +/-4g, then I can get 1g = 64
and this seems the resolution of ADC is just 9 bits. (64*8 = 512 = 2^9)

If I set DATA_FORMAT = 0x01, make the Gee Range = +/-8g, then I can get 1g =
128 and this seems the resolution of ADC is just 11 bits. (128*16 = 2048 = 2^11)

If I set DATA_FORMAT = 0x03, make the Gee Range = +/-16g, then I can get 1g =
32 and this seems the resolution of ADC is just 10 bits. (32*32 = 1024 = 2^10)

But if I set DATA_FORMAT = 0x08, make the Gee Range = +/-16g, then I can get 1g
= 256 and this is reasonable (2^13/32g=256) but what is the difference between
DATA_FORMAT = 0x08 and DATA_FORMAT = 0x03.

We can find the relationship between output resolution and Gee Range on page 3
of our datasheet. But the EVB result of mine is not accord with this
relationship.

### A

I think I know the problem. The top line of table 10 in the data sheet is
mislabeled. Here is the correct information:

D1 D0 Gee Range
0 0 ±2
0 1 ±4
1 0 ±8
1 1 ±16

By the way - The best operating mode is to just leave it in 13-bit mode (Set
DATA_FORMAT bit D3). This way data is always 4mg/LSB regardless of the range of
data you expect. This is useful because it's hard to always know what maximum
acceleration you will get. If you are truly not interested in anything over 2g,
for example, just add a simple saturation routine (i.e. if any of the 3 MSBs
are 1 then acceleration =2g).