Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8082

General • Re: Infinite read data from PIO using DMA

$
0
0
On RP2350, yes there's a special flag bit for this. On RP2040, not directly.

The solution on RP2040 is to use two channels, with two possible approaches:

1) Both channels are programmed to do the actual data moving task, and chain to each other when the transfer count expires. This requires that the channels don't require any re-configuring before running again - maybe by using ring mode, or for cases where the addresses don't increment (like copying from one PIO channel to another).

2) The first channel moves the data and chains to the second one which re-loads the first one (with the last word being written to a 'trigger alias' of the first one's control registers so that it starts again - NB. to avoid races do it this way rather than using chain-to for the 2nd channel to start the 1st).

Your case probably wants option 2. If you want to move 10 words each time, then the transfer count will re-load itself and only the write address needs reloading by the second channel. So the second channel setup just moves one word, from a variable in RAM that you've initialised in advance to the buffer address, to the WRITE_ADDR_TRIG register of the first channel.

Statistics: Posted by arg001 — Sat Apr 12, 2025 4:54 pm



Viewing all articles
Browse latest Browse all 8082

Trending Articles