I'll try the idea of DMA transfer in 32 bit words, but only send out 16 bits at a time to the GPIOs. That won't require me to change the transpose function, since the DMA array will remain the same, just need to change the DMA config and the PIO.
I found that timing is not critical with WS2812b. The bit doesn't even have to be 1250uS!
As long as the 1 preamble is long enough but not too long that it gets interpreted as data. I know because I had problems of pixel flashing and thought it was a timing problem and tried different timing configurations. Problem turned out to be that I needed to add a 330 ohm resistor in series with each of the data lines, otherwise the combination of 16 rows of pixels caused leakage from pixels in the other rows.
I confess I didn't scope the entire bit chain going to the pixels for an entire "show" but rather took samples of 2 bit sequences when I was checking the timing issue because of the flashing. It was spot on from start of 1 preamble of one bit, to start of 1 preamble of the next bit.
But with pixels per row set to 30, I'll scope out what's sent to all 30 pixels in a row. Should be easy since new specs say there should be a minimum of 300uS of 0 between transmissions (old specs for older LEDs say 50uS) so I can set my trigger to trigger on a rise after a low of at least say 200uS.
Ideally one would not want any PIO stalling in the middle of a row transmission as then technically the pixel timing would be off. It should only stall when DMA has sent the entire array. Even if PIO is stalling, as long as it isn't more than a few uS, it would be OK.
You can find a snapshot of timings I saw with my scope in one of my previous topics when I was looking for help about the flashing.
I was seeing what seemed like excessive noise at the start of the data period, after the 1 preamble.
I found that timing is not critical with WS2812b. The bit doesn't even have to be 1250uS!
As long as the 1 preamble is long enough but not too long that it gets interpreted as data. I know because I had problems of pixel flashing and thought it was a timing problem and tried different timing configurations. Problem turned out to be that I needed to add a 330 ohm resistor in series with each of the data lines, otherwise the combination of 16 rows of pixels caused leakage from pixels in the other rows.
I confess I didn't scope the entire bit chain going to the pixels for an entire "show" but rather took samples of 2 bit sequences when I was checking the timing issue because of the flashing. It was spot on from start of 1 preamble of one bit, to start of 1 preamble of the next bit.
But with pixels per row set to 30, I'll scope out what's sent to all 30 pixels in a row. Should be easy since new specs say there should be a minimum of 300uS of 0 between transmissions (old specs for older LEDs say 50uS) so I can set my trigger to trigger on a rise after a low of at least say 200uS.
Ideally one would not want any PIO stalling in the middle of a row transmission as then technically the pixel timing would be off. It should only stall when DMA has sent the entire array. Even if PIO is stalling, as long as it isn't more than a few uS, it would be OK.
You can find a snapshot of timings I saw with my scope in one of my previous topics when I was looking for help about the flashing.
I was seeing what seemed like excessive noise at the start of the data period, after the 1 preamble.
Statistics: Posted by DanMan32 — Sun Jan 14, 2024 3:53 am