I2C Peripheral address and Peripheral Register address for embedded coder sensor fusion
7 次查看(过去 30 天)
显示 更早的评论
Hello, As part of my master thesis, I am working on STM32F411 Discovery board which has an onboard LSM303AGR sensor for MEMS.
My aim is to use this sensor inputs and make a mathematical model in simulink. For this purpose, I want to interface the sensor via serial communication to get continous data input from the onboard accelerometer. The embedded coder has I2C read and write blocks, and I am using this example for sensor fusion:
I am trying to replace the blocks inside this model with my target hardware I2C read and I2C write block however, I do not understand the terminology used in simulink blocks.
I have found the I2C address and I2C register address from the sensor data sheet but which address belong to which simulink block address, I am not sure. below are the addresses from datasheet
There are not many examples from where I can understand. I also looked over the block description but it does not explain much exactly what address is being referred to. Has anyone worked with I2C sensor fusion in simulink and came across this or know in general which address is which?
0 个评论
采纳的回答
Raghavendra Kandur
2023-9-7
The "SAD" column of first table corresponds to "Peripheral address" used in I2C block.
The "Register address" column of second table corresponds to "Peripheral register address" used in I2C block.
2 个评论
Vikky Patil
2023-9-21
You need to configure the Data rate in CTRL_REG1_A as part of Initialize Function. Else the sensor will be always in Power-down mode
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!