Page 1 of 1

Minimal configuration for PCNT?

Posted: Thu May 28, 2020 8:19 pm
by technerdchris
Hi,

I have a PWM set up on GPIO2 to perform a test. It would be great if I could stop the test after 2500 pulses. The previous version of the test bench used millis() and watched the time pass until 2500 * period millis had occurred and then the test stops. Now that I know PCNT exists, I want to utilize it. :geek:

To make it worse, I am using Arduino IDE, but I have things compiling ... just not sure exactly what I need to do for PCNT to work.

I saw this post about not using a control pin and also this one about Arduino IDE that I answered saying it does compile (probably awaiting approval).

Any help greatly appreciated.
Thanks,
Chris