Running PIO flat out?


Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7341
Posted: 03:49pm 30 Jan 2025      

At full speed a PIO state machine can carry out 1 instruction per CPU clock cycle. I suppose that will mean one instruction to set a pin, one to reset it and one to jump back to the first instruction. That would, I think, give a pin that clocked at a maximum of CLK/3 Hz. 142.66MHz.

Now, there are instructions that can actually do two things in one clock cycle (side set etc.). I'm not well up enough on the PIO to be able to help there. It could be that the reset and jump back could be combined.

Note. If a state machine hits the end of it's memory area it automatically jumps back to its start point, so if you put the set instruction at the start point and the end instruction as the last instruction in memory it should toggle at CLK/2, I think.

.
Edited 2025-01-31 01:52 by Mixtel90