Skip to content

Can one run out of PIO? #2859

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

You must be logged in to vote

Yes, you can run out. You get 8 on the RP2040, 12 on the RP2350. The core uses 1 for a cycle counter if you run FreeRTOS, but OTW they're only allocated when your app uses one.

When you begin a PIO-SM-using device (SoftwareSPI, Tone, Servo, etc.) it'll allocate its needed SMs and you can't deallocate them while the library is running. For some when you end it may free the SM, but things like PIO instruction memory will still be allocated and not useful for other libraries. (endTransaction is not the same and doesn't affect PIO SM usage, just the protocol).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tomcombriat
Comment options

@earlephilhower
Comment options

@tomcombriat
Comment options

Answer selected by tomcombriat
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