Hi guys,
I come here to present a problem I had with the example project for the Raspberry Pi pico microcontroller. Using a PICO W as Target I noticed that the board’s LED did not blink, however when I used the PICO without W the LED blinked.
After some research I noticed that on the pico W board the pin that is connected to the LED is not the same but a pin on the chip responsible for Wi-Fi.
Below is the modification I made to use an external LED, I changed it from pin 25 to pin 22.
void main(void)
{
RESETS->RESET = RESETS->RESET & ~0x00000020lu; // take IO_BANK0 out of Reset
PSM->FRCE_ON = PSM->FRCE_ON | 0x00000400; // make sure that SIO is powered on
SIO->GPIO_OE_CLR = 1ul << 22;
SIO->GPIO_OUT_CLR = 1ul << 22;
PADS_BANK0->GPIO22 = 0x00000030;
IO_BANK0->GPIO22_CTRL = 5;
SIO->GPIO_OE_SET = 1ul << 22;
init_time();
for (;;) {
// uint8_t data = 23;
SIO->GPIO_OUT_SET = 1 << 22;
// Delay
delay_us((10 / 1 * 60) * 1000);
SIO->GPIO_OUT_CLR = 1 << 22;
// Delay
delay_us((10 / 1 * (100 - 60)) * 1000);
}
}