You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge in MCU16CE/matlab-dspic33a-curiosity-i2cexample-mpu9250 from develop to main
* commit 'cb5ba03b8ca2e126a31734fe7f671793d95dd0cb':
minor read me modifiaction
chnagelog and json files modified
copied the project with commit (a9213d71000a999c726bbcf2cb93b900b8591e2f) on December 3, 2025 3:58:02 PM
"shortDescription":"MATLAB/Simulink Model for I2C Peripheral Example: Rolland Pitch Angles Esitimation using Curiosity Platform Development Board, dsPIC33AK128MC106 Curiosity GP DIM and MPU9250",
10
+
"shortDescription":"MATLAB/Simulink Model for I2C Peripheral Example: Roll, Pitch and Yaw Angles Esitimation using Curiosity Platform Development Board, dsPIC33AK128MC106 Curiosity GP DIM and MPU9250",
# MATLAB/Simulink Model for I2C Peripheral Example: Rolland Pitch Angles Estimation using Curiosity Platform Development Board, dsPIC33AK128MC106 Curiosity GP DIM and MPU9250
7
+
# MATLAB/Simulink Model for I2C Peripheral Example: Roll, Pitch and Yaw Angles Estimation using Curiosity Platform Development Board, dsPIC33AK128MC106 Curiosity GP DIM and MPU9250
8
8
9
9
## 1. INTRODUCTION
10
10
11
11
This document describes the setup requirements for demonstration of I2C communication on the hardware platform
12
12
[EV74H48A](https://www.microchip.com/en-us/development-tool/EV74H48A) "Curiosity Platform Development Board" and [EV02G02A](https://www.microchip.com/en-us/development-tool/EV02G02A) "dsPIC33AK128MC106 General Purpose Dual In-Line Module (DIM)" using MPU9250 sensor on the MPU 9DOF Click Board.</p>
13
13
14
-
MPU-9250 is a multi-chip module (MCM) with 9-axis Motion Tracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and a Digital Motion Processor™ (DMP). This example exclusively uses 3-axis gyroscope, and the 3-axis accelerometer to estimate the rolland pitch angles.
14
+
MPU-9250 is a multi-chip module (MCM) with 9-axis Motion Tracking device that combines a <b>3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and a Digital Motion Processor™ (DMP)</b>. This example uses all the three sensors to estimate the roll, pitch and yaw angles.
15
15
16
16
## 2. SUGGESTED DEMONSTRATION REQUIREMENTS
17
17
@@ -25,14 +25,15 @@ To clone or download this MATLAB model on GitHub,
25
25
26
26
- MPLAB® X IDE **v6.25**
27
27
- MPLAB® XC-DSC Compiler **v3.21**
28
-
- MATLAB R2024b
28
+
- MATLAB R2025b
29
29
- Required MATLAB add-on packages
30
-
- Simulink (v24.2)
31
-
- Simulink Coder (v24.2)
32
-
- MATLAB Coder (v24.2)
33
-
- Embedded Coder (v24.2)
30
+
- Simulink (v25.2)
31
+
- Simulink Coder (v25.2)
32
+
- MATLAB Coder (v25.2)
33
+
- Embedded Coder (v25.2)
34
34
- MPLAB Device blocks for Simulink (v3.62)
35
-
- Motor Control Blockset (v24.2)
35
+
- Motor Control Blockset (v25.2)
36
+
36
37
> **_NOTE:_**
37
38
>The software tools used for testing the model during release is listed above. It is recommended to use the version listed above or later versions for building the model.
38
39
@@ -52,12 +53,12 @@ This section describes the hardware setup required for the demonstration.
2. Insert the **MPU 9DOF CLICK** into the **mikro BUS A** interface **connector J13** on the development board. Make sure the click board is inserted correctly before going ahead.
56
+
2. Insert the **MPU 9DOF click** into the **mikro BUS A** interface **connector J13** on the development board. Make sure the click board is inserted correctly before going ahead.
56
57
57
58
<palign="left" >
58
59
<img src="images/microbusA.png"width="500"></p>
59
60
60
-
3. The development board has an onboard programmer **PICkit™ On Board (PKoBv4)**, which can be used for programming or debugging the microcontroller or dsPIC DSC on the DIM. To use the onboard programmer, connect a Micro-C® cable between the Host PC and **connector J24** on the development board.
61
+
3. The development board has an onboard programmer **PICkit™ On Board (PKoBv4)**, which can be used for programming or debugging the microcontroller or dsPIC DSC on the DIM. To use the onboard programmer, connect a Micro-C® cable between the Host PC and **connector J24** on the development board.
61
62
62
63
The development board is also powered by this USB itself.
63
64
@@ -74,14 +75,14 @@ This section describes the hardware setup required for the demonstration.
74
75
<palign="left" >
75
76
<img src="images/dem1.png"width="500"></p>
76
77
77
-
3. Double click on the I2C example Simulink model - **curiosity_i2c_pitch_roll.slx**. This opens the Simulink model as shown below.
78
+
3. Double click on the I2C example Simulink model - **curiosity_i2c_pitch_roll_yaw.slx**. This opens the Simulink model as shown below.
78
79
79
80
<p align="left">
80
81
<img src="images/dem3.png"width="500"></p>
81
82
</p>
82
83
83
84
> **Note:** </br>
84
-
>This example demonstrates only the code generation to demonstrate the I2C communication. The simulation is not possible in this case.
85
+
>This example demonstrates only the code generation to demostrate the I2C communication. The simulation is not possible in this case.
85
86
86
87
4. <pstyle='text-align: justify;'>From this Simulink model an MPLAB X project can be generated, and it can be used to run the I2C Communication using development board. <pstyle='text-align: justify;'>To generate the code from the Simulink model, go to the <b>"MICROCHIP"</b> tab, and enable the tabs shown in the figure below.
87
88
@@ -108,19 +109,19 @@ This section describes the hardware setup required for the demonstration.
108
109
<p align="left">
109
110
<img src="images/dem7.png"width="500"></p>
110
111
111
-
8. </p><pstyle='text-align: justify;'> The <b>General Purpose LEDs</b> will be blinking.
112
+
8. </p><pstyle='text-align: justify;'> The <b>General Purpose LED's</b> will be blinking.
112
113
113
114
<palign="left">
114
115
<img src="images/debug_led.png"width="500"></p>
115
116
</p>
116
117
117
-
9. <pstyle='text-align: justify;'> The <b> RGB LED</b> will be glowing in different colors. To increase the brightness of the RGB LED, vary the <b>Potentiometer</b> on the development board.
118
+
9. <pstyle='text-align: justify;'> The <b> RGB LEB</b> will be glowing in different colors. To increase the brightness of the RGB LED, vary the <b>Potentiometer</b> on the development board.
118
119
119
120
<palign="left">
120
121
<img src="images/led_rgb.png"width="500"></p>
121
122
</p>
122
123
123
-
10. <pstyle='text-align: justify;'> To visualize the estimated rolland pitch angles from the <b>accelerometer, gyroscope sensors of MPU9250</b> double click on the scope. This opens the scope view. Tilt or turn the development board by hand to view variations in the rolland pitch angles.
124
+
10. <pstyle='text-align: justify;'> To visualize the estimated roll, pitch and yaw angles from the <b>accelerometer, gyroscope </b> and <b> magnetometer</b> sensors of <b>MPU9250</b> double click on the scope. This opens the scope view. Tilt or turn the development board by hand to view variations in the roll, pitch and yaw angles.
124
125
125
126
<palign="left">
126
127
<img src="images/dem9.png"width="500"></p>
@@ -133,8 +134,7 @@ This section describes the hardware setup required for the demonstration.
133
134
</p>
134
135
135
136
> **Note:** </br>
136
-
>At each startup, the system calibrates the accelerometer and gyroscope of the **MPU 9DOF Click board**. During this 2-second calibration period, the **development board** and **MPU 9DOF Click board** must remain stationary (do not move/ shake). After calibration, the board can be tilted or rotated to observe angle variations.
137
-
137
+
>At each startup, the system calibrates the **accelerometer, gyroscope** and **magnetometer** of the **MPU 9DOF Click board**. During this 2-second calibration period, the **development board** and **MPU 9DOF Click board** must remain stationary (do not move/ shake). After calibration, the board can be tilted or rotated to observe angle variations.
138
138
139
139
## REFERENCES:
140
140
For more information, refer to the following documents or links.
This is the fourth version of MATLAB Simulink model for I2C Communication Demonstration on hardware platform Curiosity Platform Development Board, dsPIC33AK128MC106 Curiosity GP DIM, and MPU9250 for theEstimation of Roll, Pitch and Yaw Angles by integrating the Magnetometer.
4
+
5
+
## Features Added\Updated
6
+
Yaw Angles are Estimated from Gyroscope and Magnetometer data.
This is the third version, which includes minor but necessary modifications to the readme file for the MATLAB/Simulink model for demonstrating I2C communication on the hardware platform consisting of the Curiosity Platform Development Board, dsPIC33AK128MC106 Curiosity GP DIM, and MPU9250, used for the estimation of roll and pitch angles.
0 commit comments