Kurse › Raspberry Pi › Stufe 26
Raspberry Pi · Intermediate · Stufe 26 / 40
Pico C SDK and Programmable I/O
Write fast, deterministic firmware in C and build custom hardware interfaces with PIO.
Intermediate freischalten · CHF 19.90 Stufen 14–26, einmalig, kein Abo
10 Lektionen in dieser Stufe
- Setting Up the Pico C SDK Toolchain and CMake
Install the compiler and SDK and build a project from the command line. · Lab: Build and flash the blink example from your Pi using CMake. - C for Python Programmers: Types, Pointers and Headers
Read and write the C constructs the SDK relies on. · Lab: Port a small MicroPython script to C with stdio output over USB. - Interrupts, Alarms and Repeating Timers in C
Schedule precise periodic work and keep interrupt handlers short. · Lab: Generate a 1 kHz tick and measure its jitter with a logic analyzer. - PIO State Machines Explained Instruction by Instruction
Describe the nine PIO instructions, shift registers and clock dividers. · Lab: Hand-trace a square-wave PIO program and predict its frequency before running it. - Writing a PIO Program for WS2812 LEDs
Generate tight timing waveforms that software loops cannot. · Lab: Drive an LED ring from PIO and verify bit timing on a logic analyzer. - Counting Quadrature Encoders in PIO
Capture fast inputs without losing counts. · Lab: Count a motor encoder at full speed and compare with a GPIO-interrupt counter. - Moving Data with DMA
Stream samples between peripherals and memory with no CPU involvement. · Lab: Capture a burst of ADC samples through DMA and print the buffer. - Using Both Cores Safely
Split work across two cores and share data without races. · Lab: Run the control loop on one core and communication on the other using a queue. - Debugging over SWD with a Debug Probe and GDB
Halt, step and inspect firmware on the chip. · Lab: Set a breakpoint in the control loop, inspect variables and catch a hard fault. - Designing a Register-Style I2C Peripheral
Make the Pico behave like a well-documented I2C chip. · Lab: Implement setpoint, speed and status registers and read them from the Pi with smbus2.
Abschlussprojekt
A motor-control co-processor: a Pico that counts a quadrature encoder in PIO, runs a 1 kHz speed loop in C and exposes setpoint and status registers to the Pi over I2C.
Teile für diese Stufe
- 2 × Raspberry Pi Pico or Pico 2 with headers
- 1 × Debug probe for SWD
- 2 × Micro-USB cable
- 1 × Breadboard and jumper wire set
- 1 × Addressable RGB LED ring or strip (WS2812B)
- 1 × DC gear motor with quadrature encoder
- 1 × Dual H-bridge motor driver
- 1 × USB logic analyzer 8-channel
- 1 × Raspberry Pi 5 or Pi 4 set from Level 1 as build host
In jeder Lektion legst du die passenden Teile direkt in den Warenkorb. Raspberry Pi →
Voraussetzung: Level 25: Pico basics. Helpful: any earlier exposure to C syntax; the level introduces what it needs.