The live session of this course has ended but stay tuned for online videos!

About the Instructor

Uri is a maker who loves voiding warranties; Currently building RP2040js, an open source Raspberry Pi Pico emulator in JavaScript, and working on Wokwi, an online Arduino simulation platform. Uri also instructed the AVR internals course in the previous session of HackadayU.

Course Overview

The Raspberry Pi Pico is a capable 4$ microcontroller board. It comes with a set of features that make it a great choice for many maker projects, including the programmable I/O (PIO), which makes it possible to support new protocols and implement custom peripherals.

This course will take you on a journey to explore the internals of the RP2040 chip, the brains of the Pico. We'll learn about the system architecture, hardware peripheral registers, and even the basics of the ARM assembly language.

The course will be intense and will walk you through the core principles behind the RP2040 chip. While we can't cover everything in a 5 hours course, you'll get the essential knowledge and links to resources that will help you keep rolling on your own. Expect to spend some time digging into the microcontroller's datasheet! 📚

Prerequisites / Resources

Software Requirements

Modern web browser (Chrome, Firefox, etc.). We'll use the online simulator at https://wokwi.com.

Optional: If you want to build the code on your machine then install the Pico SDK and get a fresh copy of pico-examples. You can find the installation instructions in Chapter 2 of the Getting Started Guide.

Hardware Requirements (optional):

The hardware is optional. We'll use the emulator during the course. But if you want to try things on the actual hardware (because it's always more fun!), here's what you need:

Syllabus

Class 1 - The Big Picture

We'll learn how the memory space is organized, explore the RP2040 bus fabric, become friends with the RP2040 datasheet, talk about the AHB-Lite bus and the APB bridge, and see how our C code can interact with the on-chip peripherals (such as GPIO and UART) by directly accessing the hardware registers.

Class 2 - Interrupts & Introduction to ARM Assembly

We'll cover hardware and software interrupts, the NVIC (Nested Vector Interrupt Controller), and the vector table, and of course - get our hands dirty writing some C code to demonstrate these concepts. Then we'll learn about the CPU registers, and start digging into ARM assembly.

Class 3 - Spiralling deeper

We'll continue exploring the ARM Cortex M0+ instruction set, learning about branches, flags, conditional instructions. We will also learn about the ARM assembly ABI (application binary interface) as we write our own routines in pure ARM assembly! 

Class 4 - Under the hood with GDB

We'll learn how to use GDB, the GNU Debugger, and see how we can harness its power for debugging and reverse engineering. We'll also dig into the internals of MicroPython and see how to combine it with Thumb assembly!

Class 5 - Hello, PIO

The Programmable Input/Output (PIO) is a unique feature of the RP2040 chip. It enables the creation of additional hardware interfaces, even ones that are not natively supported by the chip (WS2812B, I'm looking at you!). We'll learn how the PIO state machine works and see an example of programming it.


Final Project - Pi Pico PAL TV Pong

The deadline is July 15th. You'll need to create a new project page and make sure to tag your project with "PI-PONG".