Synchronizing PIO and DMA with Micropython #17956
Answered
by
Lerc
JackCode0011
asked this question in
RP2040 / Pico
-
Beta Was this translation helpful? Give feedback.
Answered by
Lerc
Aug 19, 2025
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JackCode0011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The arrangement is a bit much to get my head around at a glance, but I'll say what I have been doing in case it helps.
I generally use a combination of treq_sel (bits 22:17 of dma cont), chaining and bocking PIO reads.
The docs say "The CTRL.TREQ_SEL (transfer request) field selects an external DREQ. It can also be used to select one of the internal
pacing timers, or select no TREQ at all (the transfer proceeds as fast as possible), e.g. for memory-to-memory transfers"
You can set the DMA control register to throttle based on
(2350 datasheet, I presume 2040 is the same with fewer options)
For some effects. such as interleaving bytes from two DMA you can setup multiple transfers with a le…