I see. Some weeks back, when I was investigating about the RP2040's interpolator, somewhere i read that even the DMA could be used with the interpolator to generate LUTs without participating any core. It might be a misread though, because once checked the section 2.3.1 as you suggested, It is clear that the SIO can only be accessed by any of the CPU cores, the DMA is out of the party then.
This means that the strategy for a fast PDM must be pointed differently. One of the cores should make up a 32 bits value consisting of a piece of the sequence for 32 cycles, and this must be generated before 32 cycles has passed so the CPU can put that value to the PIO in order to serialize it.
I think i would add an accumulation of X<<5 and check how many times the accumulator has overflown, then use a small LUT of 32 word values*. But, the initial value of the accumulator should control how many bits the value retrieved from the table must be rotated (i must do some checks if this approach is correct), and all of this must be done within 32 arm M0+ cycles. Quite challenging, but probable doable.
*For example, if the accumulator has overflown two fold, then Tab[2]=0b00000000000000010000000000000001=0x00010001, but the eventual value, depending on the initial value of the accumulator before the new calculation, could be 0x00020002, 0x80008000, 0x01000100...
This means that the strategy for a fast PDM must be pointed differently. One of the cores should make up a 32 bits value consisting of a piece of the sequence for 32 cycles, and this must be generated before 32 cycles has passed so the CPU can put that value to the PIO in order to serialize it.
I think i would add an accumulation of X<<5 and check how many times the accumulator has overflown, then use a small LUT of 32 word values*. But, the initial value of the accumulator should control how many bits the value retrieved from the table must be rotated (i must do some checks if this approach is correct), and all of this must be done within 32 arm M0+ cycles. Quite challenging, but probable doable.
*For example, if the accumulator has overflown two fold, then Tab[2]=0b00000000000000010000000000000001=0x00010001, but the eventual value, depending on the initial value of the accumulator before the new calculation, could be 0x00020002, 0x80008000, 0x01000100...
Statistics: Posted by Sacodepatatas — Fri Feb 07, 2025 10:41 pm