Scripting with ZoomIO

ZoomIO is a scripting language that allows sub nanosecond precision control of the GPIO. Its very high level but produces native ARM assembly in the correct way to ensure design time determinism.

To achieve precise determinism, native code runs in the second CPU core of the rp2040 and takes advantage of single cycle IO and the zero latency CPUs dedicated scratch 4K ram.

The IOApp integrates the ZoomIO compiler. You can simply write the source file and download to the scripts directory. The Free Wili will determine which engine to target based on the file extension. The ZoomIO source files have the extension zio.

The code below illustrates a simple ZoomIO program. The pin is generating a waveform on pin 27 with nanosecond control of the waveform.


setio(27, 1)
delay(2000)
setio(27, 0)
delay(1000)
setio(27, 1)
delay(2000)
setio(27,0)

The ZoomIO commands are executed in a sequence. The following commands are currently supported.

Command
Arguments
Notes

setio

(arg 1) Io pin (arg2) state

delay

(arg1) delay in ns

32 bit value. Delay precision is based of the CPU clock (default is 125Mhz or 8ns)

Last updated