LCD & OLED display modules 0.96" - 15.6" · Shenzhen factory since 2005 Sample MOQ 5 pcs · Lead time 10-20 days · hyd@szjunxian.com
Home/Guides/ST7789 / GC9A01 / ST7735 Init Problems:
Technical guide

ST7789 / GC9A01 / ST7735 Init Problems: Offset, SPI Mode and CS

These three controllers sit behind most small SPI colour displays, and most “my display shows garbage / a shifted image / nothing” threads trace back to the same handful of causes: the controller RAM is larger than the glass, the CS pin changes which SPI mode works, and inversion and colour order are per-panel settings that example code cannot know. None of them are faults - they are configuration, and they are all fixable in software.

Written by the Junxian applications engineering team. Figures quoted for “our models” are calculated from the 103 models on this site that carry a full parameter set, so they change when the catalogue changes.

Same controller, different panel: why example code half-works

An ST7789 addresses a 240x320 pixel RAM regardless of the glass in front of it. A 240x280 or 240x240 panel shows a window into that RAM, and where that window sits is a property of the module, not the controller. Example code written for one module compiles and runs on another - and produces an image shifted by exactly the offset difference, with a band of noise where the unwritten RAM shows. The fix is one line: set the column and row offsets for your module before drawing.

The offset numbers, and where to get them

For a 240x320 panel the offsets are zero. For shorter glass the window is placed by the module maker - commonly centred, so a 240x280 panel starts 20 rows in, and a 240x240 panel 80 rows in on one rotation - but “commonly” is not a specification. The authoritative numbers are in the module datasheet, and they can differ between two modules that look identical. If your image is shifted by a constant amount in one axis, you are looking at an offset problem, not a timing problem.

SPI mode, and the boards with no CS pin

These controllers sample SPI in mode 0 with CS driven normally. Some breakout boards tie CS permanently low to save a pin - and with CS never toggling, the controller loses the edge it uses to frame the transaction, which in practice means the module only works in SPI mode 3. So: board has a CS pin, use mode 0 and drive it; board has no CS pin, try mode 3 before concluding the module is dead. Mixing this up produces a perfectly white, perfectly silent screen.

Inverted colours and swapped red/blue

Whether the glass is normally-black or normally-white decides if the inversion command must be on or off - get it wrong and you see a photographic negative. Separately, the RGB/BGR bit decides channel order - get that wrong and reds and blues swap while everything else looks fine. Both are one-command fixes, both are per-panel properties, and both are the first thing to try when colours are wrong but geometry is right.

Reset and shared-bus discipline

All three controllers need a deliberate reset pulse and a wait before the init sequence, and a further wait after sleep-out - shortening these delays to speed boot is a false economy that produces intermittent cold-start failures. On a bus shared with SD cards or flash, every device needs its CS managed; a floating CS on any device can corrupt the display's transactions only sometimes, which is the worst kind of bug to chase.

Library configuration: where the settings live

Whether you use TFT_eSPI, LVGL with a driver layer, u8g2 for monochrome, or a vendor HAL, all of the above surface as configuration entries: driver selection, width, height, column offset, row offset, SPI mode, inversion, colour order. The library is rarely wrong; its defaults are simply for a different module. Copying a configuration from a forum post transplants that stranger's module onto yours - use the numbers from your module's datasheet instead.

The controllers we ship and what you get with them

The table below is the driver IC mix across our published models. For any of them, ask with the model number and we supply the verified initialisation table for that module and batch - offsets, inversion, colour order and reset timing included - so the settings above are numbers you copy in, not numbers you discover.

Driver / controller ICModels using itSizesExample model
ST7735S60.96", 1.77", 3.5", 7"JM-PT034
ST778952.4", 3.2"JM-PT090
ST756743"JM-L12806404
ST7701S33", 4", 5"JM-PT128-00
CH111621.54"JM-PO150
LT8619B27"JM-GD814
NV3052CRGB23.4", 4.3"JM-TFT043BI051
SSD1306BZ20.49", 0.96"JM-PO107
ST7066U2-JM2004A
ST726225"JM-TFT050BI52
ST7262E4324.3"JM-PT042
ST7789P322.4"JM-PT095-01
T6963C21.3", 5.2"JMP0121
9881110.1"JM-PT134-01
ATP3106613.2"JM-2004C-00
CST892217"JM-PT121-01
EK971317"JM-PT098-00
GC910711.77"JM-PT077
GC9503CV14.45"JM-PT097
GC9A0111.28"JM-PT106-00
ILI 9340X13.5"JM-PT075
ILI 9341V12.4"JM-GD819
ILI9340X12.8"JM-PT119-01
ILI948813.5"JM-PT048-01
ILI9881C110.1"JM-PT125-00
KS0066U1-JM2002A
LC79811-JM240128J-1
NT710814.3"JM19264C
NV3047EGHK-H214.3"JM-PT105-01
RA6963C1-JM24064A
RA883515.7"JM320240A
SBN1661G1-JM12232B
SH1106G11.3"JM-PO139-01
SPLC780D1-JM1602M
SSD130611.3"JM-PO158-01
SSD1309 Or Equivalent12.42"JM-P0159-00
SSD1315Z10.96"JM-PO136
SSD135111.46"JM-PO128
ST70661-JM0802B
ST725715"JMT050WQ3TNN-01
ST726515"JM-PT136-00
ST7272A13.5"JM-PT113
ST7516012.5"JM16096C02
ST7516113"JM-PL054-00
ST752512"JM-PL042-LG19264
ST7525612.9"JM240128C07
ST7567R11.5"JM-PL024
ST7567S13.2"JM-PL051-LG12864
ST773511.77"JM-PT130-00
ST7735P310.96"JM-PT138-00
ST7789T3-G4-112.8"JM-PT033-01
ST7789V11.3"JM-PT115-00
ST7789V212"JM-PT086
ST7789V311.14"JM-PT149-00
ST792013.8"JM12864G
UC1604c12"JM19264C03
UC1628C12.9"JM240160C02
UC1698U15"JM240128C09-GSBLWNG5
UI_Editor-II14.3"JM-LH018-00

Taken from the published specification of each model. A further 21 published models do not name the controller on the public page - that is deliberate on glass where the source can change; ask and we will confirm the current IC for a specific order.

Questions engineers ask us about this

My ST7789 240x280 image is shifted by 20 pixels. Why?

The controller RAM is 240x320 and your glass is a 240x280 window into it, placed 20 rows in. Set the row offset for your rotation and the image lands where it should. The equivalent on 240x240 glass is an 80-row offset on one rotation.

My GC9A01 round display stays white with wiring I know is right.

Check CS handling first: these controllers want mode 0 with a driven CS, or mode 3 on boards where CS is tied low. Then check the reset is a deliberate GPIO pulse with the datasheet wait, not a side effect of MCU reset. Those two cover most silent white screens on round modules.

Colours are inverted - is the module faulty?

Almost certainly not: the inversion setting in your init does not match the glass type. Toggle the inversion command and it will read correctly. If red and blue are swapped instead, toggle the RGB/BGR order bit.

Is ILI9341 the same as ST7735 / ST7789 for these problems?

The failure modes are the same family - offsets, SPI framing, inversion, colour order - the register values differ. The diagnostic method in this guide applies to any small SPI TFT controller, whichever IC is fitted.

Can you confirm which controller a module uses before I order?

Yes. Some of our published pages deliberately do not name the controller where the source can change; ask about a specific model and order quantity and we confirm the current IC and supply its init table. If controller continuity matters to your firmware, say so and it becomes part of the order terms.

Need a quote or a datasheet?

Send us size, resolution, interface and annual quantity. Our engineers reply within one working day. Sample MOQ 5 pcs, lead time 10-20 days.

WhatsApp