Skip to content

Interstate75 Duo Support & Firmware #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Interstate75 Duo Support & Firmware #30

wants to merge 28 commits into from

Conversation

Gadgetoid
Copy link
Member

@Gadgetoid Gadgetoid commented Apr 10, 2025

Nothing to see here... 👀

TODO

  • - Move driver and MicroPython bindings into this repo
  • - Brownout detection - ⚠️ NOTE: We're using a crude check for USB data present USB_SIE_STATUS_CONNECTED rather than smart brightness adaptation. It could be better...
  • - All the brightness 🔥
  • - Performance improvements
  • - Moar examples
  • - TEST TEST TEST - I2C, SPI (SDCard), buttons, LEDs

Crude Power Drop on USB Data

For posterity here's a hack which checks the "connected" bit of the USB SIE_STATUS register.

It should probably start low and raise the brightness if USB has not been detected after a timeout...

time.sleep(1.0)
if machine.mem32[0x50110000 | 0x50] & (0b1 << 16):
    USE_PALETTE = bytearray([int(c * 0.2) for c in list(PLASMA)])
else:
    USE_PALETTE = PLASMA

@Gadgetoid Gadgetoid force-pushed the feature/duo branch 2 times, most recently from 93ef7b0 to 8399528 Compare April 10, 2025 12:26
Gadgetoid and others added 21 commits April 10, 2025 13:40
Set OE pin on teardown- though I still end up in situations where LEDs are stuck on with a soft reset!
Stock clock update only from ~4.75ms to ~4.00ms.
Run PIO clock at div 1.0, faster clock = less flicker + probably also lower brightness.

Crank the brightness a little.

Some minor performance tweaks.
Spread the interlaced panel pixels across two "synced" state machines
on each PIO. Remove the need to manually interlace pixels, reduce the
PIO instruction count significantly, parallelise the shifting out of
pixel bits, remove the need for a dummy pixel, and so on...
Remove set_pixel/clear since we use PicoGraphics exclusively.

Remove features relating to alternate panel types and settings.
Move front to back buffer copy onto Core1.

Introduces the potential for tearing, but gives the user more time on Core0 for shinies.
Currently crashes on Core1, possibly due to stack overflow?
Not passing a PicoGraphics instance into the frame_convert callback seemed
to make Core1 happy. Reimplement the workaround as a blocking/non-blocking
option. Default to non-blocking since it's relatively easy to work with.
This is a crude stop-gap fix to the Duo browning out when connected to my MacBook.

Ideally we'd compute the gamma table on the fly and ramp up brightness until we see a voltage drop.

(This would also allow for fine-grained user brightness without losing fidelity.)
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.

2 participants