RP2040 and RP2350 notes

From Helpful
Jump to navigation Jump to search

⚠ This is for beginners and very much by a beginner / hobbyist

It's intended to get an intuitive overview for hobbyist needs. It may get you started, but to be able to do anything remotely clever, follow a proper course or read a good book.


Some basics and reference: Volts, amps, energy, power · batteries · resistors · transistors · fuses · diodes · capacitors · inductors and transformers · ground

Slightly less basic: amplifier notes · varistors · changing voltage · baluns · frequency generation · Transmission lines · skin effect


And some more applied stuff:

IO: Input and output pins · wired local IO · wired local-ish IO · ·  Various wireless · 802.11 (WiFi) · cell phone

Sensors: General sensor notes, voltage and current sensing · Knobs and dials · Pressure sensing · Temperature sensing · humidity sensing · Light sensing · Movement sensing · Capacitive sensing · Touch screen notes

Actuators: General actuator notes, circuit protection · Motors and servos · Solenoids

Noise stuff: Stray signals and noise · sound-related noise names · electronic non-coupled noise names · electronic coupled noise · ground loop · strategies to avoid coupled noise · Sampling, reproduction, and transmission distortions

Audio and video notes: See avnotes

Platform specific: : Microcontroller and computer platforms ·· Arduino and AVR notes · ESP series notes · STM32 series notes · Teensy series notes · RP2040 and RP2350 notes


Less sorted: USB notes · Ground · device voltage and impedance (+ audio-specific) · electricity and humans · Soldering · landline phones · pulse modulation · PLL · multimeter notes · signal reflection · Project boxes · resource metering · Radio and SDR · vacuum tubes · Unsorted stuff · 'E-fuse'

Some stuff I've messed with: Avrusb500v2 · GPS · Hilo GPRS · JY-MCU · DMX · Thermal printer ·

See also Category:Electronics.


RP2040 notes

PWM notes

PIO notes

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.


PIO describes what amounts to multiple separate but extremely simple cores that are tied to GPIO.


There are only nine instructions, and this limits your options, mostly to a state machine. Mostly usable to push data through, quickly, with well-controlled timing.


There are multiple such cores -- apparently blocks of four (two such blocks in the RP2040, three in the RP2350) which matters in that each block shares

instruction memory,
four read ports (which allows some parallel access without blocking)

They cannot communicate data with each other, but they can synchronize (down to the cycle?(verify)) using interrupts, so they can still coordinate to output something more complex.

As it's programmable, you could see it as hardware bit-banging, but without the usual limitation of poor timing and high use of CPU (or interrupts necessarily).


It seems the designers figured we don't need as many dedicated peripherals when we have these - it's already been seen to used to talk

more UART
more I2C
more SPI
I2S
neopixels
small LCD panels
VGA,
Arbitrary waveform generator [1]
additional USB
a logic analyser


---


Programmable IO [2]


Each such state machine contains:

input FIFO, output FIFO (each four 32-bit)
to communicate to CPU, DMA, etc.
configurable so that if you only need one direction you can effectively double the size
PC register
two scratch registers (32 bit)
conditions are based on these
two shift registers (32 bit), in and out
connected to the FIFOs (towards the CPU)
can read from GPIOs - and multiple at once
clock divider
IRQ
alerting CPU
syncing state machines
eight flags, four of which are exposed to the CPU


each instruction takes one cycle
though each instruction can request up to 31 clocks of idle (takers 5 bits of each 16-bit instruction)
and WAIT has the job of stalling until a condition is met
flexible mapping to GPIO pins
input, output, set, sideset


Docs: https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html

Interpolator notes

RP2350 notes