#pull noblock delays circuitpython execution?

1 messages · Page 1 of 1 (latest)

round karma
#

i added a "pull noblock" to the body of the pio loop and now circuitpython can no longer keep up

#

i am confused about how a pio program can make circuitpython run slower

#

i never write any data into the pio so the fifo is always empty and "pull noblock" should always just do "mov osr, x"

#

if i replace the "pull noblock" with "mov osr, x" then circuitpython can keep up again

#

so next i tried making the pio toggle a pin on every loop so i can see it on my logic analyzer

#

here is the program: ```
.program lcd
set x, 1
loop:
wait 1 pin 5
set pindirs, 0
in pins, 8
;pull noblock
mov osr, x
out pins, 1
wait 0 pin 5
out pins, 1
jmp loop

#

here is the trace:

#

basically when clock goes high i read the top 5 pins

#

i actually read 8 pins so the circuitpython has aligned data, but 3 of them are ignored

#

the bottom trace is the pin toggled by the pio

#

you can see here that the pio keeps up with the data stream - no overflow happens

#

if i simply uncomment the "push noblock" then the trace looks like this:

#

here you can see in the bottom trace that the pio stopped running. this is because the fifo got full, which means that circuitpython is not keeping up with it any more

#

so somehow adding "pull noblock" into a pio program makes circuitpython run slower, with no other changes

#

and no just a little bit slower. it was 1.5ms before the fifo became available again

#

how is this possible?

#

changing the pio frequency has no effect btw