The response time of a polling loop will be far too slow to capture a meaningful value from a 20 MHz timer.
The PWM peripherals on the Pico and Pico2 have the unusual feature of being able to capture positive- and negative-going edges, and are simpler to use than PIO programming. See the C code at https://iosoft.blog/picofreq, or Python (and RP2350) version https://iosoft.blog/picofreq_python
The PWM peripherals on the Pico and Pico2 have the unusual feature of being able to capture positive- and negative-going edges, and are simpler to use than PIO programming. See the C code at https://iosoft.blog/picofreq, or Python (and RP2350) version https://iosoft.blog/picofreq_python
Statistics: Posted by jayben — Sat Oct 19, 2024 9:00 am