yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Wheeled Chassis Kit📖
0.Chassis installation course
  • Installation Video-1
  • Installation Video-2
  • Installation Video-3
1.4-channel motor drive module tutorials
Motor introduction and commissioning
  • 1. Motor introduction and usage
  • 2.PC host
IIC communication
  • For Arduino
  • For ESP32
  • For JetsonNANO
  • For MSPM0
  • For PICO2
  • For RDK X5
  • For RPi5
  • For STM32
USART communication
  • For Arduino
  • For ESP32
  • For JetsonNANO
  • For MSPM0
  • For PICO2
  • For RDK X5
  • For RPi5
  • For STM32
2.Kinematic analysis
  • Kinematic Analysis of Two-wheel Drive Vehicles
  • Kinematic Analysis of Four-wheel Drive Vehicles
3.MSPM0 chassis tutorials(MSPM0G3507/MSPM0G3519)
MSPM0 Basic Course
  • 1. Introduction to MSPM0
Development environment construction
  • 01.CCS Theia Development
  • 02.MDK Arm Development
  • 03.UniFlash Downloader
  • 04.DAP-LINK download program
  • 05.Program simulation and debugging
  • 06.Engineering transplantation
Keil basic case
  • 1. Turn on the LED light
  • 2. System delay
  • 3. Button control
  • 4. External interruption
  • 5. Serial communication
  • 6. Timer
  • 7. PWM breathing light
  • 8. ADC acquisition
  • 9. DMA transfer
  • 10. Get MPU6050 data (I2C)
  • 11. LCD Display (SPI)
CCS basic case
  • 1. Turn on the LED light
  • 2. System delay
  • 3. Button control
  • 4. External interruption
  • 5. Serial communication
  • 6. Timer
  • 7. PWM breathing light
  • 8. ADC acquisition
  • 9. DMA transfer
  • 10. Get MPU6050 data (I2C)
  • 11. LCD Display (SPI)
MSPM0 Robot Expansion Board Example
  • 1. Introduction to MSPM0 robot expansion board
  • 2. Customize buttons
  • 3. Drive the buzzer
MSPM0 Sensor extension information
  • 01.3-channel tracking
  • 02.4-channel tracking
  • 03.8-channel tracking
  • 04.CCD tracking
  • 05.Electric PTZ control
  • 06.2.4G handle control
  • 07.Servo ultrasonic avoid
  • 08.Bluetooth remote control
  • 09.K210-Automatic Driving
  • 10.K210-Color follow
  • 11.K210-Number recognition
  • 12.K210-Color reaction
  • 13.K210-Road signs
  • 14.K210-Machine code following
  • 15.K210-QR code recognition
  • 16.K230-Visual tracking
  • 17.K230-Color tracking
  • 18.K230-Color response
  • 19.K230-Road sign recognition
  • 20.K230-Machine code tracking
  • 21.K230-QR code recognition action
  • 22.K230-Autonomous avoid
  • 23.K230-License plate tracking
  • 24.K230-Face tracking
  • 25.K230-Gaze direction tracking
  • 26.K230-Palm tracking
  • 27.K230-Target tracking
  • 28.K230-Human body tracking
  • 29.K230-OCR character recognition action
4.STM32 chassis tutorials
  • 01.3-channel tracking
  • 02.4-channel tracking
  • 03.8-channel tracking
  • 04.CCD tracking
  • 05.Electric PTZ control
  • 06.2.4G handle control
  • 07.Servo ultrasonic avoid
  • 08.Bluetooth remote control
  • 09.K210-Automatic Driving
  • 10.K210-Color follow
  • 11.K210-Number recognition
  • 12.K210-Color Reaction
  • 13.K210-Road signs
  • 14.K210-Machine code following
  • 15.K210-QR code recognition
  • 16.K230-Visual tracking
  • 17.K230-Color tracking
  • 18.K230-Color response
  • 19.K230-Road sign recognition
  • 20.K230-Machine code tracking
  • 21.K230-QR code recognition action
  • 22.K230-Autonomous avoid
  • 23.K230-License plate tracking
  • 24.K230-Face tracking
  • 25.K230-Gaze direction tracking
  • 26.K230-Palm tracking
  • 27.K230-Target tracking
  • 28.K230-Human body tracking
  • 29.K230-OCR character recognition action
5.Expand course
  • 1.Autonomous driving car
  • 2.Vehicle-mounted balance ball motion control systemnew
Download
  • Code
  • 3D_Model_File
Download ZIP

Welcome to Wheeled Chassis Kit repository

1. Turn on the LED light

Light up the LED

Light up the LED1. Learning objectives2. Hardware construction3. Experimental steps1. Open the SYSCONFIG configuration tool2. Parameter settings2.1 Set port parameters2.2 Set pin parameters2.3 Save and update the configuration file3. Write the program4. Compile4. Program Analysis5. Experimental phenomenon

1. Learning objectives

  1. Learn the basic use of the pins of the MSPM0G3507 motherboard.
  2. Understand how to control the onboard LED lights.

2. Hardware construction

This course does not require additional hardware equipment, and can directly use the onboard LED lights on the MSPM0G3507 motherboard.

We set up two LED user lights on the motherboard, and users can DIY their functions. Take LED1 as an example below.

MSPM0G3507 main control diagram

image-20241118203957884

LED schematic diagram

image-20241118204017413

3. Experimental steps

1. Open the SYSCONFIG configuration tool

Create a blank project empty in CCS.

image-20241126182939655

image-20241126183128934

Find and open the empty.syscfg file in the left workspace of CCS.

image-20241127152938881

In SYSCONFIG, select MCU peripherals on the left, find the GPIO option and click to enter. Click ADD in GPIO to add a group of GPIO.

image-20241127153052323

2. Parameter settings

2.1 Set port parameters

Set GPIO parameters and name the pin LED1

From the LED schematic, we can see that the port where LED1 is located is PB2, so set the Port to PORTB.

image-20241127154214321

Parameter description:

Name: Custom name of the GPIO instance. By default, the name starts with a numeric suffix "0"; we can customize the name to reflect the purpose of the module (for example, name the GPIO "LED1" so that we know that this pin is specifically used to control LED1).

Port: The port where the GPIO instance is located. The LED is connected to the GPIOB2 pin, so only PORTB can be selected.

Port Segment: Set the pull-up and pull-down resistors on the port. Note that it is the pull-up and pull-down of the port, which sets the entire GPIOB port.

2.2 Set pin parameters

Set the pin to output mode, set the pin to output low level by default, set the pin to pull-down mode, set the pin to GPIOB_2 pin, and do not enable interrupt events.

image-20241127154304307

Parameter description:

Name: User-defined pin name, set to PIN_2.

Direction: Set the pin mode, input and output. Here we control the LED light and choose the output mode.

Initial Value: Set the initial state of the pin, which can only be set when configured as output mode. There are two options, clear and set. Clear means output low level, and set means output high level.

IO Structure: Set the IO structure. There are multiple options, including Any, Standard, Standard with Wake, High-Speed, and 5V Tolerant Open Drain.

Internal Resistor: Set the pull-up and pull-down resistors of the pin. There are three options, no pull-up, pull-up, and pull-down. Here, the pull-down resistor is selected according to the connection method of the LED light.

Assigned Pin: Set the pin number. Fill in the corresponding pin number for the pin to be controlled. For example, if the LED in the development board is connected to GPIOB2, fill in 2.

2.3 Save and update the configuration file

Save the configuration in the .syscfg file using the shortcut key Ctrl+S.

Compile after saving

image-20241127154511315

After compiling, we can see that there are two more files in the Debug folder, ti_msp_dl_config.c and ti_msp_dl_config.h. These two files are the peripheral low-level driver configuration codes generated based on the .sysfig file we just saved.

image-20241127155101527

3. Write the program

In the empty.c file, write the following code

​x
#include "ti_msp_dl_config.h"
​
//自定义延时(不精确) Custom delay (not precise)
void delay_ms(unsigned int ms)
{
    unsigned int i, j;
    // 下面的嵌套循环的次数是根据主控频率和编译器生成的指令周期大致计算出来的,
    // 需要通过实际测试调整来达到所需的延时。
    // The number of nested loops below is roughly calculated based on the master control frequency and the instruction cycle generated by the compiler,and needs to be adjusted through actual testing to achieve the required delay.
    for (i = 0; i < ms; i++)
    {
        for (j = 0; j < 8000; j++)
        {
            // 仅执行一个足够简单以致于可以预测其执行时间的操作
            // Perform only one operation that is simple enough to predict its execution time
            __asm__("nop"); // "nop" 代表“无操作”,在大多数架构中,这会消耗一个或几个时钟周期 "nop" stands for "no operation", which on most architectures consumes one or a few clock cycles
        }
    }
}
​
int main(void)
{
    SYSCFG_DL_init();
    while (1)
    {
        DL_GPIO_clearPins(LED1_PORT,LED1_PIN_2_PIN);//输出低电平 Output low level
        delay_ms(1000);//延时大概1S Delay about 1S
        DL_GPIO_setPins(LED1_PORT,LED1_PIN_2_PIN);  //输出高电平 Output high level
        delay_ms(1000);//延时大概1S Delay about 1S
    }
}

4. Compile

image-20241127155238783

It shows that the compilation is successful here, and the program can be downloaded to the development board.

image-20241127155444370

4. Program Analysis

  • dl_gpio.h

image-20241127155739951

__STATIC_INLINE void DL_GPIO_setPins(GPIO_Regs* gpio, uint32_t pins): This function is to control the pin to output a high level.

__STATIC_INLINE void DL_GPIO_clearPins(GPIO_Regs* gpio, uint32_t pins): This function is used to control the pin to output a low level.

  • empty.c

image-20241127155941793

Using an imprecise delay, set PB2 to output a low level, and then output a high level after a delay of about 1s, and then delay for about 1s. This process is repeated.

5. Experimental phenomenon

After the program is downloaded, you can see that the LED1 on the MSPM0 development board is lit and flashes every about 1s.

image-20241119160112335

LCD Display (SPI)
System delay

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/中文