The Pico has a set of PIO co-processors. They are real-time controllers that can execute logic with deterministic timing. Ideal to run strict-timed sequences and state machines. And to implement extra peripherals. |
PIO allows the Pico to run the motor off-line, while the ARM cores (if you are using a Pico2, maybe the RISC cores?) do something else. You tell PIO what to do, and that's it. It 'll control the steps. At least, that's the goal of this exercise. I did something similar a few years ago with a TI Hercules µController.
Hardware Provisioning
For this blog series, I'm using TI's BoosterPack for the DRV8711, with shabaz' PICO-EUROCARD. The design will work for any Pico in combination with the DRV8711 . |
Resources needed:
- sleep, DIR and STEP pins
- a SPI channel (note: the DRV8711 has active high CS)
These are the Pico resources I reserve:
signal | DRV8711 | Pico |
SPI CLK | SCLK | SPI0 CLK |
SPI CS | SCS | GP17* |
SPI MISO | sdato | MISO** |
SPI MOSI | sdati | MOSI |
direction | DIR |
decide |
step | STEP |
decide |
sleep | SLEEP |
decide |
power |
3V3 |
|
ground |
GND |
I have allocated the SPI channels. All other pins are GPIO. I will allocate them while writing the firmware, and update this bog.
* DRV8711 uses a chip select that's active high. Pico's SPI library doesn't support that, so I will bit bang that pin.
** DRV8711 outputs are open drain. The Pico will have to provide power via pull-ups..
In the next post I'll set up the SPI communication. After that, we 'll dig into the PIO state machine.