cancel
Showing results for 
Search instead for 
Did you mean: 

WHO_AM_I values / readout problems

FNied
Associate II

Hi,

I "think" I have a H3LIS331DL (mounted on its back due to hardware issues with the SAMLC21 based prototype and now fixed with glue). I am aware of the obvious changes in accel directions, but just want to get the prototype running. When reading the WHO_AM_I I get the value of 0b10110010 (and not 0b00110010). I am using SPI at 5MHz, MOSI and MISO look fine with MISO going to high on the falling (9th) SCLK edge in preparation of the first bit being a 1.

A test read of the CTRL_REG1 which powers up to 0b00000111 according to the data sheet gives me the value 0b00000111.

Can it simply be a wrong chip? If so: which one?

Anybody seeing similar problems?

Thanks

Frieder

1 ACCEPTED SOLUTION

Accepted Solutions
FNied
Associate II

Hi,

Problem is solved. It was a H2LIS331DL for sure. However, pin 15 was not tied to VDD, but GND instead. So the digital part of the chip was receiving power, but the analog/accelerator portion was not...Luckily some engineer at ST had the insight to modify WHO_AM_I in such a case. Chapeau.

Frieder

View solution in original post

6 REPLIES 6

Sounds like a clock phase issue. Should perhaps try bit-banging at low rate to confirm devices reads correctly, and then changing the phase/polarity settings or equivalent on the ATMEL part.

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

Thanks Clive for your fast response.

That, too , was one of my thoughts, but I saw the same behaviour having SCLK being low in idle. Now I have SCLK being high when idling just as the data sheet recommends. No change. A clock phase issue would also more likely cause a complete shift of the byte.

This picture shows the first clocking of the address 0b10001111 (Read + WHO_AM_I) (CS, MOSI, MISO, SCLK)

This picture shows the second SCLK when sending out a dummy 0x00 to obtain the register contents.

The yellow line is the CS, but since it is software driven thei edges are way out left (and right).

But I havent yet did the bit banging of the signals by hand. Hoped to get away with it :)

Thanks

Frieder

FNied
Associate II

whoops, dont know where the pictures went that included in my first answer! But I just tried writing various values to CTRL_REG1 and reading them back. That works perfectly, so I am thinking that WHO_AM_I simply might be wrong (or I am using a similar chip).

Frieder

HI Frieder, you can also check from a visual inspection of the top package if you have an H3LIS331DL in hands, comparing it with the picture here below. Regards

0690X000009ZaDsQAK.png

FNied
Associate II

Hi,

Problem is solved. It was a H2LIS331DL for sure. However, pin 15 was not tied to VDD, but GND instead. So the digital part of the chip was receiving power, but the analog/accelerator portion was not...Luckily some engineer at ST had the insight to modify WHO_AM_I in such a case. Chapeau.

Frieder

CLi.11
Associate II

All zero for me in SPI mode