2019-07-26 07:25 AM
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
Solved! Go to Solution.
2019-08-02 04:56 AM
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
2019-07-26 08:03 AM
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.
2019-07-26 08:16 AM
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
2019-07-26 08:51 AM
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
2019-07-29 07:07 AM
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
2019-08-02 04:56 AM
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
2022-02-03 12:02 PM