Read Data from IMU and Environmental Sensors in C2000 issue
4 views (last 30 days)
Show older comments
I am trying to run the following example
Read Data from IMU and Environmental Sensors.
It is running but showing only zero results.
What could be the possible reasons.
0 Comments
Answers (1)
Pavl M.
on 14 Oct 2024
Edited: Pavl M.
on 14 Oct 2024
Dear Friends,
It is really good question. All N questions here deserves all N optimal answers.
What with hardware board? How do you connect your hardware? Which OS driver and detection UI?
Can you require industrial marketable applications of it?
Diagnostic: The BMI160 is on TI board, not on breakout board like BMM150 I2C connected sensor, from the picture it can be seen that Simulink block reading works ok, so the answer is check your hardware board and plugin module connection USB link and your OS drivers for specific hardware board.
4 Comments
Pavl M.
on 17 Oct 2024
Edited: Pavl M.
on 17 Oct 2024
It is related to
C2000 Microcontroller Blockset / Sensors
Have you configured Hardware Implementation > Target hardware resources ?
Are you on I2C_A?
Try 0x68 and 0x69 addresses.
https://fr.mathworks.com/help/coder/nvidia/ref/bmi160.html?searchHighlight=BMM160&s_tid=srchtitle_support_results_4_BMM160
https://fr.mathworks.com/help/ti-c2000/ref/bmi160.html?searchHighlight=BMM160&s_tid=srchtitle_support_results_7_BMM160
The data comes from electric analog levels sampled as boolean levels to memory buffers and than as characters in Simulink.
Also they support NVIDIA boards as well. NVIDIA are SOTA boards in the domain. So this facutally quite substantiall valuable job we do.
...
Select appropriate GPIO pins for SDA and SCL in Hardware Implementation
In the Hardware tab of Simulink model, click Monitor & Tune. You can observe from the Diagnostic Viewer that the code is generated for the model and the host connects to the target after loading the generated executable.
5. Rotate the board about its axis. You can observe that the value displayed in the Display block connected to Angular Rate output of the block is changing.
After you complete the configurations settings for the c28x_i2c_bmi160_sensor model, perform these steps:
1. Connect the BOOSTXL-SENSORS plug-in module to the F28379D LaunchPad. Connect GPIO104 and GPIO105 pins on the F28379D Launchpad to the J1.10 (SDA) and J1.9 (SCL) pins respectively on the BOOSTXL-SENSORS, and complete the other required connections like VDD and GND. For more details, refer to the Schematics section of the BOOSTXL-SENSORS BoosterPack Plug-in Module User's Guide.
2. Connect the F28379D LaunchPad to the host computer.
2. In the Configuration Parameters window of c28x_i2c_bmi160_sensor model, click Hardware Implementation and navigate to Target hardware resources > External mode, and set the Serial port in MATLAB Preferences parameter to the corresponding COM port to which the Launchpad is connected. The COM port is available at Device Manager > Ports (COM & LTP) in Windows.
What about Linux derivatives and MacOS, Android OS for it?
3. Select appropriate GPIO pins for SDA and SCL in Hardware Implementation > I2C_A pane, to communicate with BOOSTXL-SENSORS based on the actual hardware connections from the F28379D Launchpad.
Thanks for reasonable kindness. OK. There is continuous interest from my side to get the things in order working and utilize it towards utmost marketable state of the art, professional industrious quality.
I maintain a few boards at my place, waiting for real substantial investment. Upon necessary financial transfer deliverd to me via IBAN/SWIFT I will guarantee (In contrast to most others I do provide warantee on specific hardware and software jobs/service if my salary, which I wait for already more than 3 years for (not receive my salary for so much more than 3 calendar years ) further study and R&D of specific tasks vs monthly rate.
What is Static Electricity surface impact curve and practical safety rules? They just warn that Electrostatic concern is pertinent, but which level, way, how does it practically come and impact the board hardware?
I think there are no EM ways around your board, that can so affect your sensors readings.
I am liable for polling this working thread.
I think and 100% sure BP-BASSENSORSMKII is just a hardware board from TI connectable to the F28379D based launchpad kit board. Aka Building Automation Systems Sensors MKII BoosterPack plug-in module.
Bosch BMI160 Inertial measurement Unit is the sensor placed (wired) on it and connected to launchpad kit board. The launchpard kit board extensions to be configured correctly in sysconfig.conf, .syscfg, .h files.
The following software examples are included with the Sensor and Actuator Plugin for SimpleLink MCU SDKs (see Table 8). These examples can be found in the SIMPLELINK-SDK-SENSOR-ACTUATORPLUGIN , which is commonly installed as C:\ti\sail. Note that the SimpleLink SDK for your MCU must be installed alongside the SAIL plugin. Within the sail folder, the software examples are located in examples/rtos/[LaunchPad]/sail/. The software examples are compatible with the following LaunchPads: • CC1310_LAUNCHXL • CC1352R_LAUNCHXL • CC2640R2_LAUNCHXL • CC3220S_LAUNCHXL • CC3220SF_LAUNCHXL • MSP_EXP432E401Y • MSP_EXP432P401R T
To use one of the software examples with the LaunchPad development kit, the user must have an integrated development environment (IDE) that supports the SimpleLink MCU devices:
IAR
KEIL
CodeComposer Studio
Have you assured your the board and module connected correctly (all jumpers and pins set to listen and transmit data from wired Bosch sensor)?
Have you measued with scope the sensor pins' and launchpad pins' waveforms when you power the board and move the sensors pad?
I think you need to check driverlib in your Matlab Simulink dedicated board directories.
Here is an example of embedded C code, that reads temperature and humidity sensors:
...
txBuffer[0] = 0x04;
i2cTransaction.slaveAddress = Board_HDC2080_ADDR;
i2cTransaction.writeBuf = txBuffer;
i2cTransaction.writeCount = 1;
i2cTransaction.readBuf = rxBuffer;
i2cTransaction.readCount = 1;
if (!I2C_transfer(i2c, &i2cTransaction)) {
System_printf("I2C bus fault - data ready check\n");
}
/* DRDY redundancy check */
if (rxBuffer[0] != 0x80) {
System_printf("data not ready even though interrupt fired!");
}
else {
/* read temperature high register. the register pointer
* auto-increments, allowing us to read all temperature/humidity
* registers in one i2c transaction
*/
txBuffer[0] = 0x00;
i2cTransaction.slaveAddress = Board_HDC2080_ADDR;
i2cTransaction.writeBuf = txBuffer;
i2cTransaction.writeCount = 1;
i2cTransaction.readBuf = rxBuffer;
i2cTransaction.readCount = 4;
if (!I2C_transfer(i2c, &i2cTransaction)) {
System_printf("I2C bus fault - temperature read\n");
}
temperature_raw = (rxBuffer[1] << 8) + rxBuffer[0];
temp_C = (temperature_raw/65536.0)*165-40;
humidity_raw = (rxBuffer[3] << 8) + rxBuffer[2];
rel_H = (humidity_raw/65536.0)*100;
...
What TCE Simulink software means by (BOOSTXL-SENSORS) BoosterPack plugin module? Do they mean the sole TI Building Automation Systems Sensors MKII BoosterPack plug-in module extension board only or the board with TI supplied C drivers codesset and configs or do they mean their Simulink tailored set of C/C++ .h and .m files and config files, .json, libs for driving (drivers) the "pipe" communication link from the plugin-module extension board sensors and acuators through launchpad by USB or virtual COM port over USB?
HW Analysis:
From your specific, you meant BMI160 6 Axis IMU,
which is acc. to Figure 9 Schematics is on I2C Address 0x69 (7 bit)
Motivational Subtask Concept:
There are numerous market leader SOTA Sumsung 4G+ smart-phones that has not possibility to measure space orientation, no compasses.
Can the board's magnetic field sensor (BMM150) accurately function as Digital Compass?
Specify how often this block reads the data from the BMM150 sensor. When you set this parameter to -1, Simulink determines the best sample time for the block based on the block context within the model.
Specify the preset value for the operating condition of BMM150 sensor while reading the values. The selection of one of the four preset values affects the electrical characteristics (like supply current) and the required output accuracy with respect to ODR and output noise.
Which accuracy? With which precision?
I mostly sure that BOOSTXL-SENSORS BoosterPackTM Plug-in Module User's Guide is next:
https://www.ti.com/lit/ug/slau829/slau829.pdf?ts=1729171847351&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FBP-BASSENSORSMKII
right?
P.S.:->
I don't have really many resources and many time. They, others took from me. I invested already 50 calendar monthes in Automotive, Vehicular Systems investigations and R&D. Let me recive ROI on it. To receive is needed. Please let them give me asap. If you will give me I will liably surve your needs.
Will appreciate, happy, glad and thankful if business entity come and indeed hire, recruit, employ me long term for service and constructive works on manageable equipment.
Kindly contact me more in private for work, business, educational, active learning projects. Which project to contribute to, which things to make in order up and running? In exchange for what?
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!