GitHub

Fox Red Labs / Builds / Screens and USB

Put colors and touch on a small screen

Wire a 3.5 inch touch screen to a LaunchPad kit with 11 jumper wires and run a 7.4 kB program that paints colors, bars and a dot under your finger.

MediumWiring needed1 evening

An LP-MSPM0G3507 wired to a 3.5 inch touch screen showing the Fox Red Labs logo
The wired board with a saved picture on the screen, drawn by this driver in its photo mode. The fills, bars and touch dots the steps run were seen at the bench but not photographed.

Parts and steps

You need

LP-MSPM0G3507 from above with 12 numbered wires to the Waveshare 3.5 inch touch display
The 40-pin edge is four 10-pin headers. Hold the board with the USB connector at the top: J1 (pins 1 to 10) and J3 (21 to 30) are the two left rows, J4 (31 to 40) and J2 (11 to 20) the two right rows. Pin 1 of J1 and pin 21 of J3 are the top pins of the left rows, nearest the USB connector; J4 and J2 count the other way, so pin 40 and pin 20 are at the top. A diagram drawn on TI's board drawing, checked against the SysConfig pin output this demo is built with (mspm0g3507/display-test/gen/ti_msp_dl_config.h). Signal and supply are both 3.3 V: the module's level translator takes the LaunchPad kit's 3V3, and nothing is driven at 5 V. No jumper on the LaunchPad moves. Full size.
Pin table
Display pinLaunchPad pinWhat it isNeeded
VCC pin (not the 3V3 pin)J1 pin 1 (3V3)power, 3.3 V onlyrequired
GNDJ2 pin 20 (GND)groundrequired
SCLKJ1 pin 7 (PB9)screen clock, SPI1required
MOSIJ2 pin 15 (PB8)screen data in, SPI1required
LCD_CSJ2 pin 13 (PB6)screen chip selectrequired
LCD_DCJ4 pin 39 (PB1)command or datarequired
LCD_RSTJ4 pin 40 (PB4)screen resetrequired
LCD_BLJ4 pin 38 (PA28)backlight onrequired
TP_SDAJ1 pin 10 (PB3)touch data, software I2Crequired
TP_SCLJ1 pin 9 (PB2)touch clock, software I2Crequired
TP_INTJ2 pin 11 (PB16)touch interrupt. The program reads it once at start for a diagnostic value and finds touches by polling the touch chip, so the demo does not need it. Wired in the tested setup.optional
TP_RSTJ2 pin 12 (PB0)touch resetrequired
MISOJ2 pin 14 (PB7)screen read-back; only to diagnose a dark screenoptional
3V3 pin and SD_CSnot connectedthe module's own 3V3 pin, which stays empty, and its SD card selectleave off
Set up your computer once: 1 step. Done already? Start at step 2.
  1. Install the tools once, all free.TERMINAL

    Get CCStudio 21.0.1 from TI's CCStudio download page (1.9 GB download, 8.1 GB installed, free myTI login). It brings TI Arm Clang 5.1.1. Get the MSPM0 SDK 2.11.00.07 from TI's MSPM0 SDK download page (0.4 GB download, 2.2 GB installed). Then get xPack OpenOCD 0.12.0-7 from its GitHub release page (2 MB; the file xpack-openocd-0.12.0-7-darwin-x64.tar.gz on an Intel Mac, ...darwin-arm64.tar.gz on Apple Silicon) and unpack it in your home folder. Clone this repository into <repository folder>.

    You should see: /Applications/ti/ccs2101/ccs/tools/compiler/ti-cgt-armllvm_5.1.1.LTS/bin/tiarmclang --version prints 5.1.1, and the SDK folder /Applications/ti/mspm0_sdk_2_11_00_07 exists.

  1. With the LaunchPad unplugged, run the wires in the table above from the display to the header, power from the 3V3 pin only.BENCH

    Leave the display's own 3V3 and SD_CS pins empty. A 13th wire, MISO, is optional and only for reading the screen's status back.

    You should see: Every wire sits on the header row the picture shows; nothing is plugged into the display's 3V3 or SD_CS.

  2. From the repository folder, build every variant of the display test into out/.TERMINAL

    Replace <repository folder> with the folder you cloned.

    Replace <repository folder> before you run this.

    cd <repository folder>/mspm0g3507/display-test ./build.sh

    You should see: For each build, a line with the address of its res results struct and the program size. The demo, out/display_8mhz/display_8mhz.out, is 7.4 kB of flash and 648 bytes of RAM.

  3. Flash the 8 MHz demo with OpenOCD.TERMINAL

    Replace <probe serial> with your probe's serial number (read it with xdsdfu -e), and <repository folder> with your clone. The first command sets OCD to the folder you unpacked OpenOCD into.

    Replace <repository folder> and <probe serial> before you run this.

    export OCD="$HOME/xpack-openocd-0.12.0-7" openocd -s "$OCD/openocd/scripts" -f <repository folder>/ports/bitnetmcu/openocd-mspm0.cfg -c "adapter serial <probe serial>" -c init -c "reset halt" -c "program out/display_8mhz/display_8mhz.out verify" -c "reset run" -c shutdown

    You should see: OpenOCD finishes with the program verified, and the screen starts the demo: it fills red, green, blue, white and black, then draws eight color bars.

  4. Touch the screen with a finger and drag it around.BENCH

    You should see: A white dot is painted wherever you touch, and the board's red LED toggles on each touch.

Or hand it to a coding assistant

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 mspm0g3507 small-screen --assistant claude

It runs the steps above and reports what it saw.

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 Show colors and read touch on a small screen on my LP-MSPM0G3507, following docs/builds/small-screen.md. Tell me when to plug in a board and what you saw at each step.

If something goes wrong

Your tools live somewhere elseChange the SDK and CC lines at the top of build.sh in step 3.
You are not sure a wire is on the right pinCount from the header's pin 1, the corner nearest the USB connector at J1. Check it against the table before plugging in.
The compiler or SDK is not foundChange the SDK and CC lines at the top of build.sh.
OpenOCD reports a CRC mismatch after the program stepSee the OpenOCD CRC mismatch entry.
The screen stays dark or shows static with every wire rightSee the screen stays dark entry. The chip-select gap or a wire is the usual cause, and LCD_BL on J4 pin 38 is the first wire to check.
More troubleshooting
Nothing follows the fingerTouch is not answering: the touch chip at address 0x38 entry has the two checks (software I2C pins, TP_RST).

Every fix for this board: the FAQ.

What to build next

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

Evidence and limitsA 3.5 inch touch screen on 11 wires (12 with the optional INT); a full-screen fill takes 67 ms at 40 MHz SPI. Ran on 1 board. Results, sources, timing and limits.

Expected result: The screen shows red, green, blue, white and black fills, then eight color bars. Then it paints a white dot under your finger and toggles the red LED on every touch. The whole program is 7.4 kB of flash and 648 bytes of RAM.

What this shows

  • A TI LaunchPad kit with 32 kB of RAM drives a 320 x 480 SPI touch screen with 11 jumper wires (12 with the optional touch INT wire) and a small program from this repository. The screen's ID reads back as the ST7796S and the touch chip as the FT6336U.
  • A full-screen fill of 300 kB takes 364.9 ms at 8 MHz SPI, 182.5 ms at 16 MHz, and 67.2 ms at 40 MHz SPI. The CPU runs at 80 MHz and frames are 16-bit. At every speed 64 pixels of one row were read back and matched.
  • TI's MSPM0 SDK has no example for this screen or any TFT, so the driver is this repository's own.
What this does not establish, and limits

What this does not establish

  • That the screen is right everywhere. At each speed only 64 pixels of one row were read back. The colors were not checked by eye at 16 MHz or faster.
  • That 40 MHz SPI is safe in general. The chip's data sheet rates these standard-drive pins to 16 Mbit/s and the panel's allows about 15 MHz. It worked here on short wires; the margin may not hold elsewhere.
  • The fills, bars and touch dots were seen by a person at the board and not recorded, so no photo or video of this exact program exists in the repository.
  • A graphics library. LVGL runs on the same wiring, at 7 refreshes a second at 32 MHz and 15 to 19 at 80 MHz, using 25.1 kB of RAM. That is a different program, and its screen was not checked by eye.

Limits to keep in mind

  • Chip select needs a 10 microsecond pause after it goes high between commands. Without it the screen drops the second of two back-to-back commands and never turns on. The program has the pause (cs_gap() in display_test.c); a rewritten driver must keep it.
  • The touch chip answered only to software I2C on the same two pins. It did not answer to the chip's I2C block, so the program uses software I2C.
  • One 320 x 480 frame at 16 bits is 300 kB, 9.4 times the chip's RAM, so drawing goes in strips and stored pictures are cut to 75 kB.
  • The speed results need the separate perf builds and a RAM dump through OpenOCD. The README's read command was assembled from the flash command and not re-run, so this build leaves it out.

Sources

Versions, sizes and timing

Screen and touchST7796S over SPI1 (3-wire, 8 MHz in the demo) and FT6336U touch, software I2C at about 100 kHz, on a Waveshare module with a TXS0108E level translatorREADME notes
Full-screen fill364.9 ms at 8 MHz SPI; 182.5 ms at 16 MHz; 168.1 ms with 16-bit frames and DMA at 16 MHz; 134.4 ms at 20 MHz and 67.2 ms at 40 MHz SPI with the CPU at 80 MHz; 84 to 92% of what the SPI clock allowsREADME notes
Read-back check64 of 64 pixels of one row matched at every speed; no other pixels were checkedREADME notes
Program size7,592 bytes of flash (7.4 kB) and 648 bytes of RAM, from tiarmsize on display_8mhz.outREADME notes
Start-up370 ms from power-up to screen ready with the usual init waits; 12 ms with the shortest waits the data sheet allowsREADME notes
ToolsIntel Mac, macOS 15.7; MSPM0 SDK 2.11.00.07; SysConfig 1.26.3; TI Arm Clang 5.1.1; xPack OpenOCD 0.12.0; 2026-10-06README notes

Evidence

  • 2026-10-06: after two fixes (a 10 microsecond chip-select gap and software I2C for the touch chip) the screen filled with color, showed bars, and drew a dot under the finger on each touch. A person at the board saw this. It was not recorded. MSPM0G3507 touch display notes
  • Screen ID read back over MISO as 0x7796 (ST7796S); touch chip read as vendor 0x11, chip 0x64 (FT6336U), firmware 0x12 (observed, not saved). README notes
  • Full-screen fill speeds were measured and saved: 364.9 ms at 8 MHz SPI, 67.2 ms at 40 MHz with an 80 MHz CPU clock.

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
Show colors and read touch on a small screen
LP-MSPM0G3507WorksFills, bars and touch dots on 11 wires (12 with the optional INT); full-screen fill 0.36 s at 8 MHz SPI, 67 ms at 40 MHz Waveshare 3.5inch Capacitive Touch LCD on the TI LP-MSPM0G3507
LP-MSPM0L1306
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 (5)

StatusWhat was triedResult
WorksCan a TI LP-MSPM0G3507 drive the Waveshare 3.5inch Capacitive Touch LCD?
MSPM0 G3507, 2026-10-06
Works: fills, bars and touch dots on 12 jumper wires (seen, not saved); a full-screen fill takes 0.36 s at 8 MHz SPI and 67 ms at 40 MHz SPI with an 80 MHz CPU. The line is memory: a full frame (300 kB) is 9.4 times...
Does the u8g2 display library compile for a TI C2000 LaunchPad (LAUNCHXL-F2800137), where a byte is 16 bits?
LAUNCHXL-F2800137, 2026-10-08
u8g2 2.37.1 compiles and links for the C28x when uint8_t is unsigned char (16 bits there): 19 kB of flash for u8x8 text plus one u8g2 font on an SSD1306. With C2000Ware's uint8_t (uint16_t) the fonts do not compile....
WorksCan the TI LP-AM263P decode H.264 video, with no video hardware and no operating system?
AM263P, 2026-10-09
h264bsd decodes the 30-frame 640x360 baseline test stream on one R5F at 400 MHz in 15.2M cycles per frame (26 frames per second, -Os), and all three checksums match the Mac's. It needed a 2 MB memory layout: the 3 MB...
WorksCan the TI LP-AM263P's PRU generate a parallel RGB display bus from on-chip RAM, and how does that compare with SPI and the AM263x's GPMC bus?
AM263P, 2026-10-11
The AM263P's PRU generates a parallel RGB565 bus from a frame buffer in on-chip RAM with no CPU time: 800x480 at 45.6 frames a second and 480x480 at 76.3 at a 22.2 MHz pixel clock, each frame's pixel sum matched at...
WorksCan an LP-MSPM0C1104 with 1 kB of RAM drive a 128 x 128 Sharp screen?
MSPM0 C1104, 2026-10-20
The 128 x 128 Sharp panel runs from the MSPM0 C1104 with no frame buffer: 4.9 kB of flash and 609 B of RAM (352 B of the stack used), the whole picture drawn and sent in 154 ms with 1-row bands and 41 ms with 16-row...

Source files

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.