GitHub Digital Lab

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

Read the board's thermistor once a second

Build a small program that reads the thermistor on the MSPM0 L1306, flash it, and watch one line a second on your computer.

MediumNo wiring30 min

The MSPM0 L1306 this build runs on, drawn from its user guide. Drag to turn it.

What you need

Works on this board
LP-MSPM0L1306
Micro-USB data cablepower, programming and the serial text
On Linux or WindowsThe steps were recorded on a Mac; paths and port names in them are the Mac ones.

macOS (recorded)

TI's tools
/Applications/ti, or ~/ti
Serial port
/dev/cu.usbmodem<serial>1
Probe access
nothing to do

Linux

TI's tools
~/ti (also searched: /opt/ti)
Serial port
/dev/ttyACM0 (by name: /dev/serial/by-id/*<serial>*-if00*)
Probe access
one udev rule, how

Windows

TI's tools
C:\ti (also searched: %USERPROFILE%\ti)
Serial port
COM<n>, named "XDS110 Class Application/User UART" in Device Manager
Probe access
the XDS110 USB driver from UniFlash or CCStudio

Your probe's serial on any system: python3 tools/frl/frl.py detect. Not run on a board under Linux or Windows. Everything else that differs: the full table.

Steps

  1. Leave the jumpers as the board shipped: J16 and J17 on the XDS side.BENCH

    Plug the board into your computer with a micro-USB data cable. Find the probe's serial number and the port name.

    ls /dev/cu.usbmodem* python3 tools/frl/frl.py detect

    You should see: Two ports. The one ending in 1 is the chip's serial port at 115200 baud. frl.py detect lists the probe serial; use it as <probe serial> below.

  2. Build the app for the L1306.TERMINAL

    It reads ADC channel 9 (PA15, the thermistor) every second against the chip's 2.5 V reference.

    portability/three-ways/driverlib/build.sh l1306

    You should see: A clean build in about 3 s that leaves portability/three-ways/driverlib/build-l1306/three_ways.out and prints its size (2.3 kB of flash).

  3. Flash it with OpenOCD. ocd.sh picks the probe by serial number and refuses to run without one.TERMINAL

    Back up whatever is on the board first; this overwrites main flash. OCD is the folder you unpacked xPack OpenOCD into; without it the script looks in ~/xpack-openocd-0.12.0-7, then for openocd on your PATH.

    Replace <probe serial> before you run this.

    export PROBE=<probe serial> export OCD="$HOME/xpack-openocd-0.12.0-7" mspm0l1306/tools/ocd.sh "reset halt" "program portability/three-ways/driverlib/build-l1306/three_ways.out verify" "reset run"

    You should see: OpenOCD ends with ** Verified OK **. The red LED1 changes state once a second.

  4. Record 12 seconds of the board's serial port and check the lines.TERMINAL

    Replace the port with yours (the one ending in 1).

    Replace <probe serial> before you run this.

    python3 portability/three-ways/serial_check.py /dev/cu.usbmodem<probe serial>1 12 /tmp/run-driverlib-l1306.txt

    You should see: About 12 lines like t=5 adc=2645 avg=2645, one a second, then PASS. Expect roughly 2,600 to 2,700 counts at room temperature.

Read the serial output

Open the board's USB serial port in any terminal program at 115200 baud. The lines the program prints appear there.

What to build next

Every build

If something goes wrong

No ports appearTry another cable. A charge-only cable looks the same.
SysConfig or the compiler is not foundSet FRL_MSPM0_SDK, FRL_TICLANG and FRL_SYSCONFIG to your install folders.
OpenOCD prints `ErrorChecksum mismatch - attempting binary compare` first; that is normal and the line after it is the real result.
No lines appearCheck the port ends in 1 and that J16 and J17 are still on the XDS side.
The checker prints FAILIt names the first check that failed (t not counting up, avg wrong, gaps off one second).

Every fix for this board: the FAQ.

Get the code

Paste this in a terminal. It hands off to an AI assistant.

git clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs ./start.sh mspm0l1306 temperature --assistant claude
Not Claude Code? Copy this prompt instead.
Clone https://github.com/Fox-Red-Labs/fox-red-labs and read AGENTS.md first. Then run Read a temperature sensor on my LP-MSPM0L1306, following docs/builds/temperature.md. Tell me when to plug in a board and what you saw at each step.

The code is in portability/three-ways/.

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 limitsThe L1306's board thermistor reads 22.8 °C; its on-chip sensor reads wrong. Results, sources, timing and limits.

Expected result: One line a second on your computer with the thermistor's raw reading near 2,645 counts at room temperature.

What this shows

  • The L1306's onboard thermistor can be read by a small DriverLib program and printed once a second over the board's own USB cable.
  • In TI's out-of-box demo the same thermistor read 22.8 °C.
What this does not establish, and limits

What this does not establish

  • A temperature in degrees: this app prints raw ADC counts. The 22.8 °C figure came from TI's demo, not from this app.
  • That the chip's own temperature sensor works: it read -165 °C on this chip with the factory trim (suspected wrong trim).
  • That warming the thermistor changes the counts: no recorded run does this.

Limits to keep in mind

  • The counts are against the 2.5 V internal reference with a 3.3 V supply assumed; the supply was not measured in this run.
  • One board was run. No reference thermometer was used, so the counts are not an accuracy test.
  • The ADC sample window in this app is 125 µs. TI's faster 8-cycle window reads the thermistor 1.7% low.

Sources

Versions, sizes and timing

Appportability/three-ways common/app.c with glue_driverlib.c: 4-sample moving average, one line a second at 115200, ADC0 channel 9 on PA15README notes
Resultthermistor PA15 about 2645 counts, avg 2644 (2684 on 2026-10-07); serial_check.py PASS, 12 sthe data (CSV)

Evidence

  • On the MSPM0 L1306 the DriverLib build of the app printed 12 lines, one per second (gaps 0.997 to 1.0 s), with the thermistor near 2,645 counts and serial_check.py printing PASS (2026-10-25 row; the first run was 2026-10-07 at about 2,684). the data (CSV)
  • The board's onboard thermistor read 22.8 °C in TI's out-of-box demo, which sends degrees Celsius times 32 (731) once asked.

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Result grid

Project
LP-MSPM0G3507MSPM0G3507 chip
LP-MSPM0L1306MSPM0L1306 chip
LP-EM-CC2340R5CC2340R52 chip
LAUNCHXL-F2800137TMS320F2800137 chip
Read a temperature sensor
LP-MSPM0G3507
LP-MSPM0L1306Could workBoard thermistor reads 22.8 °C; the chip's own sensor reads -165 °C (suspected bad factory trim)
LP-EM-CC2340R5
LAUNCHXL-F2800137

Works ran here and did what it shouldShould work it builds; only naming, packaging or build glue is in the way; hover for whichCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Experiments (1)

StatusWhat was triedResult
WorksCan the NXP FRDM-MCXA153's on-board temperature sensor be read and printed in under ten minutes?
FRDM-MCXA153, 2026-10-11
NXP's SDK example reads the board's I3C temperature sensor and prints it on the serial port with no wires: 22.56 C, 13.6 s to build and 12.4 s to flash.

Source files