Skip to content

feature/jc3248w535: Add Guition JC3248W535#796

Open
cosmicpsyop wants to merge 13 commits into
BitMaker-hub:developfrom
cosmicpsyop:feature/jc3248w535
Open

feature/jc3248w535: Add Guition JC3248W535#796
cosmicpsyop wants to merge 13 commits into
BitMaker-hub:developfrom
cosmicpsyop:feature/jc3248w535

Conversation

@cosmicpsyop

Copy link
Copy Markdown
Contributor

Guition JC3248W535

Video Demo>>

Adds a complete display driver for the Guition JC3248W535 (AXS15231B, QSPI, 480×320 landscape) panel as used in some NerdMiner v2 devices. Biggest issue is a display flicker due to a complete frame buffer flush each tick, Mitigation gates backlight during flushes to eliminate visible redraw flicker.

Current flush / flicker strategy

Original problem: every gfx->flush() pushes the entire 480×320 framebuffer:
480 × 320 × 2 = 307,200 bytes

That visibly flashed the screen when it occurred every tick.

Included:

Rendering engine - PSRAM framebuffer (Arduino_Canvas) + separate bg_cache for artifact-free text erase — no more black boxes or ghosted digits when values change width. OpenFontRender TTF rasterizer for DigitalNumbers and NotoBold fonts. Hysteresis quantizers on hashrate and temperature to suppress per-tick snapshot oscillation

Backlight gating - jc_flushGated() turns the backlight off during the ~35ms panel write, back on after — dark period is below human perception. jc_backlight_enabled bool tracks intended state (v0.9.18: replaces fragile digitalRead on an output pin)

Smart flushing - Snapshot-based dirty detection — only pushes the 307KB framebuffer when displayed content actually changes (or every 60s safety net). jc_flushOrPushRect() is a no-op under partial-flush; end-of-frame handles the single flush (prevents flush storms)

Touch - AXS-touch I2C @ 0x3B, polled at NerdMiner's 10Hz cadence with 200ms debounce. Top-half tap → next screen; bottom-half tap → toggle Pool/Fees panel

Arduino_GFX_Library 1.6.0 (pinned — 1.6.1+ breaks AXS15231B QSPI init)
moononournation/Arduino_GFX#803

Fix - Replace board-specific fee guards with SCREEN_FEES_ENABLE

Features and diagnostics:

;-D DEBUG_MINING=1
;    General mining debug logging.

;-D JC_TOUCH_DEBUG=1
;    On-screen touch poll/hit counters and raw/tap coordinate readout.

;-D JC_NO_TOUCH_POLL=1
;    A/B isolation: disable AXS I2C touch polling.
;    v0.9.2 ruled out touch polling as SD drop cause.

;-D JC_NO_SD_PIXEL=1
;    A/B isolation: disable SD status pixel and SD status queries.

;-D JC_LOG_SNAPSHOTS=1
;    Diagnostic: log snapshot strings once/sec/screen to identify which field changes.

-D JC_NO_SLIDESHOW=1
    Compile out JPEG slideshow / TJpg_Decoder path.

;-D JC_NO_SNAPSHOT=1
;    A/B test: bypass snapshot/quantization and force gated full flush every tick.

JPEG Slideshow with NerdMiner Stats (Experimental)

Slideshow screen — reads /pic/*.jpg (configurable), decodes via TJpgDec directly into the framebuffer MCU-by-MCU (no extra buffer needed), and renders a bottom stats overlay showing current time, BTC price, and block height. Images larger than the panel are auto-scaled to fit. Auto-advances on a configurable timer; bottom-half tap advances immediately, top-half tap returns to the next cyclic screen. Gracefully handles missing SD card or empty directory. JPEG decode failures display a human-readable error reason on screen instead of a raw code.

Recommended ImageMagick command format image compatible with library:

magick image.jpg \
  -resize 480x320! \
  -colorspace sRGB \
  -interlace none \
  -sampling-factor 4:2:0 \
  -quality 85 \
  converted-image.jpg

Subsystem overview

Subsystem Status
Display (AXS15231B QSPI, 480×320 landscape) ✅ working
Touch (AXS @ I²C 0x3B, polled @ 10 Hz, debounced) ✅ working
5 cyclic screens (Miner / Clock / GlobalHash / Price / Slideshow) ✅ working
Two-zone touch (top = next screen, bottom = pool ⇄ fees or slideshow image advance) ✅ working
Backgrounds (canonical art, scaled to 480×320 layout, pre-rendered slabs in PSRAM) ✅ working
OpenFontRender (DigitalNumbers + NotoSans Bold) ✅ working
Pool stats / BTC price / fees / block height ✅ working
WiFi via captive portal ✅ working
Serial via USB-CDC (HWCDC) 🟡 works, with known quirk
SD card (SDMMC 1-bit, 20 MHz, internal pull-ups, stays mounted) ✅ working
SD status pixel (4×4 px at bottom-left) ✅ working
Per-second screen flash on data update 🟢 mitigated by snapshot hysteresis + backlight-gated full flush
Partial sub-rect flush 🔴 not production-ready; historical path must remain disabled until corrected jc_pushRect() is validated

Credit

  • F1ATB / AudunKodehode for working JC3248W535EN AXS15231B reference sample.
  • moononournation for Arduino_GFX_Library and the AXS15231B panel class.
  • BitMaker-hub NerdMiner_v2 community for the driver framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant