First of all i want to admit that i don’t have any experience in the micro controller area (i 'm a software developer mainly working in the .NET field).
Of course i have a fundamental understanding of how micro controllers work, but i need to deeper understand some things.
Seeking in some samples/forum threads i found one which implements exactly what i want to do.
For simplicity i strip all the irrelevant parts, focusing only on the stuff i don’t understand:
TCCR2A = 0;
TCNT2=455; //455 outputs 1.007khz
TCCR2B = B00000010;
//Timer2 Overflow Interrupt Enable
TIMSK2 = 1<<TOIE2;
I understand the mechanisms of interrupting, but what exactly are the following ? :
- In many samples i see that TCNT2 is reset to some value inside the ISR: must this be done?
Are there anywhere references which explain why these registers have to be set to get some result?
Thanks in advance