hacking the RP2040

title.dio

Agenda

  • Kurzvorstellung der features des Boards

  • gemeinsames Aufsetzen der Entwicklungsumgebung

  • Umsetzung eines ersten "Hello-World" Beispiels

  • Sammlung von weiteren Ideen

  • Coden

Vorgeschichte

badger

Über den RP2040

01 Pico W Original Pico 012021

Features

Raspberry Pi Pico is a low-cost, high-performance microcontroller board with flexible digital interfaces. Key features include:

  • RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom

  • Dual-core Arm Cortex M0+ processor, flexible clock running up to 133 MHz

  • 264kB of SRAM, and 2MB of on-board flash memory

  • USB 1.1 with device and host support

  • Low-power sleep and dormant modes

  • Drag-and-drop programming using mass storage over USB

  • 26 × multi-function GPIO pins

  • 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels

  • Accurate clock and timer on-chip, Temperature sensor

  • Accelerated floating-point libraries on-chip

  • 8 × Programmable I/O (PIO) state machines for custom peripheral support

(Quelle: raspberrypi.com)

Vergleich mit Arduino Uno und Nano

Raspberry Pi Pico

Arduino Uno Rev 3

Arduino Nano

Controller

RP2040

ATmega328P

ATmega328

Taktfrequenz

133MHz

16MHz

16MHz

Cores

2

1

1

SRAM

264KB

2KB

2KB

Betriebsspannung

3,3V

5V

5V

GPIOs*

30

20

22

Maße (LxB) mm

51,3 x 21

53,4 x 68,6

69 x 53

USB-Anschluss

Micro-USB

USB-A

Micro-USB

Programmiersprache

Micro- CircuitPython

Arduino-Sketch

Arduino-Sketch

WiFi

Nein, nur über Shields

Nein, nur über Shields

Nein, nur über Shields

Bluetooth

Nein, nur über Shields

Nein, nur über Shields

Nein, nur über Shields

Preis

Um die 4-5 Euro

Um die 20 Euro

Um die 14 Euro

Vergleich mit ESP32 und D1 Mini

Raspberry Pi Pico WESP32 NodeMCUD1 Mini ESP8266

Controller

RP2040

ESP-WROOM-32

32-bit Xtensa L106

Cores

2

2

1

SRAM

264KB

520KB

96kB

Betriebsspannung

3,3V

3,3V

3,3V

GPIOs*

30

30

10

Maße (LxB) mm

51,3 x 21

25.4 x 48.3

34.2 x 25.6

USB-Anschluss

Micro-USB

Micro-USB

Micro-USB

Programmiersprache

Micro- CircuitPython

Micro- / CircuitPython Arduino Sketch

Micro- / CircuitPython Arduino Sketch

WiFi

Ja

Ja

Ja

Bluetooth

Ja*

Ja

Ja

Preis

Knapp 7 Euro

Knapp 7 Euro

Knapp 5 Euro

Und der Tufty?

tufty 2040 3 1500x1500

Features

  • 2.4" colour IPS LCD display (320 x 240 pixels)

    • Connected via parallel

    • Dimmable backlight (adjustable via PWM)

  • Powered by RP2040 (Dual Arm Cortex M0+ running at up to 133Mhz with 264kB of SRAM)

  • 8MB of QSPI flash supporting XiP

  • Phototransistor for light sensing

  • Five front user buttons

  • Power and boot buttons (the boot button can also be used as a user button)

  • White LED

  • USB-C connector for power and programming

  • JST-PH connector for attaching a battery (input range 3V - 5.5V)

  • High-precision voltage reference for battery level monitoring.

  • Qw/ST (Qwiic/STEMMA QT) connector

Aufsetzen der Entwicklungsumgebung

screenshot

Blinkenlights

from machine import Pin
from picographics import PicoGraphics, DISPLAY_TUFTY_2040
from time import sleep

# turn LED on and off

led = Pin(25, Pin.OUT)
led.value(1)
sleep(1)
led.value(0)
Hdl

"Hello World" Console Version

# Console Input and Output
name = input("you name: ")
print ("Hello "+name)
hello world

"Hello World" Display Version

# write Text on Display
display = PicoGraphics(display=DISPLAY_TUFTY_2040)

WHITE = display.create_pen(255, 255, 255)

display.set_pen(WHITE)
display.text("Hello JavaLand!", 0, 0, 320, 4)
display.update()
Monitor Final 2

Ideen-Sammlung!

  • Konferenz-Badge mit QR-Code

  • Abfahrtsanzeige eines Bahnhofs

  • JUG-DA Raffle

  • Pomodoro-Timer für Produktivität

  • Umsetzung eines Video-Spiels

  • Grafikdemo?, Doom?

  • was mit USB? OTP?

Repository

Du hast was cooles gecoded? Dann schick uns einen PR!