Skip to content

Why is my Pico W picking daiseys sometimes, and why is it so slow? #2106

Answered by earlephilhower
frohro asked this question in Q&A
Discussion options

You must be logged in to vote

USB interrupts, possibly. Or some other periodic IRQ. Use setup1 and loop1 for tight loops since there's nothing running on that core unless you put it there.

As for the digitalWrite speed, it's doing a lot of work besides toggling a pin since it's a generic function and needs to check parameters/etc. Also, after loop returns and before it's called again there's other housekeeping being done in the core.

For highest speed set the GPIO pin directly from inside while(1) loop on the 2nd core so that it never exits.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by frohro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants