Skip to content

How many cycles does PIO code takes in logic_analyzer? #7

Description

@pc2005cz

Hi,

Is this comment correct?

/* The PIO is running with sys_clk, and needs 10 cycles per sample,
* so the LA is sampling with 32 MHz */

When I wrote a replacement PIO code for decreased pin count (so I can send samples more often) the buffer had always overflown.

When I looked back into the original PIO code

.wrap_target
; GP0 - GP11 are contiguous, then come the HSTX pins which are already in use
; Next pins we can use are 20, 21, 22 and then 26, 27, 28
mov osr, pins ; Sample all 32 pins
in osr, 12 ; shift values of GP0-GP11 to ISR
out null, 20 ; shift out GP0-GP11 and discard GP12-GP19
in osr, 3 ; shift in GP20 - GP22
out null, 6 ; drop GP20 - GP25
in osr, 1 ; shift in GP26 - now the ISR is full and the autopush is happening
in null, 16 ; fill with zeroes so that data is in lower 16 bits
nop [3]
.wrap

it seems it actually takes 11 cycles to run (nop [3] is 1+3)? I don't have a much experience with PIO system. Can you confirm the logic_analyzer is designed for 11 cycles per sample?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions