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
Learn the basic use of MSPM0G3519 motherboard pins.
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

LED Part Schematic

3. Experiment Steps
1. Open SYSCONFIG Configuration Tool
Create a new empty project empty in CCS.


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

In SYSCONFIG, Modify chip pin package


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

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.

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.

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.
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.
IO Structure: Set IO structure. There are multiple options: Default (Any), Standard, Wake (Standard with Wake), High-Speed, and 5V Tolerant Open Drain.
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.
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
Save the configuration in the .syscfg file using the shortcut key Ctrl+S.
After saving, compile.

After compilation, you can see that two more files have been added under the Debug folder: ti_msp_dl_config.c and ti_msp_dl_config.h. These two files are the peripheral low-level driver configuration code generated based on the .syscfg file we just saved.

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