Readme
Example Summary
Bit-banged software UART (half-duplex) for MSPM0C1104 with auto-baud detection, echo, and ISR latency compensation.
Peripherals & Pin Assignments
| Peripheral | Pin | Function |
|---|---|---|
| GPIOA | PA17 | SW_TX — UART TX output |
| GPIOA | PA26 | SW_RX — UART RX input (shared with TIMG14 CCP0 for baud detection) |
| GPIOA | PA23 | MARK_TIMER_ISR — measurement output for Timer ISR timing |
| GPIOA | PA4 | MARK_GPIO_ISR — measurement output for GPIO ISR timing |
| GPIOA | PA16 | Button input (falling edge) — sends test byte 0x55 |
| GPIOA | PA22 | USER_LED_1 — LED indicator |
| TIMG6 | TIMER_0 — TX/RX bit timing | |
| TIMG14 | CAPTURE_0 — baud detection capture | |
| SYSCTL | ||
| DEBUGSS | PA20 | Debug Clock (SWCLK) |
| DEBUGSS | PA19 | Debug Data In Out (SWDIO) |
BoosterPacks, Board Resources & Jumper Settings
Visit LP_MSPM0C1104 for LaunchPad information, including user guide and hardware files.
| Pin | Peripheral | Function | LaunchPad Pin | LaunchPad Settings |
|---|---|---|---|---|
| PA17 | GPIOA | SW_TX | J4_28 | BoosterPack pin 28 |
| PA26 | GPIOA | SW_RX / CAPTURE | J4_26 | BoosterPack pin 26 |
| PA23 | GPIOA | MARK_TIMER_ISR | J2_39 | BoosterPack pin 39 |
| PA4 | GPIOA | MARK_GPIO_ISR | J3_19 | BoosterPack pin 19 |
| PA16 | GPIOA | Button | J2_4 | BoosterPack pin J19.4 |
| PA22 | GPIOA | USER_LED_1 | J2_5 |
|
| PA20 | DEBUGSS | SWCLK | N/A |
|
| PA19 | DEBUGSS | SWDIO | N/A |
|
Device Migration Recommendations
This project was developed for a superset device included in the LP_MSPM0C1104 LaunchPad. Please visit the CCS User’s Guide for information about migrating to other MSPM0 devices.
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 Board→Configure Unused Pins.
For more information about jumper configuration to achieve low-power using the MSPM0 LaunchPad, please visit the LP-MSPM0C1104 User’s Guide.
Example Usage
Compile, load and run the example. Connect a USB-UART adapter to PA17 (TX) and PA26 (RX).
The device performs auto-baud detection on the first received byte, then echoes all received data. Press the button (PA16) to send a test byte (0x55).
Clock: 24MHz SYSOSC.
Compensation calibration: see header comment in sw_uart_c1104.c. Measurement pins PA23 and PA4 can be used with a logic analyzer for ISR timing calibration.