RPi Pico - use DMA to pass data to PIO repeatedly #11081
Replies: 2 comments 13 replies
-
You can configure DMA to repeat transmitting the same data to PIO over and over. There are a few PR ofr adding a DMA class to the RP2 port. A while ago I had made a few examples using DMA with PIO. https://github.com/robert-hh/RP2040-Examples/tree/master/rp2_util. These transmit once, but can easily extended to repeat. The driver uses viper code, which is more natural to deal with the hardware directly. |
Beta Was this translation helpful? Give feedback.
-
Probably too late but I wrote 2 years ago a simple VGA driver for micropython on the PICO using PIO and DMA. Synchronization between PIO and DMA is achived using PIO Irqs. This might provide you with interesting examples. Repo on Github here Link here in the old micropython forum Hugh |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I wonder if there is a way to configure DMA (using utypes..) in a way that would allow me to pass same set of bytes to the PIO OSR register repeatedly - e.g. as in case of HDMI, VGA out, imagine there is a memory block (framebuffer) that needs to get sent to the PIO again and again.. - without the CPU's interception, any need to reset anything when the frame gets sent, simply start over and send bytes again..
-- in my case, it is just a couple of bytes, but with uPy, I'd really prefer not to check DMA current write registers repeatedly to ensure I reset them to the start of the memory block when the block is all sent to the PIO (
-- yes, I can allocate a rather large block that will have the same sequence copied many times to lower number of required DMA resets in time, but anyway..
-- and the problem is - to reset registers at the correct moment, which is almost impossible to achieve given the update speed of PIO vs low speed of uPy - even if I tested in a loop, I might be unable to reset the DMA fast enough to avoid timing glitches..
-- therefore - would there be some way to configure DMA to pass the same block of bytes to PIO repeatedly?
Thank You!
Stepan
Beta Was this translation helpful? Give feedback.
All reactions