Skip to content

Cart (1)

Why does my SPI display flicker at 40 MHz?
Nov 24, 20267 min read

Why does my SPI display flicker at 40 MHz?

Short answer: If your display uses an ILI9341, 40 MHz is four times its 10 MHz SPI write limit. Lower the clock; shorter wires do not bring it back into spec [1]. If it uses an ST7789VW, 40 MHz is below the chip’s 62.5 MHz write limit but above its approximately 6.7 MHz read limit [2]. Check whether the driver reads at the write clock. On a write-only setup, lower the clock and repeat the same update without changing the wiring or power. If the flicker stops, you have a useful clue, not proof of the cause.

Check the Controller and Module Limits

SPI timing limits for the ILI9341 and ST7789VW
Controller Min. write cycle Write clock ceiling Min. write high / low pulse Min. write setup / hold Min. read cycle
ILI9341 100 ns 10 MHz 40 / 40 ns 30 / 30 ns 150 ns
ST7789VW 16 ns 62.5 MHz 7 / 7 ns 7 / 7 ns 150 ns

At 40 MHz, one clock cycle is 25 ns. With a 50% duty cycle, the high and low pulses each last 12.5 ns. Both fall short of the ILI9341’s 40 ns minimum. The ST7789VW meets the write-cycle requirement at 40 MHz, but the signal at the display must still meet the pulse-width and data timing requirements. Use the lower of the chip and module limits; a breakout board’s level shifter or cabling can reduce the usable speed further [1] [2].

Check initialization as well as drawing. A driver may write pixels successfully but fail when it reads the display ID. On an ST7789VW module that supports readback, a 5 MHz ID read is a reasonable starting test if the module permits it; use a separate write clock only if the driver supports switching speeds. If the driver uses one clock for both, keep it below the read ceiling. Measure the clock during the read itself rather than relying on the configured write speed [2].

Match the Symptom Before Changing Hardware

  • Random speckles, wrong colors, or blocks during repeated writes: Start with bus timing, wiring, and driver settings.
  • A horizontal split between two animation frames: Check for tearing, where the panel reads its frame memory while the host updates it.
  • The backlight itself pulses: Check the supply and backlight control, even if lowering the SPI clock also changes the symptom.

This procedure is for embedded SPI TFTs. For HDMI or DisplayPort, use the monitor flicker troubleshooting guide.

Run a Controlled Clock Test

  1. Start below the specified limit. For a write-only test, try 5 MHz on an ILI9341 or 20 MHz on an ST7789VW if the module permits it. If the driver reads on the same clock, start below the read limit instead. These are test settings, not guaranteed operating speeds.
  2. Repeat the same write. Disable animation and repeatedly send a fixed pattern of red, green, blue, black, and white bars. A single image left on-screen does not exercise the bus. Colors that are wrong in the same way on every pass call for a pixel-format or color-order check; speckles that vary between passes call for a timing and wiring check. Keep the backlight setting, update code, wiring, and power unchanged.
  3. Log what changes. Record the controller and module part numbers, clock, whether reads are enabled, and whether you see corrupt pixels, a split image, or brightness changes. If a clock change alters the symptom, use the matching checks below. Raise the clock only within the specified limits; do not retest an ILI9341 at 40 MHz.

Random Pixels: Check the Signal at the Display

Shorten the clock (SCLK) and data (MOSI) leads, keep a short ground return close to them, and separate them from switching power wiring. Change one thing at a time at the same in-spec clock. If you have an oscilloscope, check SCLK and MOSI at the module input, not just at the host. Look for ringing or slow edges and compare the received clock pulse widths and data setup and hold times with the datasheet [3].

Worked example: Suppose a module that permits 40 MHz writes uses an ST7789VW, and the waveform at the controller input has a 25 ns period but is high for only 6 ns. The clock frequency is within the chip’s write ceiling, yet the high pulse misses the 7 ns minimum. Compare the waveform before and after the level shifter, if accessible, to see where the pulse shortens. If you cannot probe the controller input, a measurement at the module connector does not clear the circuit between that connector and the chip. For data timing, check how long MOSI stays steady on both sides of the sampling edge, not just whether a logic analyzer decodes the bytes [2].

When checking the wiring, use the SPI signal definitions to identify clock, data, and chip select. For an Arduino or ESP32 setup, use the TFT wiring and driver setup guide to cross-check the pin assignments, not to set the clock limit.

Split Frames: Separate Tearing from Slow Updates

If repeated writes of the same pattern stay clean but animation shows a split, try updating just the moving region. Tearing occurs when panel scanout overlaps a frame-memory update; a low update rate alone does not prove tearing. Where the module exposes a tearing-effect (TE) pin, check the controller’s TE mode and time the write to the scanout signal. A TE pulse alone cannot make a transfer finish in time [1].

Theoretical full-frame transfer limits at 40 MHz, where supported
Resolution Bits per frame at 16 bits/pixel Full frames per second before overhead
320 × 240 1,228,800 ≈32.6
480 × 320 2,457,600 ≈16.3

Divide 40 million bits per second by the frame size for a single data line carrying one bit per clock. Command bytes, transfer gaps, and software overhead reduce the actual update rate. The first row also applies to the pixel count of a 240 × 320 TFT module; it is not a clock rating for that product.

Worked example: A 320 × 240 full frame at 16 bits per pixel takes 30.72 ms of pixel transfer time at 40 MHz. If a gauge only changes inside an 80 × 40 rectangle, send that rectangle instead: 51,200 bits, or 1.28 ms before overhead. Include the old and new positions if the graphic moves, so the update also erases the old pixels. The shorter transfer gives you more room to time the update against scanout; it does not guarantee a tear-free result.

If partial updates still cannot meet the required update rate, compare SPI, parallel, RGB, and MIPI display interfaces. When pin count is the reason to switch, compare the speed and pin-count trade-offs of SPI and I2C before choosing.

Brightness Pulses: Check Power and Backlight Control

Hold the image and backlight setting steady. Check the supply at the module while the symptom is visible. If brightness pulses but the rail remains steady, check the backlight control signal separately. If the rail drops, verify the regulator, power leads, and module decoupling rather than assuming a larger capacitor will fix it. Keep local bypass capacitors close to the supply pins with a short return path. Check supply-voltage and logic-level limits separately [4].

Isolate the backlight: Draw one image, then pause SPI writes without changing the brightness setting. If the light still pulses, check the backlight supply and control signal before changing SPI settings. If it only pulses during transfers, check whether a supply dip or a change on the backlight control signal lines up with the start of each update. The timing gives you a lead without assuming the SPI data is corrupt.

Still Flickering at a Low Clock?

Verify the clock polarity and phase (CPOL and CPHA), chip-select timing, and pixel format against the controller and module documentation. A wrong SPI mode or pixel format can cause errors at low clocks too. Check the chip-select boundaries the controller expects rather than assuming every command and data byte shares one transaction [5].

For a four-line ST7789VW hookup, check the data/command pin (D/C) when the same command fails on every run. The controller distinguishes command bytes from parameters and pixel data using that pin. If a solid fill works but a color pattern repeats incorrectly, compare the driver’s pixel packing with the controller’s interface pixel format setting before changing the clock again [2].

If the symptom persists, compare with an identical, known-good module using the same driver, clock, wiring, and supply. If it follows the original module, inspect its connector and flex cable. If both behave the same way, revisit the shared setup before replacing hardware. The TFT module listings can help confirm the part number for a like-for-like swap.

Verify the Fix on the Final Setup

  • Repeat startup, including any reads the driver performs, then run the actual animation or update pattern.
  • Use the intended wiring and backlight setting. Recheck the supply if brightness was part of the symptom.
  • Choose an in-spec clock that meets the update-rate target with margin. If the target requires a clock that leaves visible errors or violates a limit, reduce the update area or change the interface instead of accepting occasional flicker.

Need a module for a specific SPI speed? Include your resolution, controller part number, and target clock in your request.

Get a Display Quote

Sources

  1. ILI Technology, ILI9341 datasheet, §§18.3.3–18.3.4 and §10. SPI timing conditions: 25 °C, VDDI 1.65–3.3 V, VCI 2.5–3.3 V [1].
  2. Sitronix, ST7789VW datasheet v1.0, §§7.4.2–7.4.3, Tables 5–6 (SPI timing); §§8.4.2, 9.1.3, and 9.1.32 (serial writes, ID read, and pixel format). SPI timing conditions: 25 °C, VDDI 1.65–3.3 V, VDD 2.4–3.3 V [2].
  3. Texas Instruments, High-Speed Layout Guidelines, SCAA082A [3].
  4. Texas Instruments, General Hardware Design / BGA PCB Design / BGA Decoupling, SPRABV2 [4].
  5. Texas Instruments, Understanding the SPI Bus, SBOA621 [5].
Share

Leave a comment

This site is protected by hCaptcha and the hCaptcha Privacy Policy and Terms of Service apply.