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

General • Re: Is this a job for PIO?

$
0
0
Not yet mentioned in this thread is that the PWM blocks can also count edges if applied to the 'B' channel (ie. any odd numbered GPIO pin). That would allow for a hardware-driven count that can be polled in foreground, as the question seems to want (though it's not obvious why).

Personally, I'd probably use GPIO interrupts for this requirement.

One possible argument for using PIO is if there is a problem with contact bounce on the input, which would be easy to debounce in a PIO program but would give wrong answers with the PWM/counter approach and cause problems with simple edge interrupts.

Statistics: Posted by arg001 — Sun Aug 18, 2024 2:49 pm



Viewing all articles
Browse latest Browse all 4978

Trending Articles