DMA chaining with PIO as output #16508
-
Hello everyone! I'm trying to learn how to use DMAs with PIOs and I think Im missing something with the DMA -> PIO interface, as it looks like the PIO doesnt trigger the DMA that feeds into the PIO TX FIFO. The python code im running on the Pico W is here. There are two ways of running this script:
With test=True, the script is run with the buffer_dma -> sm0 link broken to check if the DMA chaining is set up OK and works on its own, and if the StateMachine is able to work with the StateMachine.put() function - ie testing the two components separately. They do work okay separately, but note that the buffer_dma needs to be reconfigured to work with the DREQ from the PIO, which I think is where Ive gone wrong... When I say they work, it means that the output buffer is populated correctly, and the correct thing is displayed on the LED Matrix. With test=False, the link between the buffer_dma and the StateMachine PIO is established, but it doesnt work, and Im getting the following symptoms:
To me it looks like the PIO is failing to request the buffer_dma for data. Is this a correct assumption and how can I improve the DMA / PIO configuration to sort this out? Any points or comments will be greatly appreciated! Here are the two buffer_dma set ups for both the test case and pio case directly copied from the code linked above.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
your treq_sel value of 4 appears to be the correct value for the RX channel of the PIO. zero would be correct for the TX side (which is what you are doing, it appears). |
Beta Was this translation helpful? Give feedback.
your treq_sel value of 4 appears to be the correct value for the RX channel of the PIO. zero would be correct for the TX side (which is what you are doing, it appears).