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
LP-MSPM0L1306On 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
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 detectYou should see: Two ports. The one ending in 1 is the chip's serial port at 115200 baud.
frl.py detectlists the probe serial; use it as<probe serial>below.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 l1306You should see: A clean build in about 3 s that leaves
portability/three-ways/driverlib/build-l1306/three_ways.outand prints its size (2.3 kB of flash).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.
OCDis the folder you unpacked xPack OpenOCD into; without it the script looks in~/xpack-openocd-0.12.0-7, then foropenocdon 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.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.txtYou should see: About 12 lines like
t=5 adc=2645 avg=2645, one a second, thenPASS. 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
If something goes wrong
| No ports appear | Try another cable. A charge-only cable looks the same. |
| SysConfig or the compiler is not found | Set FRL_MSPM0_SDK, FRL_TICLANG and FRL_SYSCONFIG to your install folders. |
| OpenOCD prints `Error | Checksum mismatch - attempting binary compare` first; that is normal and the line after it is the real result. |
| No lines appear | Check the port ends in 1 and that J16 and J17 are still on the XDS side. |
| The checker prints FAIL | It 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 claudegit clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs
py start.py mspm0l1306 temperature --assistant claudeNot Claude Code? Copy this prompt instead.
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
- LP-MSPM0L1306: folder
mspm0l1306/.- README: the board's lab notebook (what was run, in order)
- Notes for an AI coding assistant working in this repository: notes for an AI assistant; copy it into your own project if you use one
- FAQ: errors and fixes
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
| App | portability/three-ways common/app.c with glue_driverlib.c: 4-sample moving average, one line a second at 115200, ADC0 channel 9 on PA15 | README notes |
|---|---|---|
| Result | thermistor PA15 about 2645 counts, avg 2644 (2684 on 2026-10-07); serial_check.py PASS, 12 s | the 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.pyprinting 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
- MSPM0G3507, CC2340R5, F2800137not assessed
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
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)
| Status | What was tried | Result |
|---|---|---|
| Works | Can 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. |
