RP2040 - PIO and Bare Metal Programming - BMA06

Published at : 23 Dec 2025

RP2040 - PIO and Bare Metal Programming - BMA06

Join David for this very special crossover event where Bare Metal Adventures meets the PIO Chronicles. In this video, we will invoke Programmable Input Output while using Assembly language but WITHOUT using the SDK. We will also hand assembly the PIO code. This is great information for anyone who wants to really understand the workings of PIO down at the register level.

Raspberry Pi Pico Assembly Language Tutorial #06

Resources for this Chapter::

Demonstration files for this video:
https://github.com/LifeWithDavid/RaspberryPiPico-BareMetalAdventures/tree/b302bb1c77cc634b794022db65a2c67d33535ad1/Chapter%2006

Link to Register worksheet:
https://github.com/LifeWithDavid/RaspberryPiPico-BareMetalAdventures/blob/b302bb1c77cc634b794022db65a2c67d33535ad1/Chapter%2006/Register%20worksheet.pdf

Link to “Bare Metal Adventures, Chapter 04”:
https://youtu.be/nM8lVeOYblY

Link to “Bare Metal Adventures, Chapter 05”:
https://youtu.be/sBsCWpqmQfA

Link to “PIO Chronicles, Episode 4”:
https://youtu.be/7PDuECyrgX0

Link to “PIO Chronicles, Episode 7”:
https://youtu.be/zeudTftbTmw

Link to “PIO Chronicles, Episode 10”:
https://youtu.be/tRvs2kth6SA

Link to “PIO Chronicles, Episode 11”:
https://youtu.be/3HQbJIzLOak

Cortex-M0+ Generic User Guide: https://developer.arm.com/documentation/dui0662/latest/

ARMv6-M Architecture Reference Manual:
https://developer.arm.com/documentation/ddi0419/c/Application-Level-Architecture/

RP2040 Datasheet: https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf

Getting Started with the Raspberry Pi Pico: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

Emulator https://cpulator.01xz.net/?sys=arm-de1soc

ARM Assembly Language Tutorial: https://www.youtube.com/watch?v=gfmRrPjnEw4&t=621s

00:00 - Introduction
01:02 - PIO Review
03:15 - PIO Register Overview
03:44 - Our PIO Assembly Program - Getting Started
04:22 - Bringing the PIO out of reset
06:19 - Hand compiling the PIO Instructions
11:18 - Loading the PIO Instructions
13:29 - Setting up the PIO output pins
17:24 - Setting the State Machine Clock Frequency
18:31 - PIO program Wrap Bottom and Wrap Top
19:52 - Restarting and Enabling the State Machine
21:27 - Putting it all together
22:31 - Closing

Music:
(Pinnacle 25 royalty-free music):
Pulsing Dance
City Night Groove