yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MSPM0 Smart Robot Car📖
1.Quick Start Guide
  • 1. Assembly Videos
  • 2. Quick Start Videos
  • 3. Battery charging
  • 4. Notes
2.Introduction to the MSPM0 Car
  • 1.About MSPM0
  • 2.Development board interface description
3.Development environment setup and usage
  • 1.CCS Theia development
  • 2.MDK Arm development
  • 3.Uniflash burning
  • 4.External crystal oscillator configuration
  • 5.Project Migration
4.MSPM0 basic course
  • 1. LED light control (GPIO)
  • 2. Buzzer Control (GPIO)
  • 3. Button Control (EXTI)
  • 4. Serial Port (UART)
  • 5. Voltage Detection (ADC)
  • 6. Temperature Detection (ADC)
  • 7. Independent Watchdog (WWDG)
  • 8. Window Watchdog (WWDG)
  • 9. Timer (TIM)
  • 10. Breathing LED (PWM)
  • 11. I2C Communication (I2C)
  • 12. External Flash (SPI)
  • 13. Internal Flash (Flash)
  • 14. DMA
  • 15. FreeRTOS
5.Sensor basic course
  • 1.Servo control
  • 2.Ultrasonic servo PTZ basic use
  • 3.Motor PID control
  • 4.OLED display photosensitive value
  • 5.Infrared avoid sensor
  • 6.1 Infrared line tracking sensor-8 channel infrared tracking sensor module
  • 6.2 Infrared line tracking sensor-4 channel infrared tracking sensor module
  • 7.Infrared remote control
  • 8.Ultrasonic ranging
  • 9.RGB light drive
  • 10.MPU6050 raw data acquisition
  • 11.MPU6050 data fusion
  • 12.K210 vision recognition module
  • 13.K230 vision recognition module
6.Smart car course
  • 1.1 Car line tracking-8 channel infrared tracking sensor module
  • 1.2 Car line tracking-4 channel infrared tracking sensor module
  • 2.1 Drawing a circle-8 channel infrared tracking sensor module
  • 2.2 Drawing a circle-4 channel infrared tracking sensor module
  • 3.Ultrasonic following
  • 4.Ultrasonic avoid
  • 5.Ultrasonic avoid(Servo PTZ)
  • 6.Infrared sensor avoid
  • 7.Light following
  • 8.Gyroscope calibration straight-line walk
  • 9.Infrared remote control
  • 10.Autonomous driving car
7.Vision application course
  • 1.K210 autonomous driving
  • 2.K210 color tracking
  • 3.K210 handwritten digit action
  • 4.K210 color response
  • 5.K210 road sign indication action
  • 6.K210 following machine code
  • 7.K210 QR code command
  • 8.K230 vision line tracking
  • 9.K230 color tracking
  • 10.K230 machine code tracking
  • 11.K230 QR code command
  • 12.K230 autonomous avoid
  • 13.K230 license plate tracking
  • 14.K230 face tracking
  • 15.K230 gaze direction tracking
  • 16.K230 palm tracking
  • 17.K230 target tracking
  • 18.K230 human body tracking
  • 19.K230 OCR character recognition
8.Extended application course (Sold separately)
  • 1.Voice interaction module communication
  • 2.Voice interaction control
  • 3.K230 road sign indication action(Voice)
  • 4.K230 color response(Voice)
  • 5.K230 gesture control(Voice)
  • 6.K230 rock-paper-scissors(Voice)
  • 7.8-channel grayscale color line tracking
  • 8.Bluetooth remote control
  • 9.K210 Scenario-based autonomous driving
  • 10.K230 Scenario-based autonomous driving
Download
  • Code
  • SCH
  • 3D Model File
  • MSPM0 Data Sheet
  • Voice firmware
  • Hardware interface manual
Download ZIP

Welcome to MSPM0 Smart Robot Car repository

10.MPU6050 raw data acquisition

MPU6050 Raw Data Acquisition

MPU6050 Raw Data Acquisition1. Software and Hardware2. Basic Principles2.1 Hardware Schematic2.2 Physical Connection Diagram2.3 Control Principle3. Project Configuration3.1 Description3.2 Pin Configuration4. Main Functions4.1 User Functions5. Experimental Phenomenon

This tutorial demonstrates: how to obtain and print MPU6050 raw data through serial port.

1. Software and Hardware

  • KEIL5

  • MSPM0G3507 Development Board

  • MPU6050 Module

  • Type-C data cable or DAP-Link

    For programming download or simulation to the development board

  • Serial Port Assistant

    Receive and print serial port data

2. Basic Principles

2.1 Hardware Schematic

upscalemedia-transformed (17)

2.2 Physical Connection Diagram

image-20251014174254908

2.3 Control Principle

(Schematic Name)Control PinSpecific Meaning
I2C2_SCLPA1I2C Clock End
I2C2_SDAPA0I2C Data End

I2C Communication:

Start Signal: The processor keeps the SCL clock high, then lets the SDA data signal go from high to low to indicate a start signal. At the same time, devices on the I2C bus detect this start signal and know that the processor is about to send data.

Stop Signal: The processor keeps the SCL clock high, then lets the SDA data signal go from low to high to indicate a stop signal. At the same time, devices on the I2C bus detect this stop signal and know that the processor has finished data transmission, and we can each go about our business, such as sleep, etc.

image-20230926100744845

To read the value of MPU6050 registers, first the master device generates a start signal (S), then sends the slave device address bit and a write data bit, then sends the register address, before starting to read the register. Immediately after receiving the acknowledgment signal, the master device sends another start signal, then sends the slave device address bit and a read data bit. Then, the MPU6050 as the slave device generates an acknowledgment signal and starts sending register data. Communication ends with a not-acknowledge signal (NACK) and end flag (P) generated by the master device. The not-acknowledge signal (NACK) is defined as SDA data remaining high during the 9th clock cycle.

MPU6050 Module:

The MPU-6050 is an integrated 6-axis motion processing component. Compared to multi-component solutions, it eliminates the problem of axis differences when combining gyroscopes and accelerometers, reducing a large amount of packaging space. The MPU-6050 integrates a 3-axis gyroscope and 3-axis accelerometer, and includes a digital motion processing (DMP: Digital Motion Processor) hardware acceleration engine that can connect other brands of accelerometers, magnetic sensors, or other sensors through a second I2C port, outputting complete 9-axis fusion calculation technology to the application end in the form of a single data stream from the main I2C port.

MPU6050 Module Features:

  1. Digital output of 6-axis or 9-axis rotation matrix, quaternion, Euler angle format fusion calculation data.
  2. 3-axis angular velocity sensor (gyroscope) with 131 LSBs/°/sec sensitivity and full-scale sensing range of ±250, ±500, ±1000 and ±2000°/sec.
  3. Programmable control 3-axis accelerometer with control range of ±2g, ±4g, ±8g and ±16g.
  4. Removes sensitivity between accelerometer and gyroscope axes, reducing the impact of setup and sensor drift.
  5. Digital Motion Processing (DMP) engine can reduce the load of complex fusion calculation data, sensor synchronization, posture sensing, etc.
  6. Motion processing database supports Android, Linux and Windows
  7. Digital output temperature sensor
  8. Digital input synchronization pin (Sync pin) supports video electronic image stabilization technology and GPS
  9. Programmable interrupts support posture recognition, panning, picture zoom in/out, scrolling, fast drop interrupt, high-G interrupt, zero motion sensing, tap sensing, shake sensing functions
  10. VCC supply voltage is 3.3V or 5.0V
  11. Gyroscope operating current: 5mA, gyroscope standby current: 5uA; accelerometer operating current: 350uA, accelerometer power-saving mode current: 20uA@10Hz
  12. Up to 400kHz fast mode I2C, or up to 20MHz SPI serial host interface
  13. Built-in frequency generator has only ±1% frequency variation over full temperature range

Parameter information is as follows:

image-20230926100744845

3. Project Configuration

3.1 Description

You can refer to the basic tutorial to complete the development environment setup.

3.2 Pin Configuration

image-20251014190708860

image-20251014190738984

image-20251014190815256

4. Main Functions

4.1 User Functions

Function: Get_EulerAngles()

Function Prototypevoid Get_EulerAngles(void)
Function DescriptionGet MPU6050 data and send through serial port
Input ParametersNone
Return ValueNone

Function: MPU6050_Init

Function Prototypechar MPU6050_Init(void)
Function DescriptionMPU6050 initialization
Input ParametersNone
Return ValueJudge whether MPU6050 is detected

5. Experimental Phenomenon

After downloading the program, open the serial port assistant and set the parameters as shown in the figure below. Then open the serial port to receive the raw data of MPU6050.

For program download, refer to 【3. Development Environment Setup and Usage: 3. Uniflash burning】

The effect is as follows:

image-20251015151908028

RGB light drive
MPU6050 data fusion

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文