GitHub Digital Lab

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

Board only. No build recorded.

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

Spin a brushless motorThe motor spins from a LaunchPad and a plug-on driver board, then runs closed loop on TI's FOC
How fast a chip reacts to a signalHow many cycles from a signal to its handler, and one motor-control step timed
Measure a board's current draw, for battery lifeRunning current read through the debug probe, even on a board with no meter of its own

Every build

Get the code

Ran in part. TI's PWM examples run, and their output was not measured.

Start it

Paste this in a terminal. It hands off to an AI assistant with this board's notes. There are no written steps for this board yet.

./start.sh mspm0g3507 pwm-dim --assistant claudegit clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs ./start.sh mspm0g3507 pwm-dim --assistant claude
Not Claude Code? Copy this prompt instead.
Clone https://github.com/Fox-Red-Labs/fox-red-labs and read mspm0g3507/AGENTS.md first. Then run Dim an LED or move a servo on my LP-MSPM0G3507. Tell me when to plug in the board and what you saw at each step.
Only the code for this board
git sparse-checkout set mspm0g3507/stm32-port-eval/05-tim-pwmgit clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git cd fox-red-labs git sparse-checkout set mspm0g3507/stm32-port-eval/05-tim-pwm
Everything for this build

Adds the board's own folder (its notebook, fixes and assistant notes) and the shared code this build draws on. Notes for an AI assistant: mspm0g3507/AGENTS.md.

git sparse-checkout set mspm0g3507git clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git cd fox-red-labs git sparse-checkout set mspm0g3507
Or take the whole repository
git clone https://github.com/Fox-Red-Labs/fox-red-labs.git
Reports from others, and the report forms

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.

Evidence and limitsTI's PWM examples run; the pulses are not measured. 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...
Could workDoes 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

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.