Readme

Example Summary

The following example configures TimerG4 in combined capture mode (configure to measure a PWM signal’s period and duty cycle). TimerG1 is used to generate a the PWM signal.

Peripherals & Pin Assignments

Peripheral Pin Function
SYSCTL
TIMG1 PA26 Counter Compare Pin 0
TIMG4 PA10 Counter Compare Pin 0
EVENT
DEBUGSS PA20 Debug Clock
DEBUGSS PA19 Debug Data In Out

BoosterPacks, Board Resources & Jumper Settings

Visit LP_MSPM0L1306 for LaunchPad information, including user guide and hardware files.

Pin Peripheral Function LaunchPad Pin LaunchPad Settings
PA26 TIMG1 CCP0 J4_38 J12 ON/OFF: Connect/Disconnect LED2 Red
PA10 TIMG4 CCP0 J4_36 N/A
PA20 DEBUGSS SWCLK J2_13 J101 15:16 ON: Connect to XDS-110 SWCLK (debug)
PA19 DEBUGSS SWDIO J2_17 J101 13:14 ON: Connect to XDS-110 SWDIO (debug)

Low-Power Recommendations

TI recommends to terminate unused pins by setting the corresponding functions to GPIO and configure the pins to output low or input with internal pullup/pulldown resistor.

SysConfig allows developers to easily configure unused pins by selecting BoardConfigure Unused Pins.

For more information about jumper configuration to achieve low-power using the MSPM0 LaunchPad, please visit the LP-MSPM0L1306 User’s Guide.

Example Usage

Connect a jumper cable between PA10 (GPIO_TIMER_CAPTURE_C0_PIN) and PA26 (GPIO_PWM_C0_PIN). Compile, load and run the example. The application will capture two full periods before hitting a SW breakpoint. This ensures that the timers are fully synchronized (please refer the TRM for additional details). At the breakpoint, the user can inspect the values of pwmPeriod and pwmDuty. The value of pwmDuty should be set to ~90. The value of pwmPeriod should be set to ~1000.