Repository navigation
Fast e-paper updates that keep the panel balanced - #11719
Closed
mikeysklar wants to merge 13 commits into
Closed
mikeysklar wants to merge 13 commits into
mikeysklar wants to merge 13 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a refresh finishes, write the same areas again with this command so the controller's previous image RAM matches the screen. This lets SSD168x style partial updates diff against what is actually shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A keep_awake display ends a transaction still holding its bus when the VM ends, since Ctrl-C can leave one open and the stop sequence would otherwise wait for the bus forever. The stop sequence is also guarded when it follows a refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous RAM holds frame N-lag instead of N-1, so each changed pixel is driven for lag_frames updates, the same number toward black and toward white. Only the box around changed bytes is sent. clean_sequence runs before the first refresh and when the display is released, leaving the panel white and balanced. A waveform or panel reset cut short leaves the panel dark, so while one is under way an interrupt waits and is raised when it ends. A send it stops starts over. Waits are bounded per update so a stuck panel can't hang shutdown, and the watchdog is fed while interrupts are held. CIRCUITPY_EPAPERDISPLAY_LAG gates it, off by default and on for Feather RP2040 ThinkInk. clean_sequence is accepted on every build. lag_frames raises ValueError where the drive is off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings every pixel to white, optionally runs clean_sequence, then drives every pixel frames updates each way. For scripts to remove ghosting while running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
release_displays() lost the owed drive and the stop sequence silently when something held the bus for the whole 30 s bound. Wait for the bus first, and raise with every display untouched, so the script can free it and try again. The end of the VM can't catch an exception, and doesn't need to: nothing can still hold the bus by then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wait used the whole deadline, so a panel a reset would free got no clean. Reset once, wait once more with no renewal, and run the stored waveform if BUSY falls. If it stays high, nothing more is sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 2, 2026
mikeysklar
marked this pull request as ready for review
November 2, 2026 20:18
The faster refresh options (write_previous_ram_command, keep_awake and update_refresh_mode's refresh_sequence) cost about 900 bytes, which no longer fits on several SAMD21 and SAMD51 boards. With the flag off, EPaperDisplay builds as it did before. Lag drive needs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 3, 2026
Collaborator
Author
|
Replaced by #11739, opened from an adafruit branch so the three PRs stack. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
E-paper drivers can update in about 50 ms and still drive every pixel equally both ways.
Why
Unbalanced fast updates can damage a panel.
The display now cleans itself after code ends, which a library can't do.
Part 2 of 3 toward GIF video on e-paper, after #11718 and before #11720. Runs without #11718.
lag_frames=NCIRCUITPY_EPAPERDISPLAY_FAST. On whereverepaperdisplayis, except atmel-samdCIRCUITPY_EPAPERDISPLAY_LAG, which needs Fast. Off by default, on for Feather RP2040 ThinkInk hereclean()supervisor.reload(),release_displays()Changes
update_refresh_mode(refresh_sequence=)write_previous_ram_commandkeep_awakestop_sequencegoes out on releaselag_framesseconds_per_frame=0clean_sequencelag_frames. Accepted without lag, so one driver works on any Fast buildclean(frames, full=)How code ends
KeyboardInterruptkeep_awakewithout lag, Ctrl-C mid-refreshrelease_displays()while the script holds the busmicrocontroller.reset(), safe mode, power loss, hard fault, watchdog resetbusyFalse after 30 s; nextrefresh()resets and cleans, or raisesTested
Feather RP2040 ThinkInk, 4.2" SSD1683, Ubuntu host. No camera on the final build, so BUSY and timing only.
CircuitPython 11.0.0-alpha.2 built from this branch, alone and with all 3 PRs.
keep_awakewithout lag, Ctrl-C mid-refreshkeep_awake, previous RAMTest files
Test driver:
ssd1683_lag.py(SSD1683 4.2", needs a lag build)Test code for this PR alone:
bm_lib.pyand the Ctrl-C caseSTUCKis the marker the test harness waits for before sending Ctrl-C.Results log for this PR alone
Panel safety
The
EPaperDisplaydocs now have a warning:keep_awake,write_previous_ram_commandandlag_framesallow updates much faster than panel makers' limits on refresh rate. Fast updates need a balanced waveform, and long-term wear on the panel is unknown. Lag drive keeps each pixel balanced, but there is no published lifetime data for this kind of driving.Open issues
0x7Fno-op follows each lag RAM write as a precautionupdate_refresh_modeQuestion for review
refresh()(this PR)refresh()blocks for the update, or forrefresh_timewith no BUSY pinrefresh()stays non-blockingfinish_refresh, or redraw the whole screenScope
Monochrome only.
AI assistance
Written with Claude Code.
🤖 Generated with Claude Code