Datasheet

Table Of Contents
3.2.7. Interactions Between State Machines
The instruction memory is implemented as a 1-write 4-read register file, so all four state machines can read an instruction
on the same cycle, without stalling.
There are three ways to apply the multiple state machines:
Pointing multiple state machines at the same program
Pointing multiple state machines at different programs
Using multiple state machines to run different parts of the same interface, e.g. TX and RX side of a UART, or
clock/hsync and pixel data on a DPI display
State machines can not communicate data, but they can synchronise with one another by using the IRQ flags. There are 8
flags total (the lower four of which can be masked for use as system IRQs), and each state machine can set or clear any
flag using the IRQ instruction, and can wait for a flag to go high or low using the WAIT IRQ instruction. This allows cycle-
accurate synchronisation between state machines.
3.3. PIO Assembler (pioasm)
The PIO Assembler parses a PIO source file and outputs the assembled version ready for inclusion in a program.
pioasm currently supports output for the Pico SDK and MicroPython. See Section 3.3.9 for more details on the different
output generators.
3.3.1. Usage
A description of the command line arguments can be obtained by running:
pioasm -?
giving:
usage: pioasm <options> <input> (<output>)
Assemble file of PIO program(s) for use in applications.
<input> the input filename
<output> the output filename (or filename prefix if the output
Ê format produces multiple outputs).
Ê if not specified, a single output will be written to stdout
options:
-o <output_format> select output_format (default 'c-sdk'); available options are:
Ê c-sdk
Ê C header suitable for use with the Pico SDK
Ê python
Ê Python file suitable for use with MicroPython
Ê hex
Ê Raw hex output (only valid for single program inputs)
-p <output_param> add a parameter to be passed to the outputter
-?, --help print this help and exit
RP2040 Datasheet
3.3. PIO Assembler (pioasm) 313