Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bouncing input signal hack #2

Open
Ludwolf opened this issue Nov 7, 2021 · 1 comment
Open

bouncing input signal hack #2

Ludwolf opened this issue Nov 7, 2021 · 1 comment

Comments

@Ludwolf
Copy link

Ludwolf commented Nov 7, 2021

Hi Nikos, thank you for the code, works well with proper edges, e.g. from function generator.

I use your module for RPM measurement on my CNC DC-spindle. I added a line-follower-module for RPM measurement, which provides a pretty good, but not perfect rectangle edge.

Bouncing I suppressed with 0.1 nF capacitor at input, and the following code hack in your module.

Any better / alternative idea ?

Greetings from Wolf Ludwig, ludwolf@t-online.de :-)

void IRAM_ATTR onRise()
{
portENTER_CRITICAL_ISR(&_FreqCountESP::sMux);
if(digitalRead(FreqCountESP.mPin)){
_FreqCountESP::sCount++;
}
portEXIT_CRITICAL_ISR(&_FreqCountESP::sMux);
}

@danalvarez
Copy link

Although I was not able to see any bouncing on my input signal, I found similar issues that were solved by configuring the glitch filter. More info here: espressif/arduino-esp32#8368

Maybe it helps someone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants