Skip to the content
2 layers50 × 55 mmQuadRS485pico, the printed circuit board in 3D

Implementing 4x RS485 using pipico PIO and DMA

Size
50 × 55 mm
Copper layers
2
Thickness
1.6 mm
Parts
23
Nets
45
Pads
171
Tracks, vias
172, 17
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
31 Aug 2023
Updated
19 Dec 2025

Overview

QuadRS485pico is an open-source printed circuit board by thomasfla, from the thomasfla/pico-pio-uart-dma-rs485 repository on GitHub, published under the BSD-3-Clause licence. It is a 2-layer board of 50 × 55 mm with 23 parts on 45 nets, routed with 172 tracks and 17 vias.

It is built around the DMG2301L. Its parts include 5 ICs, 5 connectors, 4 capacitors, 4 resistors and 1 transistor. It belongs with the interfaces and adapters boards and the RP2040 boards of this library.

Main components

1

README

README.md

pico-pio-uart-dma-rs485

Implementing multiple channel RS485 using Raspberry Pi Pico PIO and DMA. This was inteded for low latency comunication with robotics actuator and sensors.

  • For half-duplex RS485: only one device transmits at a time.
  • The OE (Output Enable) pin controls RS485 driver direction.
  • Supports multiple channels via separate PIO state machines.
  • Tested at high baud rates (12.5 Mbps and likely higher).
  • Waits for response with a configurable timeout.
  • End-of-frame detection based on silence (similar to Modbus).
  • Fully offloaded TX and RX: the CPU is not involved during transmission and reception of complete frames and responses.

Arduino Library

An Arduino-friendly packaging of this driver lives in arduino/PicoPioRs485/. Copy that folder into your Arduino libraries directory (or use Sketch → Include Library → Add .ZIP Library… from the IDE). The library exposes the RS485_Config/rs485_* helpers as well as a small PicoPioRs485 C++ class so sketches can begin(), queue a packet, send it, and wait for the optional response.

Bundled examples:

  • LoopbackMinimal: drives two PIO state machines on the same Pico so you can quickly wire a master/responder pair and watch the returned bytes over USB serial.
  • BaudRateSwitch: shows how to retune the RS485 link speed interactively from the serial monitor.

Both sketches are intentionally smaller and simpler than the original examples/basic/main*.c demos so you can focus on the Arduino APIs.

Building

Make sure you have the Pico SDK installed and initialized.

sh
mkdir build
cd build
cmake ..
make

Flashing

Option 1: Drag-and-drop UF2

  1. Hold the BOOTSEL button on your Pico and connect it to your computer via USB.
  2. Release the button. The Pico will appear as a USB drive.
  3. Copy the generated .uf2 file from build/examples/basic/ to the Pico drive.

Option 2: Using picotool

How It Works

Each RS485 channel uses a single PIO state machine to handle both reception and transmission in half-duplex. When we want to send a frame, we provide the data, the length of the frame, and the timeout to wait for a response. Everything else is handled automatically by the PIO and DMA.

First, the state machine takes care of transmitting the frame. It enables the driver (OE pin) during the send, then disables it when done. Right after that, it starts listening for a response. If a response comes in, the bytes are written directly into memory using DMA, without the CPU being involved. If there's no response, it waits until the timeout expires.

At any point, we can poll the state of the state machine to check if the transmission and reception are complete. We can also look at the DMA pointer to see how many bytes have been received. This way, the CPU only gets involved before and after the frame exchange.

Limitations:

  • At high baud rates, it is important that the PIO clock divisor is an integer or close to one. We can adjust the system clock to achieve that.

  • The PIO runs at 8 times the baud rate. For example, with a 200 MHz system clock, the baud rate is limited to around 25 MHz.

  • RX sampling uses non-blocking edge detection in the PIO to allow both timeout tracking and pin monitoring of a Start bit. This introduces a one-instruction jitter in the sampling time.

  • Currently, no interrupt is generated after transmission, but it should be easy to add one.

  • If the received frame is not a multiple of 32 bits, it will be padded with zeros before being sent to the DMA. We have no way to know the exact frame size, since it will be rounded up to the next multiple of 32 bits.

Parts

23
QtyValueFootprintReferences
4120Resistor_SMD:R_0603_1608MetricR1, R2, R3, R4
4CCapacitor_SMD:C_0603_1608MetricC1, C2, C3, C4
4Conn_01x02_PinConnector_Hirose:Hirose_DF13-02P-1.25DSA_1x02_P1.25mm_VerticalJ1, J2, J3, J4
4MountingHoleMountingHole:MountingHole_2.5mm_Pad_TopBottomH1, H2, H3, H4
4THVD2450DRBRLibrary:SON65P300X300X100-9NIC1, IC2, IC3, IC4
1Conn_01x06Connector_Hirose:Hirose_DF13-06P-1.25DSA_1x06_P1.25mm_VerticalJ7
1DMG2301LPackage_TO_SOT_SMD:SOT-23Q1
1PicoMCU_RaspberryPi_and_Boards:RPi_Pico_SMD_THU1

Similar boards

  • 4 layers70 × 72 mmSPINC AA Charger, the printed circuit board in 3D

    SPINC AA Charger

    CoretechR/SPINC

    DIY Automatic Battery Charger Using RP2040

    101 parts467GPL-3.0
  • 4 layers70 × 54 mmPicoLab, the printed circuit board in 3D

    PicoLab

    CoretechR/PicoLab

    Web-GUI Embedded Multitool

    285 parts327GPL-3.0
  • 2 layers192.4 × 50 mmOmote, the printed circuit board in 3D

    Omote

    OMOTE-Community/OMOTE-Hardware

    Open Source Remote - Hardware

    187 parts157GPL-3.0
  • 4 layers55 × 97 mmMelodio SelfMate V2, the printed circuit board in 3D

    Melodio SelfMate V2

    zeeblaze/Melodio-SelfMate

    Your Ultimate Portable Music Companion For Home Automation.

    121 parts53
  • 2 layers75.8 × 19.2 mm3S coinCellChargeController, the printed circuit board in 3D

    3S coinCellChargeController

    PocketConcepts/Pocket_PSU

    A variable current & voltage PSU with 3S lipo charging, balancing, and protection circuit using PPS.

    78 parts36
  • 2 layers51.8 × 51.8 mmPawpet, the printed circuit board in 3D

    Pawpet

    NanoCodeBug/pawpet

    A virtual pet using the atsamd21g and sharp memory lcd, runs off of 2xAAA for a couple of months. See PawPet on Hacakday.io for full gallery.

    41 parts20
  • 4 layers68.8 × 90.3 mmHorizon, the printed circuit board in 3D

    Horizon

    Horizon-Avionics/Horizon-H1

    Building a fully open-source flight computer for amateur rocketry!

    173 parts17
  • 2 layers69 × 72 mmMMv3, the printed circuit board in 3D

    MMv3

    MrCroesus/MMv3

    MMv3 is the 3rd generation robot platform used to teach the IEEE Micromouse DeCal at UC Berkeley. It was designed with usability, manufacturability, size, and cost in mind.

    47 parts16Apache-2.0

Questions

How big is the QuadRS485pico PCB?

It measures 50 × 55 mm and has 2 copper layers, 1.6 mm thick.

What parts does the QuadRS485pico use?

23 parts, built around the DMG2301L. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the QuadRS485pico KiCad files?

From the thomasfla/pico-pio-uart-dma-rs485 repository on GitHub, at the commit this page was made from: the board is hardware/quadRS485pico/quadRS485pico.kicad_pcb and its schematic hardware/quadRS485pico/quadRS485pico.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the QuadRS485pico design in my own project?

Its repository publishes it under the BSD-3-Clause licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).