pio_encode_wait_gpio does not respect gpiobase=16 #2377

Closed
opened 2025-03-27 10:30:58 -05:00 by qdotme · 2 comments
qdotme commented 2025-03-27 10:30:58 -05:00 (Migrated from github.com)

Consider the following (equivalent) blocks - one stalling on PIO, one on SIO. Got it to working by manually substracting the 16 from the GPIO pin number (pin_vsync = 45 in my design).

The PIO is correctly configured for supporting gpio_base=16, compiling the pioasm instructions correctly - but not when generated through pio_encode_wait_gpio

#if 1
pio_sm_exec(config->pio, config->pio_sm, 
	pio_encode_wait_gpio(1, config->pin_vsync - 16));
#else
while (gpio_get(config->pin_vsync) == 0);
#endif 
Consider the following (equivalent) blocks - one stalling on PIO, one on SIO. Got it to working by manually substracting the 16 from the GPIO pin number (pin_vsync = 45 in my design). The PIO is correctly configured for supporting gpio_base=16, compiling the pioasm instructions correctly - but not when generated through `pio_encode_wait_gpio` ``` #if 1 pio_sm_exec(config->pio, config->pio_sm, pio_encode_wait_gpio(1, config->pin_vsync - 16)); #else while (gpio_get(config->pin_vsync) == 0); #endif ```
kilograham commented 2025-03-27 11:16:48 -05:00 (Migrated from github.com)

I guess this is really a documentation issue

Worth looking at any similar functions and see if it is worth adding a variant which takes a PIO instance

I guess this is really a documentation issue Worth looking at any similar functions and see if it is worth adding a variant which takes a PIO instance
kilograham commented 2025-07-25 09:45:48 -05:00 (Migrated from github.com)

fix merged into develop; will be in next docs release

fix merged into develop; will be in next docs release
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#2377
No description provided.