GitHub

Fox Red Labs / Builds / Motor control, power and sensing

Dim an LED or move a servo

The LED dims up and down, or a hobby servo swings.

Easy20 min

No recorded steps

Some pieces of it have run. There are no recorded steps for this project, so this page does not give any.

What exists:

  • LP-MSPM0G3507: TI's PWM examples run, and their output was not measured. A PWM program ported from ST's example did not match its duty: one channel read high in 88 of 600 debugger samples, 14.7% (plus or minus 2.8%) against 12.5% duty. One channel was measured, with no servo
  • LP-MSPM0L1306: TI's PWM examples run; the output was not measured

You would need the board, plus ELEGOO jumper wires.

Errors and fixes: LP-MSPM0G3507, LP-MSPM0L1306.

What to build next

Every build. The code for all of them is in the GitHub repository.

Evidence and limitsTI's PWM examples run; the pulses are not measured. Ran on 2 boards. Results, sources, timing and limits.

Which boards ran it

  • Could work LP-MSPM0G3507: TI's PWM examples run, and their output was not measured. A PWM program ported from ST's example did not match its duty: one channel read high in 88 of 600 debugger samples, 14.7% (plus or minus 2.8%) against 12.5% duty. One channel was measured, with no servo
  • Could work LP-MSPM0L1306: TI's PWM examples run; the output was not measured

Experiments (3)

StatusWhat was triedResult
WorksCan the TI LP-AM13E230 spin a hobby-kit motor with no soldering?
AM13E230, 2026-10-09
The Freenove kit's 28BYJ-48 stepper turned a full turn each way. It ran from four plain output pins and the board's 5 V, through the kit's ULN2003 driver board, with no soldering and no breadboard. Build and flash...
Does microstepping the kit stepper through the LP-AM13E230's PWM units cost the chip anything?
AM13E230, 2026-10-09
The same six wires that stepped the kit 28BYJ-48 on and off now microstep it. The chip's PWM units give sinusoidal duties, updated 20,000 times a second. The update handler costs 138 cycles with the trig unit (1.4...
WorksDoes MSPM0 driverlib code run on the LP-AM13E230 with only a shim header?
AM13E230, 2026-10-09
Three MSPM0 driverlib programs run on the AM13E230: a GPIO toggle, a UART print and a timer PWM. All 53 lines of app code are unchanged, with a 13-line shim header. The PWM program needed the MSPM0 generated init...

Source files

Demos with wiring

LP-MSPM0G3507 from above with one wire from J4 pin 32 to J4 pin 31

Pins are drawn on TI's board drawing; the source is in the repo next to the README. Open full size

Loop 3: the chip checks its own PWM

You need

  • LP-MSPM0G3507 LaunchPad development kit: TI's 80 MHz Arm Cortex-M0+ board with 128 kB flash and 32 kB RAM, a built-in debugger, three buttons, two LEDs (one RGB) and light and temperature sensors.
  • ELEGOO jumper wires (120-piece pack): Male and female breadboard wires for connecting anything to anything.

Wiring

  1. Unplug USB. Every display wire can stay where it is
  2. One wire from J4 pin 32 (PA12, PWM channel 4) to J4 pin 31 (PA13, read back as a plain input)
  3. Plug USB back in and run the PWM example; the program samples PA13 600 times

What was measured

  • PA13 high in 88 of 600 samples: 14.7% plus or minus 2.8%, against 12.5% in the original STM32 example this was ported from
  • Measures the share of time high, not the frequency; channels 1 to 3 not measured

Versions: MSPM0 SDK 2.11.00.07, TI Arm Clang 5.1.1, TI's migration skill; measured 2026-10-06.

Next: Measure channels 1 to 3 and the frequency with a timer capture instead of debugger reads.

How to repeat it: Jumper wires on the LP-MSPM0G3507: three loops to start. Errors and fixes: FAQ. Numbers from LP-MSPM0G3507 timer PWM notes.

Get the code and tell us how it wentThe clone command, the board folder with its AGENTS.md, reports from others, and the three report forms.

Get the code

Clone the repository and open the board's folder below. AGENTS.md is a plain text file of notes for AI coding assistants, and llms.txt at the root indexes the site for one.

git clone https://github.com/Fox-Red-Labs/fox-red-labs.git

Code is BSD-3-Clause, writing is CC BY 4.0; third-party folders keep their own licenses.

Built it? Tell us

Built this, or got stuck? Report it on GitHub with a few short answers. Your report shows here in your words, marked as yours. A failure that repeats on the bench gets its fix here.