Download Print this page

Connecting From A Raspberry Pi Using Gpio - Raspberry Pi Pico Python SDK Manual

A micropython environment for rp2040 microcontrollers

Advertisement

Raspberry Pi Pico Python SDK
MPY: soft reboot
MicroPython v1.13-422-g904433073 on 2021-01-19; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>>
This key combination tells MicroPython to reboot. You can do this at any time. When it reboots, MicroPython will print out
a message saying exactly what firmware version it is running, and when it was built. Your version number will be different
from the one shown here.

2.2. Connecting from a Raspberry Pi using GPIO

The MicroPython port for RP2040 also allows the REPL to be accessed over a UART port, through two GPIOs. By default
on Raspberry Pi Pico this is on GPIO0 (TX, MicroPython output) and GPIO1 (RX, MicroPython input), and the speed is
115200 baud. This alternative interface is handy if you have trouble with USB, if you don't have any free USB ports, or if
you are using some other RP2040-based board which doesn't have an exposed USB connector.
NOTE
This initially occupies the
a second UART.
To connect, the first thing you'll need to do is to enable UART serial on the Raspberry Pi. To do so, run
$ sudo raspi-config
and go to
Interfacing Options
serial?" and "Yes" when asked "Would you like the serial port hardware to be enabled?" You should see something like
Figure
1.
Figure 1. Enabling a
serial UART using
raspi-config
on
the Raspberry Pi.
Leaving
raspi-config
You should then wire the Raspberry Pi and the Raspberry Pi Pico together with the following mapping:
Raspberry Pi
GND
2.2. Connecting from a Raspberry Pi using GPIO
UART0
peripheral on RP2040. The
Serial
and select "No" when asked "Would you like a login shell to be accessible over
you should choose "Yes" and reboot your Raspberry Pi to enable the serial port.
UART1
peripheral is free for you to use in your Python code as
Raspberry Pi Pico
GND
raspi-config
,
9

Advertisement

loading
Need help?

Need help?

Do you have a question about the Pico Python SDK and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Pico seriesPico 2