The project gives anexample for interfacing the MPU module MPU6050 with PSoC6. TheMPU-6050 devices combine a 3-axis gyroscope and a 3-axisaccelerometer on the same silicon die, together with an onboard Digital MotionProcessor™ (DMP™), which processes complex 6-axis MotionFusion algorithms.The device can access external magnetometers or other sensors through anauxiliary master I²C bus, allowing the devices to gather a full set of sensordata without intervention from the system processor.
Figure 1:MPU6050 Breakout Board
The main part of the project is an I2C master component which communicates withMPU6050 which is an I2c slave. Apart from that there is a UART component which takes data from the MPU module and send it to PC.
Figure 2 :Top Design Schematic
The driver files required for MPU6050 has been already developed by Jeff Rowberg. This has been reused. However, the I2C functions are specific to PSoC6 and uses PSoC PDL functions. These has been created from scratch.
Figure 3: MPU6050 Source files
The project has all the code run on the CM4 core and CM0+core is not doing any task. The firmware does not have an RTOS and the code is straight forward.
Hardware- CY8CKIT-062
- MPU6050 breakout board
- Jumper wires
1) Program the code to a PSoC6 on the CY8CKIT-062.
2) Connect the MPU6050 to the kit
- VCC -> 3.3V
- GND -> GND
- SCL -> P6.0
- SDA -> P6.1
Figure 4:Hardware set up
3) Open Bridge Control Panel and connect to the CY8CKIT-062COM Port Number.
4) Load the MPU6050.ini and MPU6050.iic files available with the project zip. Refer to Bridge Control Panel Help section for details on loading these files.
5) Click on Repeat and open the Chart tab. You can see the plot of data being sent by PSoC6.
6) Move the MPU module and see that the data changes on the plot.
Figure 5:Bridge Control Panel Plot
Comments
Please log in or sign up to comment.