Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5091

SDK • Re: Anyone good with PIO?

$
0
0
Your code initially turns the pin low. Then it delays and turns the pin high. Then it delays and turns it high again. So it's going to stay high rather than flash.

The loop will actually iterate 32 times because JMP X-- branches based on whether X is non-zero prior to being decremented.

Please share the C code to set up the PIO state machine, to make sure pin mappings etc are right.

The way to make it sleep for 11 microseconds is sleep_us(11). sleep_ms(11) makes it sleep for 11 milliseconds. You might find that doing things like avoiding flash memory accesses and putting your time sensitive code in a dedicated memory bank to avoid bus conflicts let's you do this with enough precision on an ARM processor. PIO seems more appropriate for this though.

Statistics: Posted by alastairpatrick — Tue Mar 19, 2024 5:27 pm



Viewing all articles
Browse latest Browse all 5091

Trending Articles