DMA with multiple A/D channels #11350
-
I'm thinking about building a software defined radio using a Raspberry Pi Pico (plus oscillators and mixers). I'd process two input streams (I&Q) read from two A/D channels and use DMA to grab the signals from the A/D converter and store them in memory. The A/D converter will process channels in a round robin fashion, so if I'm using two channels the samples would be placed in adjacent memory locations: Is there any way to not interleave the data so that I have I in one array and Q in another? tia for your help, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
One way: You would have to set up 3 DMA channels. One for left, one for right, both from ADC to the different memory locations, 1-word transfer, not starting yet. The third channel would alternate between sending a trigger signal to the first and the second channel. This channel would be triggered by the ADC conversion. It should be feasible although I'm not sure about the third channel yet, perhaps you need a fourth channel to send the different DMA register addresses that the third channel targets to this channel. You have to consult the datasheet. |
Beta Was this translation helpful? Give feedback.
This was my first thought too. But then you would not only have to reprogram it after each A/D read to the two different memory locations but also to increase the counters within the respective arrays accordingly. Which you cannot achieve with DMA easily, provided you are not willing to set up an extra array containing only the respective addresses (A, B, A+1,m, B+1, A+2, ...).
We have quite a few DMA channels. So better have different channels for A and B, then the independent counting is solved. You need to trigger a read from ADC intermittently by DMA-A and DMA-B, which may be set up to happen wh…