yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MSPM0G3519 Development Board📖
1. Introduction to MSPM0
  • 1. Introduction to MSPM0
2. Development environment construction
  • 1. CCS Theia Development
  • 2. MDK Arm Development
  • 3. UniFlash Downloader
  • 4. DAP-LINK download program
  • 5. Program Simulation and Debugging
  • 6. Engineering transplantation
3. 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)
4. 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)
5. MSPM0 Robot Expansion Board
  • 1. MSPM0 Robot Expansion Board Introduction
  • 2. Custom Buttons
  • 3. Drive Buzzer
6. MSPM0-K230Vision module application
  • 1. K230 Color Recognition
  • 2. K230 Barcode Recognition
  • 3. K230 QR Code Recognition
  • 4. K230 Apriltag Code Recognition
  • 5. K230 DM Code Recognition
  • 6. K230 Face Detection
  • 7. K230 Gaze Direction
  • 8. K230 Face Recognition
  • 9. K230 Human Body Detection
  • 10. K230 Fall Detection
  • 11. K230 Palm Detection
  • 12. K230 Gesture Recognition
  • 13. K230 OCR Character Recognition
  • 14. K230 Object Detection
  • 15. K230 Target Tracking
  • 16. K230 Self-learning Object Recognition
  • 17. K230 License Plate Recognition
7. MSPM0-K210Vision module application
  • 0. K210 Prerequisites For Making A Coprocessor - Must-see
  • 1. MSPM0_K210 Color Recognition
  • 2. MSPM0_K210 Barcode Recognition
  • 3. MSPM0_K210 QR Code Recognition
  • 4. MSPM0_K210 Mechanical Code Recognition
  • 5. MSPM0_K210 Face Detection
  • 6. MSPM0_K210 Facial Feature Detection
  • 7. MSPM0_K210 Mask Detection
  • 8. MSPM0_K210 Face Recognition
  • 9. MSPM0_K210 Object Detection
  • 10. MSPM0_K210 Self-study Classification
  • 11. MSPM0_K210 Handwritten Digit Recognition
8. Expansion case
  • 1. Autonomous Driving Car
  • 2. Vehicle-mounted Balance Ball Motion Control System
Download
  • Code
  • Hardware_Info
  • Software_Tools
Download ZIP

Welcome to MSPM0G3519 Development Board repository

1. Turn on the LED light

Turn On LED Light

Turn On LED Light1. Learning Objectives2. Hardware Setup3. Experiment Steps1. Open SYSCONFIG Configuration Tool2. Parameter Settings2.1 Set Port Parameters2.2 Set Pin Parameters2.3 Save and Update Configuration File3. Write Program4. Compile4. Program Analysis5. Experimental Phenomena

 

1. Learning Objectives

  1. Learn the basic use of MSPM0G3519 motherboard pins.

  2. Understand how to control the onboard LED light.

 

2. Hardware Setup

This course does not require additional hardware. You can directly use the onboard LED light on the MSPM0G3519 motherboard.

We have set up two LED user lights on the motherboard. Users can customize their functions. The following uses LED1 as an example.

MSPM0G3519 Main Control Diagram

image-20241118203957884

LED Part Schematic

image-20241118204017413

3. Experiment Steps

1. Open SYSCONFIG Configuration Tool

Open the empty project from the SDK in KEIL.

image-20241118204605335

After selecting and opening it, open the empty.syscfg file in the KEIL interface. With the empty.syscfg file open, then open the SYSCONFIG GUI interface from the Tools menu.

image-20241118204833195

In SYSCONFIG, Modify chip pin package

image-20260909171024255

image-20260909171124802

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

image-20241118205015659

 

2. Parameter Settings

2.1 Set Port Parameters

Configure GPIO parameters and name the pin LED1.

From the LED part schematic, LED1 is on port PB2, so set Port to PORTB.

image-20241118205313112

Parameter description:

Name: Custom name for the GPIO instance. By default, the name starts with the numeric suffix "0". You can customize the name to reflect the module's purpose (for example, naming the GPIO "LED1" so you know this pin is specifically for controlling LED1).

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

Port Segment: Set port pull-up/down resistor. Note this is port pull-up/down, 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, do not enable interrupt events.

image-20241118205858168

Parameter description:

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

Direction: Set pin mode, input and output. Here we are controlling the LED light, so select output mode.

image-20241118210228967

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

image-20241118210241035

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

image-20241118210307782

Internal Resistor: Set pin pull-up/down resistor. There are three options: none, pull-up, and pull-down resistor. Based on the LED connection method, pull-down resistor is selected here.

image-20241118210322182

Assigned Pin: Set pin number. Enter the corresponding pin number for whichever pin you want to control. For example, the LED on the development board is connected to GPIOB2, so enter 2.

2.3 Save and Update Configuration File

Click SAVE to save the SYSCONFIG configuration, then close SYSCONFIG and return to KEIL.

image-20241119143522524

Select Yes to All in the popup.

image-20241119143728060

Now you can see that the empty.syscfg file has been updated with our set parameters.

image-20241119144935346

We also need to confirm whether the .c and .h files are updated. Simply compile, and the compilation will automatically update to KEIL. If not updated, we can also copy the file content from SYSCONFIG.

image-20241119145149571

image-20241119145221053

image-20241119145412728

The .h file is the same. You can copy the content from SYSCONFIG.

3. Write 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" 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);//Delay about 1S
        DL_GPIO_setPins(LED1_PORT,LED1_PIN_2_PIN);  //Output high level
        delay_ms(1000);//Delay about 1S
    }
}

4. Compile

Click the Rebuild icon. The following prompt indicates compilation is complete with no errors.

image-20241119150803274

image-20241119150902489

4. Program Analysis

  • dl_gpio.h

xxxxxxxxxx
/**
 *  @brief      Set a group of GPIO pins
 *
 *  @param[in]  gpio  Pointer to the register overlay for the peripheral
 *  @param[in]  pins  Pins to set high. Bitwise OR of @ref DL_GPIO_PIN.
 */
__STATIC_INLINE void DL_GPIO_setPins(GPIO_Regs* gpio, uint32_t pins)
{
    gpio->DOUTSET31_0 = pins;
}

/**
 *  @brief      Clear a group of GPIO pins
 *
 *  @param[in]  gpio  Pointer to the register overlay for the peripheral
 *  @param[in]  pins  Pins to clear. Bitwise OR of @ref DL_GPIO_PIN.
 */
__STATIC_INLINE void DL_GPIO_clearPins(GPIO_Regs* gpio, uint32_t pins)
{
    gpio->DOUTCLR31_0 = pins;
}

/**
 *  @brief      Toggle a group of GPIO pins
 *
 *  @param[in]  gpio  Pointer to the register overlay for the peripheral
 *  @param[in]  pins  Pins to toggle. Bitwise OR of @ref DL_GPIO_PIN.
 */
__STATIC_INLINE void DL_GPIO_togglePins(GPIO_Regs* gpio, uint32_t pins)
{
    gpio->DOUTTGL31_0 = pins;
}

__STATIC_INLINE void DL_GPIO_setPins(GPIO_Regs* gpio, uint32_t pins): This function controls pins to output high level.

__STATIC_INLINE void DL_GPIO_clearPins(GPIO_Regs* gpio, uint32_t pins): This function controls pins to output low level.

__STATIC_INLINE void DL_GPIO_togglePins(GPIO_Regs* gpio, uint32_t pins): This function toggles pin level. If it was high level, it becomes low level. If it was low level, it becomes high level.

  • empty.c

xxxxxxxxxx
int main(void)
{
    SYSCFG_DL_init();
    while (1)
    {
        DL_GPIO_clearPins(LED1_PORT,LED1_PIN_2_PIN);//Output low level
        delay_ms(1000);//Delay about 1S
        DL_GPIO_setPins(LED1_PORT,LED1_PIN_2_PIN);  //Output high level
        delay_ms(1000);//Delay about 1S
    }
}

Set PB2 to output low level, delay about 1s, then output high level, then delay about 1s. Repeat this process.

5. Experimental Phenomena

After the program is downloaded, you can see LED1 on the MSPM0 development board light up and blink approximately every 1 second.

image-20241119160112335

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