new sample modules for rp2: ieee488, DMA/PIO extended neopixels, and a compressing bus analyzer #16520
Unanswered
mendenm
asked this question in
RP2040 / Pico
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am finally getting around to posting some of the useful bits of code I have written in the past year or so. They are on github, at:
https://github.com/mendenm/rp2_micropython_tricks
The modules are:
data_compressing_analyzer, which is a PIO-based bus analyzer that transmits back only changes in pins being monitored, with timestamps. Thus, it can operate at high time resolution (clock frequency / 11, at best), but not overflow memory with idle, identical words waiting for the next transition
ieee488, an implementation of the ieee-488 (GPIB) protocol using the PIO. I have tested this directly wiring a single IEEE-488 power supply to an RP2040, with no intervening components. It violates all kinds of formal bus loading and driving rules, but seems to work fine. The pull-up current from the device seems to not overload the protective diodes in the CPU, so the 5V -> 3.3V mismatch doesn't seem harmful. I wouldn't attach multiple IEEE-488 devices to a single CPU, though, or current limits (both sourcing and sinking) may be exceeded.
rp2_neopixel, a greatly extended neopixel driver, using PIOs and DMA, to allow a neopixel string to be dynamically updated with almost no CPU load. It automatically handles 3-color RGB, 4-color RGBW, and single-color (all white) strings. It can automatically multiple-buffer outputs, so you can be writing data to a buffer, which the previous buffer is being transmitted via the DMA channel. This allows a wide variety of asyncio and synchronous approaches to handling long strings (thousands) of neopixels, and allows multiple string to be supported.
Beta Was this translation helpful? Give feedback.
All reactions