Raspberry Pi · SC0918
Raspberry Pi Pico W
Raspberry Pi Pico W: a Pico with an Infineon CYW43439 (Wi-Fi, Bluetooth).
In short
RP2040 board with Wi-Fi and Bluetooth (CYW43439): two 133 MHz Cortex-M0+ cores, 264 KB SRAM, 2 MB flash. No CAN controller: CAN goes through an MCP2515 on SPI0.
Specs
From the board’s model in the store.
- Processor
- RP2040 · 2× Cortex-M0+ · chip "rp2040"
- Clock
- 133 MHz
- Flash
- 2 MB
- RAM
- 264 KB
- GPIO pins
- 26
- ADC
- ADC 3 ch 12-bit
- Logic level
- 3.3 V
- Power
- 5 V USB or VSYS (in); 3V3(OUT), pin 36: 3.3 V (≤ 300 mA); VBUS, pin 40 (5 V from USB): 5 V
- Current per pin
- not in the board’s model yet
- Buses
- UART ×2, I²C ×2, SPI ×2, USB ×1
- Runs
- bare metal (no OS)
Pin map
Each pin by what it does. Hover or tap a pin to see what else it can be.
- Power 3
- Digital 9
- Analog 2
- Bus 15
- PIN_0GP0
- PIN_1GP1
- PIN_2GP2
- PIN_3GP3
- PIN_4GP4
- PIN_5GP5
- PIN_6GP6
- PIN_7GP7
- PIN_8GP8
- PIN_9GP9
- PIN_10GP10
- PIN_11GP11
- PIN_12GP12
- PIN_13GP13
- PIN_14GP14
- PIN_15GP15
- PIN_16GP16
- PIN_17GP17
- PIN_18GP18
- PIN_19GP19
- PIN_20GP20
- PIN_21GP21
- PIN_22GP22
- PIN_26GP26
- PIN_27GP27
- PIN_28GP28
- pwr5 V USB or VSYS
- v3v33V3(OUT), pin 36
- vbusVBUS, pin 40 (5 V from USB)
Watch out
What archec checks for this board, from its data. Each one names the check that catches it.
Its pins work at 3.3 V. A 5 V sensor’s output on one of them needs a level shifter between them.
check
pin-levelThe 3V3(OUT), pin 36 gives at most 300 mA at 3.3 V. Add up what you power from it.
check
board-currentIt gives 3.3 V (3V3(OUT), pin 36), 5 V (VBUS, pin 40 (5 V from USB)). Power each part from a rail at its own voltage.
check
board-supplyIt has 2 UART, 2 I²C, 2 SPI. One more bus of a kind than that is an error.
check
board-peripheralEach bus goes on the pins that can carry it (see the pin map). Another pin is an error.
check
pin-function
First model
A blink for this board: the board, an LED and a part that turns it over every 500 ms. archec checks it, then writes the code on the right.
project Blink "Blink" {
version "0.1.0"
edition "1.0"
uses arche-hw-store "^0.1"
}
include "arche-hw-store/boards/raspberry-pi-pico-w/raspberry-pi-pico-w.arche"
include "arche-hw-store/devices/led/led.arche"
/// Turns the LED over at each step.
component Blinker "Blinker" {
out led: requires Led
fn blink "Blink" {
```arche
led.toggle()
```
wcet 50us
}
}
/// The board, an LED on pin PIN_2, and the blinker.
system Hw "Blink" {
part board: RaspberryPiPicoW
part led: GpioLed { in pin { pins { pin PIN_2 } } }
part blinker: Blinker
blinker.led -> led.led
}
/// The firmware: the blinker every 500 ms.
deployment OnBoard "On the board" {
system Hw
platform Hw
binary blink on board {
thread main "Blink" { runs blinker; period 500ms; step blink }
}
}
//! Your code: the state and behaviour of this part. Write it between the USER CODE markers:
//! when the model changes, `archec gen` writes this file again around them (a new function, a
//! new input) and keeps them. Edit outside them and the file is yours: it is left as it is,
//! and the compiler says what to add (a new trait method).
#[allow(unused_imports)]
use crate::arche::*;
// @arche blinker main.arche:25 part
/// blinker
#[derive(Default)]
pub struct Blinker {}
impl BlinkerBehaviour for Blinker {
// @arche blinker.blink main.arche:13 fn
async fn blink(&mut self, _out: &BlinkerOut) {
// Blink: from the model (```arche)
_out.call_led_toggle().await;
}
}blink/src/app/blinker.rs, one of the 16 files archec writes.