Tutorial: Hello UART (EduRP2040)

Send and receive data over UART on the RP2040.

Pin mapping

SignalGPIOFunction
TXGP0UART0 TX
RXGP1UART0 RX

MicroPython

from machine import UART, Pin
from time import sleep

uart = UART(0, baudrate=115200, tx=Pin(0), rx=Pin(1))

while True:
    uart.write("Hello, UART!\r\n")
    if uart.any():
        data = uart.read()
        print("Received:", data)
    sleep(1)

Test from the host

Wire a USB-Serial adapter to GP0/GP1 (crossed) and open:

picocom -b 115200 /dev/ttyUSB0

Notes

  • Logic level is 3.3 V — never feed 5 V signals directly.
  • For debugging you can also print() to the USB console.

Next step

If you need wireless connectivity, jump to EduESP32-S3.

Comments

...