# H3LIS331DL using SPI

**URL:** <https://community.sparkfun.com/t/h3lis331dl-using-spi/39887>\
**Category:** IMU & Motion\
**Created:** [June 24, 2020, 4:03am UTC](https://community.sparkfun.com/t/h3lis331dl-using-spi/39887 "2020-06-24T04:03:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Earache](https://avatars.discourse-cdn.com/v4/letter/e/dc4da7/32.png) [@Earache](https://community.sparkfun.com/u/Earache)\
**Post date:** [June 24, 2020, 4:03am UTC](https://community.sparkfun.com/t/h3lis331dl-using-spi/39887/1 "2020-06-24T04:03:26Z")

</div>

I have a Teensy 4.1 driving an ICM-20948, a UBLOX SAM-M8Q, a third party MS5611, and an H3LIS331DL. The UBLOX is on a serial port. I can get the other three to work on I2C just fine. However, I need SPI for speed. I can get the ICM-20984 and the MS5561 working just fine on SPI but in spite of everything I’ve tried I can’t get the H3LIS331DL to work on SPI. It just gives a -1 count. I’ve tried different CS lines, different SPI modes, etc. Does anyone have working SPI code for a SparkFun H3LIS331DL?

---

<div class="post-metadata">

**Author:** ![Earache](https://avatars.discourse-cdn.com/v4/letter/e/dc4da7/32.png) [@Earache](https://community.sparkfun.com/u/Earache)\
**Post date:** [June 25, 2020, 10:19pm UTC](https://community.sparkfun.com/t/h3lis331dl-using-spi/39887/2 "2020-06-25T22:19:25Z")

</div>

Nevermind. Finally got it working. Teensy was VERY particular about which pins to use for CS.
