Hello Raspberry Pi Pico 2 (RP2350): first try MicroPython and CircuitPython

First try MicroPython/CircuitPython on Raspberry Pi Pico 2 (RP2350).


It's empty in fresh new Raspberry Pi Pico 2, it will power-up in Bootloader mode and RP2350 driver will appear as storage. 

Download firmware:

MicroPython:
- Visit https://micropython.org/download/RPI_PICO2/ to download MicroPython firmware for Pico2. Both normal RP2350 and RP2350-RISCV version are available.

CircuitPython:
- Visit https://circuitpython.org/board/raspberry_pi_pico2/ to download CircuitPython firmware for Pico 2 by Raspberry Pi.

To install MicroPython or CircuitPython firmware, simple drag the downloaded firmware (.uf2) to RP2350 driver.

To enter Bootloader mode:

Using BOOTSEL button:
Push and hold the BOOTSEL button as you plug your Pico 2 into your computer.

Using code:
If your Pico 2 have already been flashed MicroPython or CircuitPython, you can make it reboot in Boot load mode using code.

In MicroPython:

import machine
machine.bootloader()
In CircuitPython:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
microcontroller.reset()
Test code in the video:

hello_rp2_micropython.py
# Hello Raspberry Pi Pico 2 in MicroPython

import sys, os
from machine import Pin, Timer

print("=========================================================")
info = sys.implementation[0] + ' ' + os.uname()[3] + '\n' + \
       'run on ' + os.uname()[4]
print(info)
print("=========================================================")

led = Pin(25, Pin.OUT)
timer = Timer()

def blink(timer):
    led.toggle()
    
timer.init(freq=5.0, mode=Timer.PERIODIC, callback=blink)



hello_rp2_circuitpython.py
# Hello Raspberry Pi Pico 2 in CircuitPython

import sys, os
import time
import board
import digitalio

print("=========================================================")
info = sys.implementation[0] + ' ' + os.uname()[3] + '\n' + \
       'run on ' + os.uname()[4]
print(info)
print("=========================================================")

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.25)
    led.value = False
    time.sleep(0.25)


next:
I2C OLED (SSD1306/SSD1315) screen with Raspberry Pi Pico 2 (RP2350) using MicroPython
Raspberry Pi Pico 2/MicroPython display on SPI SSD1306 OLED


Comments

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

MicroPython/ESP32-C3 + 1.8" 128x160 TFT ST7735 SPI, using boochow/MicroPython-ST7735 library.