SparkFun LSM9DS1 with Simulink

조회 수: 2 (최근 30일)
Tarik Zengin
Tarik Zengin 2021년 4월 5일
댓글: Andrew Rich 2021년 11월 3일
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에서 Raspberry Pi Hardware에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by