AnsweredAssumed Answered

ADXL362 Z data incorrect

Question asked by WallaceZhang on Jul 25, 2016
Latest reply on Aug 17, 2017 by EdwardRex

Hi,

I'm using ADXL362B + Nordic nRF52832 now, the spi communication is working(I guess).

I read ADXL362_REG_DEVID_AD, ADXL362_REG_DEVID_MST, ADXL362_REG_PARTID registers, the value is same as datasheet.

ADXL362_GetRegisterValue(&regValue, ADXL362_REG_DEVID_AD, 1);-----0xAD

ADXL362_GetRegisterValue(&regValue, ADXL362_REG_DEVID_MST, 1);----0x1D

ADXL362_GetRegisterValue(&regValue, ADXL362_REG_PARTID, 1);    -----0xF2

 

But I found the Z axis data looks like incorrect. The init process is as below:

ADXL362_Init();

ADXL362_SoftwareReset();

nrf_delay_ms(100);

ADXL362_SetRange(ADXL362_RANGE_2G);//2G

ADXL362_SetOutputRate(ADXL362_ODR_100_HZ);

ADXL362_SetPowerMode(1);

nrf_delay_ms(200);

 

Then I start a timer to read x y z data repeatly(20ms).

void timer_step_event_handler(void* p_context)

{

  short x,y,z;

  ADXL362_GetXyz(&x, &y, &z);

  printf("x = %d, y = %d, z = %d\r\n",x, y, z);

}

I got the data as below: Test accordingto datasheet P42.

The Z data is always 1244 and -877  from TOP and Bottom.

X data:

x = 990, y = -20, z = 236

x = 984, y = -24, z = 231

x = 988, y = -20, z = 232

 

x = -1042, y = 48, z = 303

x = -1044, y = 47, z = 294

x = -1040, y = 48, z = 300

 

Y data:

x = -57, y = 1199, z = 184

x = -55, y = 1196, z = 185

x = -53, y = 1192, z = 188

 

x = -57, y = -1140, z = 95

x = -29, y = -1151, z = 116

x = -18, y = -1149, z = 127

 

Z data:

x = -129, y = 19, z = 1244

x = -125, y = 16, z = 1244

x = -132, y = 17, z = 1240

 

x = -103, y = 115, z = -874

x = -96, y = 115, z = -877

x = -89, y = 113, z = -874

x = -89, y = 116, z = -877

Outcomes