Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

General • Re: Understanding Pico W shared GPIO with WiFi chip

$
0
0
Now, on Pico W, it seems that those 3 Pico GPIOs are connected to the WiFi chip GPIO. But for me is not making sense.
Perhaps these simplified diagrams will help -

For the original Pico ...

Code:

       o VBUS     o VSYS           o 3V3OUT       |          |       .-----.  | +V o--^--.--|>|--^--.----| REG |--^----o 3V3         .|.        .|.   `--.--'         |_|        |_|      `----------< GPIO23          Reg PWM          }          |          }----------|------------------> GPIO24          VBUS Present          |          |              __          |          }---.  .--|<|-|__|-< GPIO25          LED         .|.        .|.  |  |         |_|        |_|  `--|-----------> GPIO29 / ADC3   VSYS voltage          |          |      | 0V o-----^----------^------^-----------o 0V/GND
The Pico W modified this as follows ...

Code:

                        .---------------.      Reg PWM <--.  .---| WL_GPIO0  ON  |<---------------< GPIO23                 `--|---| WL_GPIO1  DIO |<>-------------<> GPIO24 VBUS Present >-----|-->| WL_GPIO2  CS  |<----.----------< GPIO25                    |   |           CLK |<----|------.--<> GPIO29 / ADC3          LED <-----'   `---------------'     |      |                             CYW43         .--^--.   |                                           |  \  |   | VSYS Voltage >----------------------------|-O O-|---'                                           `-----'
The clever part is in the use of GPIO29/ADC3 which is dual purpose, bi-directional, on the Pico W, plus the use of GPIO25 to enable VSYS voltage reading when the CYW43 is not enabled, when GPIO29 is used as the ADC3 input.

Can I still use the Pico W GPIO 23, 24, 25, like I was doing before, on non-WiFi Pico, if I don't activate the WiFi ?
Not really. And not activating on the CYW43 doesn't really help.

I still believe GPIO pins should have been virtualised with the introduction of the Pico W - so 'gpio_high(25)' would turn on the on-board LED whether it was a Pico or Pico W, whether a direct connection or via CYW43 - but neither the Pico SDK nor MicroPython did that.

My port of MicroPython allows code specifically written for the original Pico to run on the Pico W unchanged, but C code or vanilla MicroPython code may need to change to work. For MicroPython that means having to change 'Pin(25)' to 'Pin("LED")', for C code I believe it means having to call an entirely different function, adding '#if' or run-time 'if' determination to make the same code compatible on both.

Statistics: Posted by hippy — Wed Jan 01, 2025 4:09 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles