SparkFun LSM9DS1 with Simulink

2 次查看(过去 30 天)
Hi,
Simulink Support Package for Raspberry Pi has a block for LSM9DS1 IMU sensor. However, this block belongs to the SenseHat group. So it acquires data from the sensehat board. SenseHat has this sensor working in SPI mode, see the SenseHat Schematics . (This IMU IC has I2C mode as well.)
Sparkfun also has a breakout board having the same IC. SparkFun 9DoF IMU Breakout - LSM9DS1. It supports both SPI and I2C interfaces.
Is it possible to read this breakout board using the Simulink LSM9DS1 block? If so, how would the connection be? I have tried directly connecting the I2C pins to Raspi GPIO (SDA, SCL) but it didn't work. Breakout board was set to I2C mode. There are some jumpers on the PCB to set the board to SPI mode. These have to be cut in order to use it with SPI connection. I didn't want to cut the traces without knowing it will work or not. SenseHat schematics show that the interrupt pins of LSM9DS1 are connected to an ATtiny MCU. I could't find the realted part in the sensehat firmware. Therefore I don't know what to connect the interrupt pins of the Sparkfun breakout board.
Is there anyone who could read this breakout board using only simulink? An s-function would be a solution but it will take some time to implement the LSM9DS1 library to simulink. Any recommendations?

采纳的回答

Tarik Zengin
Tarik Zengin 2021-4-5
Apparently it was possible. I just found out how to do it when I compare the schematics of the two boards.
So pulling up the CS pins to VDD and pulling down the SDO pins to ground on the Sparkfun breakout board were enough. Not Simulink block of LSM9DS1 reads all the 3 sensors.
PS: I was wrong with the SenseHat reading the sensor in SPI mode. It reads the sensor in I2C mode.
  1 个评论
Andrew Rich
Andrew Rich 2021-11-3
Hey just out of curiousity, how did you get this work? I am trying to use the gyro on the breakout board but I can not get it to work. Please let me know.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Run on Target Hardware 的更多信息

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by