Why wrong sensor answer on SPI bus?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-06-04 11:25 AM
Hi to all.
I correctly set SPI bus as reported on LIS3DSH datasheet:
- Figure 3. SPI slave timing diagram (page 14)
- Figure 7. Read and write protocol (page 25)
Here waveforms:
As first operation I detect sensor reading WHO_AM_I register and getting 0 as output value.
I set wrong SPI bus settings (CLOCK idle value low) and it works.
Why?
Yellow = CS
Green = SDI (data to sensor)
Blue = SCK
Red = SDO (data from sensor)
- Labels:
-
SPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-06-05 2:44 AM
Hi @mbertoni​ , may it be related to the SPI mode timing you have selected at master level for the decoding of the SPI pattern? Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-15 11:45 PM
You need to set data word size to 16 bit, so you would have constant 16 clock cycles on SCLK line, now you have 8.
