Newer FM-1s' screen: M-VAVE's own ST7789V setup after the reset, in its order (as fm1-base 9272e82, 4a2b9fa)

Newer FM-1s (the FM-1 / M-VAVE logo under the screen, mostly the UC25HQ80 flash, JEDEC 0xB36014) show washed-out
colors, no reds or a blank screen unless the panel gets M-VAVE's own setup (found and measured by Jake Handy for h1
0.3.1; zvenson/dinghy docs/NEWER-FM1-SCREEN.md). The first FM-1s look the same with it.

- lcd.c's LCD_SEQ is fm1-base's: SWRESET, DISPOFF, SLPOUT, porch, gate, VCOM, supplies, 60 Hz, both gammas, MADCTL,
  COLMOD, SPI2EN 0 (one data line), WRDISBV 0xFF, INVON, NORON; then the screen cleared and DISPON as before.
- Sent at the init's clock; the panel then runs at LCD_BAUD (the fast clock) as before, on every FM-1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAMzZUyiUntHBFKek1SVME
This commit is contained in:
Charles VestalandClaude Opus 5.5 committed 2026-11-29 17:27:44 +01:00
1 parent 6515e77d97
commit 37dbb026c7
1 file changed
+26 -7
+26 -7
View File
@@ -98,18 +98,37 @@ static void lcd_blit(uint32_t x, uint32_t y, uint32_t w, uint32_t h, const uint1
lcd_data(px, w * h * 2u);
}
/* ST7789V init: reset, then 16-bit colour, scan direction and IPS inversion;
* voltage and gamma stay at the defaults. Format: cmd, n, n data bytes;
* cmd 0x00 = wait (data byte: ~ms). */
/* ST7789V init. Format: cmd, n, n data bytes; cmd 0x00 = wait (data byte: ~ms).
* M-VAVE's own setup, in the order its firmware sends it (as fm1-base's device/lcd.c; zvenson/dinghy
* docs/NEWER-FM1-SCREEN.md, found and measured by Jake Handy for h1 0.3.1): the ST7789V datasheet's registers at the
* values the panel is driven with; without them VCOMS stays at the reset value 0x20 (the panel wants 0x18), GCTRL
* 0x35 (0x56), VRHS 0x0B (0x1F) and the gamma at its default. The first FM-1s look the same either way (a VCOM off
* the panel's value shows as flicker); the newer ones (the FM-1 / M-VAVE logo under the screen) show washed-out
* colors, no reds or a blank screen without it. Sent at the init's clock; the panel then runs at LCD_BAUD. */
static const uint8_t LCD_SEQ[] = {
0x01, 0, /* SWRESET */
0x00, 1, 150,
0x28, 0, /* DISPOFF */
0x00, 1, 100,
0x11, 0, /* SLPOUT */
0x00, 1, 120,
0x3A, 1, 0x55, /* COLMOD: RGB565 */
0x36, 1, 0x00, /* MADCTL: top-left origin, RGB order */
0x21, 0, /* INVON: IPS panel */
0x13, 0, /* NORON */
0xB2, 5, 0x0C, 0x0C, 0x0C, 0x00, 0x33, /* PORCTRL: porch */
0xB7, 1, 0x56, /* GCTRL: VGH / VGL */
0xBB, 1, 0x18, /* VCOMS */
0xC0, 1, 0x2C, /* LCMCTRL */
0xC2, 1, 0x01, /* VDVVRHEN */
0xC3, 1, 0x1F, /* VRHS */
0xC4, 1, 0x20, /* VDVS */
0xC6, 1, 0x0F, /* FRCTRL2: 60 Hz */
0xD0, 2, 0xA6, 0xA1, /* PWCTRL1 */
0xE0, 14, 0xD0, 0x0D, 0x14, 0x0B, 0x0B, 0x07, 0x3A, 0x44, 0x50, 0x08, 0x13, 0x13, 0x2D, 0x32, /* PVGAMCTRL */
0xE1, 14, 0xD0, 0x0D, 0x14, 0x0B, 0x0B, 0x07, 0x3A, 0x44, 0x50, 0x08, 0x13, 0x13, 0x2D, 0x32, /* NVGAMCTRL */
0x36, 1, 0x00, /* MADCTL: top-left origin, RGB order */
0x3A, 1, 0x55, /* COLMOD: RGB565 */
0xE7, 1, 0x00, /* SPI2EN: one data line */
0x51, 1, 0xFF, /* WRDISBV: full brightness */
0x21, 0, /* INVON: IPS panel */
0x13, 0, /* NORON */
};
static void lcd_init(void)