Datasheet

Table Of Contents
3.3.9.3. hex
The hex generator only supports a single input program, as it just dumps the raw instructions (one per line) as a 4 bit
hexidecimal number.
Given:
Pico Examples: https://github.com/raspberrypi/pico-examples/tree/pre_release/pio/squarewave/squarewave.pio Lines 1 - 12
Ê1 ;
Ê2 ; Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
Ê3 ;
Ê4 ; SPDX-License-Identifier: BSD-3-Clause
Ê5 ;
Ê6
Ê7 .program squarewave
Ê8 set pindirs, 1 ; Set pin to output
Ê9 again:
10 set pins, 1 [1] ; Drive pin high and then delay for one cycle
11 set pins, 0 ; Drive pin low
12 jmp again ; Set PC to label `again`
The hex output produces:
Pico Examples: https://github.com/raspberrypi/pico-examples/tree/pre_release/pio/squarewave/generated/squarewave.hex Lines 1 - 4
e081
e101
e000
0001
3.4. Instruction Set
3.4.1. Summary
PIO instructions are 16 bits long, and have the following encoding:
Table 359. PIO
instruction encoding
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
JMP
0 0 0 Delay/side-set Condition Address
WAIT
0 0 1 Delay/side-set Pol Source Index
IN
0 1 0 Delay/side-set Source Bit count
OUT
0 1 1 Delay/side-set Destination Bit count
PUSH
1 0 0 Delay/side-set 0 IfF Blk 0 0 0 0 0
PULL
1 0 0 Delay/side-set 1 IfE Blk 0 0 0 0 0
MOV
1 0 1 Delay/side-set Destination Op Source
IRQ
1 1 0 Delay/side-set 0 Clr Wait Index
SET
1 1 1 Delay/side-set Destination Data
All PIO instructions execute in one clock cycle.
RP2040 Datasheet
3.4. Instruction Set 322