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

Phasecutmode, CTC-Mode for Timer2 necessary? #322

Open
mankut80 opened this issue Mar 14, 2024 · 2 comments
Open

Phasecutmode, CTC-Mode for Timer2 necessary? #322

mankut80 opened this issue Mar 14, 2024 · 2 comments

Comments

@mankut80
Copy link

i am trying to build a Homematic Phasecut-Dimmer (leading edge) with an Arduino Pro Mini. Examining the code, i stumbled over line 107 in PhaseCut.cpp:

TCCR2B |= (1 << WGM21) | (1 << CS20) | (1 << CS21) | (1 << CS22) ; // Enable/start CTC and set prescaler to 1024
the bit WGM21 is located in TCCR2A, not in TCCR2B. So, the CTC-Mode will not be enabled.
Is this a "cosmetic" bug :-)? Maybe the CTC-Mode ist not necessary for the comparematch to occure?

@pa-pa
Copy link
Owner

pa-pa commented Mar 17, 2024

Good question. I have no idea.

@mankut80
Copy link
Author

In the meantime i know it. CTC-Mode is not necessary. No need to set WGM21 :-)

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