Before anyone says it, I have moved UART0 output that SDIO uses by default over to GPIO pins 16/17.
Even if I hadn't and that was the issue, I would have seen GPIO0/1 not work for PIO for the example's original 2 strips.
Just to be sure all the GPIO pins are assigned to PIO, I added this to the main.c just below the DMA init:
for (int k=0; k<16; k++){
int f= gpio_get_function(k);
printf("Pin %u is in mode %u, expect 6 (GPIO_FUNC_PIO0) \n", k,f);
}
It confirmed mode is 6 for all pins.
I haven't figured out how to check pindir or gpio mapping within main.c.
I also tried 'set pindir 31 at the start of the PIO code before the .wrap_target. That made no difference to GPIO0 (only had 14 strips defined at that time) but instead caused GPIO pins 5-6 to go dead. I realized later that set pindir can only control direction of 5 pins, since the destination field is only 5 bits wide, so seemed strange that pins 5-6 went dead.
Even if I hadn't and that was the issue, I would have seen GPIO0/1 not work for PIO for the example's original 2 strips.
Just to be sure all the GPIO pins are assigned to PIO, I added this to the main.c just below the DMA init:
for (int k=0; k<16; k++){
int f= gpio_get_function(k);
printf("Pin %u is in mode %u, expect 6 (GPIO_FUNC_PIO0) \n", k,f);
}
It confirmed mode is 6 for all pins.
I haven't figured out how to check pindir or gpio mapping within main.c.
I also tried 'set pindir 31 at the start of the PIO code before the .wrap_target. That made no difference to GPIO0 (only had 14 strips defined at that time) but instead caused GPIO pins 5-6 to go dead. I realized later that set pindir can only control direction of 5 pins, since the destination field is only 5 bits wide, so seemed strange that pins 5-6 went dead.
Statistics: Posted by DanMan32 — Sun Dec 24, 2023 12:18 am