Quantcast
Viewing all articles
Browse latest Browse all 4879

General • "Nine Pico PIO Wats with MicroPython (Part 1)"

This free article may be of interest:
Nine Pico PIO Wats with MicroPython (Part 1) | Towards Data Science

It goes over some of the surprises of using Programmable I/O (PIO) from MicroPython. It’s presented in the context of building a theremin-like musical instrument. It may be interest to anyone working with the PICO.

Here is a list of “Wat?!” moments (most have workarounds, which are discussed):

0. (Bonus) “State Machines” are not actually state machines.
1. Only two general registers.
2. Only 32 instructions per PIO program.
3. `pull(noblock)` gets its value from `x` if there is no value on the FIFO.
4. Cheap, smart hardware (like a $2 ultrasonic range finder) can be unintuitive and unreliable.

[In Part 2 (coming soon)]:

5. Constants are limited to 5 bits.
6. You can `jmp` on `pin` and `x_not_y`, but not `not_pin` nor `x_eq_y`.
7. `x_dec`/`y_dec` end with a value of 4,294,967,295.
8. All pins are called `pin` or `pins` in PIO, which can be confusing.
9. Debugging is kludgy, but “push-to-print” works.

Statistics: Posted by carlk — Thu Jan 23, 2025 9:24 pm



Viewing all articles
Browse latest Browse all 4879

Trending Articles