An Introduction to RP2040 PIO with CircuitPython Created by Jeff Epler
Last updated on 2021-06-01 03:20:06 PM EDT Guide Contents
Guide Contents 2 Overview 3 Major differences between adafruit_pioasm and standard pioasm 3 .wrap and .wrap_target are not supported 3 mov operator restrictions 4 Expressions are not supported 5 Products 7 Installing CircuitPython 8 CircuitPython Quickstart 8 Flash Resetting UF2 9 Installing Mu Editor 11 Download and Install Mu 11 Using Mu 11 Installing Libraries 13 Using PIO to turn an LED on and off 14 Code Walkthrough 15 Using PIO to control LED brightness 18 Code Walkthrough 19 Using PIO to blink a LED quickly or slowly 22 Code Walkthrough 23 Using PIO to drive a NeoPixel 26 Parts 26 Full Code Listing 27 Code Walk-through 27 API Documentation: adafruit_pioasm 30 API Documentation: rp2pio 31
© Adafruit Industries https://learn.adafruit.com/intro-to-rp2040-pio-with-circuitpython Page 2 of 32 Overview
A feature that sets the Raspberry Pi Foundation RP2040 microcontroller apart from other microcontrollers is "PIO". The RP2040 datasheet says that the "programmable input/output block (PIO) is a versatile hardware interface. It can support a variety of IO standards… PIO is programmable in the same sense as a processor."
In this guide, you'll learn how to write and use PIO programs from CircuitPython. The official datasheet (https://adafru.it/QLC) (chapter 3), the book "Get Started with MicroPython on Raspberry Pi Pico" (https://adafru.it/QLD) and pico-examples (https://adafru.it/Qa2) (pio folder) are helpful resources too, but CircuitPython sometimes deviates from the way that PIO is used in other environments like C or MicroPython.