kjagiello / hub75-pio-rs

HUB75 driver for RP2040. Uses PIO and DMA to achieve high refresh rate and high color depth with zero CPU overhead.
https://docs.rs/hub75-pio
MIT License
13 stars 8 forks source link

Displays above 64x32 #5

Open danjenkins opened 3 weeks ago

danjenkins commented 3 weeks ago

Whats stopping this module from supporting larger modules?

I have a 64x128 display that works great on my interstate75w from pimoroni using micropython so there isnt a limit from the hardware...

mortenbentsen commented 1 week ago

I actually made the necessary modifications to make it work with hub75e panels (added the extra 'E' address line etc.) last summer, but never got around to sending a PR. I'll try to look into it shortly!

mortenbentsen commented 1 week ago

Found it, but went too deep down a rabbit hole while trying to transfer frames via SPI in various ways. Forgot to commit with only the hub75e changes, but to summarize while I'm still sufficiently caffeinated/medicated:

Wherever you initialize your matrix, add this line directly after addra/b/c/d: addre: pins.gpio10.into_function().into_pull_type().into_dyn_pin(), (obviously change the gpio number to suit your case, but keep in mind the pins must be consecutive for the pio SM to work correctly)

And in lib.rs:

Or just take a look at my fork, examples/hub75e and src/lib.rs

PS: Probably don't just copy the entire lib.rs from my fork, I (or, Copilot to be frank) have more than likely done something stupid in the SPI-rabbit-hole. Lets just say I'm not entirely comfortable in rust... 😂

danjenkins commented 1 week ago

Thanks for this! Micropython on the i75w leaves very little memory actually available so I was super curious about using rust and whether it would give me better memory usage so this gives me a chance to go test it out

mortenbentsen commented 1 week ago

Well, during my SPI ventures, I tried allocating a new buffer of 256x64x3 bytes to hold an entire frame's worth of regular RGB888 pixels, aka not-in-correct-format-for-the-PIOs-pixels, and the poor pico went all angry and panicky on me 😂.

Considering hub75-pio-rs already had allocated two buffers of almost 100k for its internal framebuffers, I'm not really surprised. Maybe I should've transferred the frames in smaller chunks. Or maybe I'm better off if I just bite the bullet and buy either ElectroDragon or adafruit's HAT/Bonnet... 🙃