Hallo,
ja meine Frage steht eigentlich schon im Titel,
mich interessiert, ob das Interruptflag gesetzt wird, wenn OCR0 = TCNT0
gestezt wird. Der Timer läuft dabei im im Normalmodus in dem OCR0 nicht
gepuffert (Update of OCR0: Immediate) wird.
Im Datenblatt steht auf Seite 82:
1 | The 8-bit comparator continuously compares TCNT0 with the Output Compare
|
2 | Register (OCR0). Whenever TCNT0 equals OCR0, the comparator signals a match.
|
3 | A match will set the Output Compare Flag (OCF0) at the next timer clock
|
4 | cycle.
|
Wenn ich das richtig interpretiere wird der Inerrupt also immer am
"Ende" des Compare-events (OCR0 == TCNT0) ausgelöst. Was bedeutet, dass
durch die Zeile
OCR0 = TCNT0;
das Interruptflag gesetzt wird, sobald der Timer das nächste mal
weiterzählt.
Seht ihr das auch so?
Vielen Dank
Quirin