Friday, April 25, 2025

Linux - reading the ADXL355 data registers

 This has had me stumped for months.  No matter what I did, I could not read the data registers.  The 355 is a very sensitive accelerometer and has been around for years.  Lots of support ending with 'I got it solved', and no hint as to what finally did it.

Now, in an exclusive to this paper, we divulge the secret, rendered down the simplest.

On your rp5, you set up the I2c.  This is all over the place.  Then do i2cdetect -y 1 and you get the famous 1d signal.  You are hooked up, and you can read and write all the registers, but the data registers are all zero.

Reset the darn thing for fun

i2cset -y 1 0x1d 0x2f 0x52

i2cset and i2cget are simplest thing to do for 12c.  No use going to python if you can't get this working.  Manths and months!

Now, you have to superstitiously and religiously do these 3 lines in sequence.

i2cset -y 1 0x1d 0x2d 0x00

 i2cset -y 1 0x1d 0x2c 0x00

 i2cset -y 1 0x1d 0x28 0x00

These are the stinking default values!  You wouldn't think.  But you have to do it.

henv) harold@rasp5:~ $ i2cget -y 1 0x1d 0x09

0xc4

Then the data flows!  I'll go back to all the drivers I have, none of which do this.

ps this continues my dream of the 2-buck accelerometer which will save us all from earthquakes, or not.

ps  suddenly the rp5 refuses to talk to any of my adxl355 boards.  345 still works.  blah.

2 comments:

Neil T said...

Quite possibly the most "interesting" post in the history of the internet. Grin.

Harold Asmis said...

I know, better than a fusion or battery improvement.