It’s January 2021 and the awesome folks over at Raspberry Pi have announced a new device, a micro controller called the Raspberry Pi Pico. The full details / news about the device can be found at: https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/ . I grabbed one from the excellent Pimoroni and with speedy delivery from Royal Mail it arrived over the weekend.
Unlike the other current members of the Pi family the Pico is a micro controller and doesn’t have an interactive operating system, networking or a lot of storage (compared to the spacious microSD cards the other Pis can use). But wait – that’s the point! As a micro controller the Pico is designed to be a low powered device that runs microPython or C/C++ programs and be embedded. If you’ve used an Arduino then you’ve already used a micro controller. Unlike the Arduino, the Pico runs on Raspberry Pi’s own silicon chip, the RP2040 and it is very cheap to purchase. If your reading this post in January 2021 (or even early February 2021) then the Pico can be found free on the front cover of Hackspace magazine (issue 39 https://hackspace.raspberrypi.org/issues/39) – so purchasing the magazine gets you a free Pico!
The pico requires programming via a connection to another device, e.g. a Raspberry Pi or a Microsoft Windows / Apple Mac / Linux device. I’m using a Raspberry Pi and the Thonny (https://thonny.org/) IDE to program microPython for the micro controller.
The tech specs:
Dual-core Arm Cortex-M0+ @ 133MHz
264KB (remember kilobytes?) of on-chip RAM
Support for up to 16MB of off-chip Flash memory via dedicated QSPI bus
Interpolator and integer divider peripherals
30 GPIO pins, 4 of which can be used as analogue inputs
2 × UARTs, 2 × SPI controllers, and 2 × I2C controllers
16 × PWM channels
1 × USB 1.1 controller and PHY, with host and device support
8 × Raspberry Pi Programmable I/O (PIO) state machines
USB mass-storage boot mode with UF2 support, for drag-and-drop programming
The Pico generally comes pin less (some suppliers are apparently offering to solder the pins), so I purchased some pin headers and solder them on (using my poor soldering skills). Pimoroni are also offering accessories for the Pico (https://shop.pimoroni.com/products/raspberry-pi-pico#show-accessories) and I grabbed a Pico Display pack (https://shop.pimoroni.com/products/pico-display-pack). As the Pico is new and can be programmed in both microPython and C/C++ the accessories/examples for the device are still very new, so even though Pimoroni give an example for the display in microPython over at https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/examples/pico_display/demo.py , it didn’t (yet) include button or LED examples (from what I could see).
Not a problem though, that’s what curiosity is for. After some playing in Python I had the LEDs lighting up and able to change colours via button presses:
# imports the picodisplay import picodisplay as display # sets backlight. 0 is off, 1.0 is fully on display.set_backlight(1) #sets LED colour # 255,0,0 is red. # 0, 255, 0 is green. # 0, 0, 255 is blue. display.set_led(255, 0 , 0) while True: # button a = 0 # button b = 1 # button x = 2 # button y = 3 if display.is_pressed(0): display.set_led(255, 0, 0) if display.is_pressed(1): display.set_led(0, 0, 0) if display.is_pressed(2): display.set_led(0, 255, 0) if display.is_pressed(3): display.set_led(0 0, 255)
I’m hoping to come up with some ideas for using the Raspberry Pi Pico over the next few days.
Want more Pico information? Raspberry Pi have a detailed data sheet at https://datasheets.raspberrypi.org/pico/pico_datasheet.pdf , a datasheet on the rp2040 at https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf (it’s over 600 pages long!), and information on the microPython SDK at https://datasheets.raspberrypi.org/pico/sdk/pico_python_sdk.pdf .