cancel
Showing results for 
Search instead for 
Did you mean: 

SPI issue keep getting 0 values from accelerometer

NicRoberts
Associate III

NUCLEO-WB55RG communicating via SPI1 to an ADXL362 eval board
I set up the project (attched below) using CubeIDE, generated the code & placed my own callbacks for the SPI in main.

When I look at the value for the Z direction I should be getting a value that indicates roughly 1g but all I get is 0. The same for all the other axis, no change in any value no matter how I orient the sensor.

To check that the acceleromter was working I hooked it up to an Arduino using a 3rd party library especially for the ADXL362. That all worked as expected, so I know the accelerometer is working.

When I go through the code with the debugger it doesn't hang anywhere so I'm guessing my callbacks are working, its just I dont get any data back, all values remain at 0

Anyone see anything obvious that I'm doing wrong?

1 REPLY 1

Check if Arduino Library is doing something to initialize/start the accelerometer. I remember the Bosch devices needing a quick magic sequence and scale selection. 

Get a scope or logic analyzer on the pins and review working and non-working signals.

Link to github library for working driver you're using / attempting to port

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..