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

General • Re: PIO pin follower delay

$
0
0
I think it's because, by default, the SDK configures both the ISR and OSR to shift right. So your program has to execute IN PINS, 1 32 times before the first sampled bit is in position 0 of OSR, where it will be output by an OUT PINS, 1.

For your three instruction example, expected time is (3 x 32 + 4) x 8ns = 800ns, which is pretty close to your result.

You probably want to make the ISR shift left instead.

Alternatively, you could test with this program:

Code:

MOV PINS, PINS
Thanks - It looks like this is the issue. Using MOV PINS, PINS I get a delay of 41nS which seems more reasonable. Trying various flavours of sm_config_set_in_shift / sm_config_set_out_shift to change the shift order combined with filling the ISR with zeros up to 32 bits I can see the effect of the shift direction etc.

Thanks again.

Statistics: Posted by DavidPinball — Thu Feb 29, 2024 10:54 pm



Viewing all articles
Browse latest Browse all 4844

Trending Articles