Is there a fast way (using DMA) to "interleave" two sequences of data that come from two separate PIO SMs or are in two separate RAM buffers?
In practice, every two 16-bit values need to be mixed into a 32-bit value: short a[], b[]; and the goal is to get a series like a[0], b[0], a[1], b[1], a[2], b[2], etc. The problem is that I can't think of a way to make DMA not write every other 16 bits in a 32 bit word.
EDIT: Maybe the cleanest way would be to have one DMA channel reconfigure and restart the main transfer DMA channel to once read from one PIO SM and then from the other and back again.
In practice, every two 16-bit values need to be mixed into a 32-bit value: short a[], b[]; and the goal is to get a series like a[0], b[0], a[1], b[1], a[2], b[2], etc. The problem is that I can't think of a way to make DMA not write every other 16 bits in a 32 bit word.
EDIT: Maybe the cleanest way would be to have one DMA channel reconfigure and restart the main transfer DMA channel to once read from one PIO SM and then from the other and back again.
Statistics: Posted by wisi — Fri Aug 22, 2025 6:17 pm