MSPM33 SDK Examples Guide

1. Introduction

The MSPM33 SDK is packaged with a wide selection of code examples to enable engineers to develop applications on Texas Instruments’ MSPM33 family of microcontrollers.

The examples folder is divided into RTOS and non-RTOS subfolders. These folders contain examples for each LaunchPad and are organized based on function with lower-level Driverlib examples, security examples, boot manager examples, BSL examples, CMSIS DSP examples, and demo applications.

Some examples support SysConfig to simplify the device configuration and accelerate software development. Refer to the SDK QuickStart guide for more details on how to get started using SysConfig, and look for the SysConfig symbol image0 in the sections below.

2. MSPM33 SDK Examples

2.1 Demos

The MSPM33 SDK includes several demos to showcase the functionalities of various devices.

Each demo is packaged with its own documentation, full source code, and project files for different supported IDEs and compilers, making the demos easy to use.

Stay tuned for more examples and functionality.

Project Name

Description

EVM

LP_MSPM33C321A

cc3200boosterpack_audio_playback

Audio playback demo using CC3200 BoosterPack

Y

lvgl

LVGL graphics library demonstration

Y

2.2 FreeRTOS

The MSPM33 SDK includes FreeRTOS examples to demonstrate how to use the FreeRTOS real-time operating system with MSPM33 devices.

Project Name

Description

EVM

LP_MSPM33C321A

blink_led

Simple FreeRTOS LED blinky demo using two tasks

Y

2.3 BSL (Boot Strap Loader)

The MSPM33 SDK includes BSL examples to demonstrate boot strap loader functionality for firmware updates.

Project Name

Description

EVM

LP_MSPM33C321A

bsl_host_mcu_to_mspm33c321a_target_i2c

BSL host MCU to MSPM33C321A target using I2C communication

Y

bsl_host_mcu_to_mspm33c321a_target_uart

BSL host MCU to MSPM33C321A target using UART communication

Y

2.4 CMSIS DSP

The MSPM33 SDK includes CMSIS DSP examples to demonstrate digital signal processing capabilities.

Project Name

Description

EVM

LP_MSPM33C321A

cmsis_dsp_empty

Empty CMSIS DSP project template

Y

cmsis_dsp_fft_q15

CMSIS DSP FFT Q15 format example

Y

2.5 Security

The MSPM33 SDK includes security examples to demonstrate the security features of MSPM33 devices.

Project Name

Description

EVM

LP_MSPM33C321A

debug_unlock_L2

Debug unlock Level 2 security example

image1

empty

Empty security project template

image2

gpio_toggle

GPIO toggle example with security features

image3

memory_hide_protect

Memory hide and protection example

image4

memory_protect

Memory protection example

image5

peripheral_protect_basic

Basic peripheral protection example

image6

peripheral_protect_dma

DMA peripheral protection example

image7

2.6 Boot Manager

The MSPM33 SDK includes boot manager examples to demonstrate secure booting capabilities.

Project Name

Description

EVM

LP_MSPM33C321A

customer_secure_code

Customer Secure Code based off MCUBoot

Y

customer_secure_sample_image

Customer Secure Sample Image for secure boot

Y

2.7 DriverLib

DriverLib is a set of low level drivers providing an API for accessing MSPM33 registers and full device functionality.

The examples below use the Driverlib API to demonstrate the device functionality and range from simple use cases such as toggling a GPIO output pin to more complex use cases where multiple device peripherals are used.

Each example is packaged with its own documentation, full source code, and project files for different supported IDEs and compilers, making the examples easy to use.

2.7.1 aesadv

Project Name

Description

EVM

LP_MSPM33C321A

aesadv_cbc_256_enc_dec

AES256 CBC encryption and decryption example

image8

aesadv_cfb_256_enc_dec

AES CFB 256 bit encryption and decryption example

image9

aesadv_ctr_128_enc_dec

AES CTR 128 bit encryption and decryption example

image10

aesadv_ecb_256_encrypt

AES ECB 256 bit encryption example

image11

aesadv_ecb_256_encrypt_interrupt

AES ECB 256 bit encryption example using interrupts

image12

aesadv_gcm_128_enc_dec

AES GCM 128 bit encryption and decryption example, with keystore

image13

aesadv_gcm_auto_128_enc_dec

AES GCM auto 128 bit encryption and decryption example

image14

aesadv_ofb_256_enc_dec

AES OFB 256 bit encryption and decryption example

image15

2.7.2 Comparator (COMP)

Project Name

Description

EVM

LP_MSPM33C321A

comp_analog_filter

Comparator using external inputs with hysteresis and output analog filter

image16

comp_dac_to_timer_event

Comparator output using 8-bit DAC triggers a timer event to measure timing

image17

comp_hs_dac_vref_external

Comparator in high-speed mode using 8-bit DAC with external VREF

image18

comp_hs_tima_pwm_fault

Comparator in high-speed mode triggers a TIMA fault

image19

comp_lp_dac_vref_internal

Comparator in low-power mode using 8-bit DAC with internal VREF

image20

2.7.3 CRCP

Project Name

Description

EVM

LP_MSPM33C321A

crcp_calculate_checksum

CRCP16 checksum calculation of a memory block

image21

crcp_calculate_checksum_32bit

CRCP32 checksum calculation of a memory block

image22

crcp_calculate_checksum_dma

CRCP16 checksum calculation of a memory block using DMA block transfer

image23

crcp_calculate_checksum_dma_32bit

CRCP32 checksum calculation of a memory block using DMA block transfer

image24

2.7.4 Crypto SHA

Project Name

Description

EVM

LP_MSPM33C321A

crypto_sha_224

SHA-224 hash calculation example

image25

crypto_sha_256

SHA-256 hash calculation example

image26

crypto_sha_256_hmac

SHA-256 HMAC calculation example

image27

2.7.5 Direct Memory Access (DMA)

Project Name

Description

EVM

LP_MSPM33C321A

dma_block_transfer

DMA copies from Flash main memory to SRAM memory

image28

dma_fill_data

DMA memory fill of SRAM using DMA

image29

dma_table_transfer

DMA using Table mode with DMA

image30

dma1_block_transfer

DMA1 copies from Flash main memory to SRAM memory

image31

dma1_fill_data

DMA1 memory fill of SRAM using DMA

image32

dma1_table_transfer

DMA1 using Table mode with DMA

image33

2.7.6 EAM

Project Name

Description

EVM

LP_MSPM33C321A

eam_fpi_security_error

EAM FPI security error example

image34

2.7.7 Non-Volatile Memory (FLASHCTL)

Project Name

Description

EVM

LP_MSPM33C321A

flashctl_dynamic_memory_protection

Flash configured with dynamic protection

image35

flashctl_ecc_error_injection

Flash ECC testing and SEC and DED error detection

image36

flashctl_multiple_size_read_verify

Implementation of Flash read verify commands on multiple data sizes, with and without ECC

image37

flashctl_multiple_size_write

Flash writing of different size data

image38

flashctl_program_with_ecc

Flash writing of different size data with ECC

image39

2.7.8 GPIO

Project Name

Description

EVM

LP_MSPM33C321A

gpio_input_capture

GPIO triggers interrupt by input capture pin

image40

gpio_simultaneous_interrupts

Demonstrates how to simultaneously service three GPIO interrupts

image41

gpio_software_poll

GPIO output is set based on polled input

image42

gpio_toggle_output

GPIO toggling an output pin

image43

gpio_toggle_output_cpp

GPIO toggling output pins using C++

image44

gpio_toggle_output_hiz

GPIO toggling an ouputput pin configured as Hi-Z

image45

2.7.9 High-Speed ADC (HSADC)

Project Name

Description

EVM

LP_MSPM33C321A

hsadc_conversion_continuous

HSADC continuous conversion example

image46

hsadc_conversion_software_trigger

HSADC conversion triggered by software

image47

hsadc_dma_transfer

HSADC using DMA for data transfer

image48

hsadc_interrupt

HSADC using interrupts

image49

hsadc_ppb_data_processing

HSADC post-processing block data processing

image50

hsadc_ppb_limit

HSADC post-processing block limit detection

image51

hsadc_ppb_oversampling

HSADC post-processing block oversampling

image52

hsadc_pre_emption

HSADC pre-emption example

image53

hsadc_results_fifo

HSADC results FIFO example

image54

hsadc_single_conversion

HSADC single conversion example

image55

hsadc_single_conversion_vref_external

HSADC single conversion with external reference

image56

hsadc_single_conversion_vref_internal

HSADC single conversion with internal reference

image57

hsadc_triggered_by_timer_event

HSADC conversion triggered by a timer event

image58

2.7.10 Inter-Integrated Circuit (I2C)

Project Name

Description

EVM

LP_MSPM33C321A

i2c_controller_rw_multibyte_fifo_interrupts

I2C Controller reading and writing multiple bytes using interrupts with FIFO

image59

i2c_controller_rw_multibyte_fifo_poll

I2C Controller reading and writing multiple bytes polling FIFO

image60

i2c_dma_transfer_controller

I2C Controller reading and writing multiple bytes using DMA

image61

i2c_dma_transfer_target

I2C Target reading and writing multiple bytes using DMA

image62

i2c_target_rw_multibyte_fifo_interrupts

I2C Target reading and writing multiple bytes using interrupts

image63

i2c_target_rw_multibyte_fifo_interrupts_stop

I2C Target reading and writing multiple bytes using interrupts while in STOP mode

image64

i2c_target_rw_multibyte_fifo_poll

I2C Target reading and writing multiple bytes polling FIFO

image65

2.7.11 I2S

Project Name

Description

EVM

LP_MSPM33C321A

i2s_controller_write_multibyte_fifo_poll

I2S Controller write multibyte FIFO with polling

image66

i2s_target_read_multibyte_fifo_poll

I2S Target read multibyte FIFO with polling

image67

2.7.12 IWDT

Project Name

Description

EVM

LP_MSPM33C321A

iwdt_periodic_reset

Periodic reset of the independent watchdog timer

image68

2.7.13 Controller Area Network (MCAN)

Project Name

Description

EVM

LP_MSPM33C321A

mcan_loopback

MCAN transmits and receives messages using loopback mode

image69

mcan_message_rx

Example configured to receive CAN and CAN-FD frames

image70

mcan_multi_message_tx

CAN-FD transmits two messages with unique ID on GPIO interrupt

image71

mcan_single_message_tx

CAN-FD transmits a single message on GPIO interrupt

image72

2.7.14 Timer - Advanced (TIMA)

Project Name

Description

EVM

LP_MSPM33C321A

tima_timer_mode_periodic_repeat_count

TIMA timer in periodic mode with repeat count

image73

tima_timer_mode_pwm_dead_band

TIMA timer in PWM mode with dead band

image74

2.7.15 Timer - General Purpose (TIMG)

Project Name

Description

EVM

LP_MSPM33C321A

timg_32bit_timer_mode_periodic_sleep

TIMG 32-bit timer in periodic mode with sleep

image75

timg_32bit_timer_mode_pwm_edge_sleep

TIMG 32-bit timer in PWM edge mode with sleep

image76

2.7.16 Timer - Generic (TIMX)

Project Name

Description

EVM

LP_MSPM33C321A

timx_timer_mode_capture_duty_and_period

TIMX timer in capture mode measuring duty cycle and period

image77

timx_timer_mode_capture_edge_capture

TIMX timer in capture mode with edge capture

image78

timx_timer_mode_compare_edge_count

TIMX timer in compare mode with edge count

image79

timx_timer_mode_one_shot_standby

TIMX timer in one-shot mode with standby

image80

timx_timer_mode_periodic_sleep

TIMX timer in periodic mode with sleep

image81

timx_timer_mode_periodic_standby

TIMX timer in periodic mode with standby

image82

timx_timer_mode_periodic_stop

TIMX timer in periodic mode with stop

image83

timx_timer_mode_pwm_center_stop

TIMX timer in PWM center mode with stop

image84

timx_timer_mode_pwm_edge_sleep

TIMX timer in PWM edge mode with sleep

image85

timx_timer_mode_pwm_edge_sleep_shadow

TIMX timer in PWM edge mode with sleep and shadow

image86

timx_timer_mode_pwm_cross_trigger_stop_restore

TIMX timer in PWM mode with cross trigger stop and restore

image87

2.7.17 Real-Time Clock (RTC)

Project Name

Description

EVM

LP_MSPM33C321A

rtc_a_tamper_timestamp_event

Generates a time stamp event on RTC_A upon tamper detection

image88

rtc_calendar_alarm_standby

RTC sets calendar alarm and toggles GPIO when alarm is triggered

image89

rtc_offset_calibration_lfxt

RTC offset correction of crystal

image90

rtc_periodic_alarm_lfosc_standby

RTC implementation of periodic alarm in STANDBY using LFOSC

image91

rtc_periodic_alarm_lfxt_standby

RTC implementation of periodic alarm in STANDBY using LFXT

image92

rtc_temperature_calibration_lfxt

RTC temperature calibration of crystal

image93

2.7.18 Scratchpad

Project Name

Description

EVM

LP_MSPM33C321A

scratchpad_erase_on_tamper

Scratchpad erase on tamper detection

image94

scratchpad_retain_on_vdd_loss

Scratchpad retain on VDD loss

image95

2.7.19 SPI

Project Name

Description

EVM

LP_MSPM33C321A

spi_controller_command_data_control

SPI controller command data control

image96

spi_controller_fifo_dma_interrupts

SPI controller using FIFO with DMA and interrupts

image97

spi_controller_internal_loopback_poll

SPI controller internal loopback with polling

image98

spi_controller_multibyte_fifo_poll

SPI controller multibyte FIFO with polling

image99

spi_controller_register_format

SPI controller register format

image100

spi_controller_repeated_fifo_dma_interrupts

SPI controller repeated FIFO with DMA and interrupts

image101

spi_peripheral_command_data_control

SPI peripheral command data control

image102

spi_peripheral_fifo_dma_interrupts

SPI peripheral using FIFO with DMA and interrupts

image103

spi_peripheral_multibyte_fifo_poll

SPI peripheral multibyte FIFO with polling

image104

spi_peripheral_register_format

SPI peripheral register format

image105

spi_peripheral_repeated_fifo_dma_interrupts

SPI peripheral repeated FIFO with DMA and interrupts

image106

2.7.20 System Control (SYSCTL)

Project Name

Description

EVM

LP_MSPM33C321A

sysctl_cpureset

System control CPU reset example

image107

sysctl_frequency_clock_counter

System control frequency clock counter example

image108

sysctl_hfxt_run

System control HFXT run example

image109

sysctl_lfxt_standby

System control LFXT standby example

image110

sysctl_mclk_syspll

System control MCLK SYSPLL example

image111

sysctl_power_policy_sleep_to_standby

System control power policy sleep to standby example

image112

sysctl_power_policy_sleep_to_stop

System control power policy sleep to stop example

image113

sysctl_shutdown

System control shutdown example

image114

2.7.21 SysTick

Project Name

Description

EVM

LP_MSPM33C321A

systick_periodic_timer

SysTick periodic timer example

image115

2.7.22 TamperIO

Project Name

Description

EVM

LP_MSPM33C321A

tamperio_heartbeat

TamperIO heartbeat example

image116

2.7.23 True Random Number Generator (TRNG)

Project Name

Description

EVM

LP_MSPM33C321A

trng_sample

TRNG sample generation example

image117

trng_sample_stop_restore

TRNG sample with stop and restore example

image118

2.7.24 Universal Asynchronous Receiver Transmitter (UART)

Project Name

Description

EVM

LP_MSPM33C321A

uart_extend_irda_receive_packet

UART extend IrDA receive packet example

image119

uart_extend_irda_send_packet

UART extend IrDA send packet example

image120

uart_extend_manchester_echo

UART extend Manchester echo example

image121

uart_extend_manchester_send_packet

UART extend Manchester send packet example

image122

uart_internal_loopback_spgss0_uc1

UART internal loopback SPGSS0 UC1 example

image123

uart_internal_loopback_standby_restore

UART internal loopback standby restore example

image124

uart_internal_loopback_with_interrupt_spgss0_uc1

UART internal loopback with interrupt SPGSS0 UC1 example

image125

uart_rx_console_multibyte_repeated_fifo_dma

UART RX console multibyte repeated FIFO DMA example

image126

uart_rx_echo_interrupts_standby

UART RX echo interrupts standby example

image127

uart_rx_external_data_receive

UART RX external data receive example

image128

uart_rx_hw_flow_control

UART RX hardware flow control example

image129

uart_rx_multibyte_fifo_dma_interrupts

UART RX multibyte FIFO DMA interrupts example

image130

uart_rx_rw_multibyte_fifo_poll

UART RX read/write multibyte FIFO poll example

image131

uart_tx_console_multibyte_repeated_fifo_dma

UART TX console multibyte repeated FIFO DMA example

image132

uart_tx_echo_interrupts_standby

UART TX echo interrupts standby example

image133

uart_tx_external_data_send

UART TX external data send example

image134

uart_tx_hw_flow_control

UART TX hardware flow control example

image135

uart_tx_multibyte_fifo_dma_interrupts

UART TX multibyte FIFO DMA interrupts example

image136

uart_tx_rw_multibyte_fifo_poll

UART TX read/write multibyte FIFO poll example

image137

2.7.26 Other

Project Name

Description

EVM

LP_MSPM33C321A

empty

Empty start-up project using DriverLib

image138

2.7.25 WWDT

Project Name

Description

EVM

LP_MSPM33C321A

wwdt_interval_timer_lfosc_standby

WWDT interval timer using LFOSC in STANDBY mode

image139

wwdt_interval_timer_lfxt_standby

WWDT interval timer using LFXT in STANDBY mode

image140

wwdt_window_mode_periodic_reset

WWDT window mode with periodic reset

image141