From bdfc4c5507af5127b6807e204ce45f776aae9829 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Mon, 4 Oct 2010 13:58:00 +0200 Subject: [PATCH] clock.c: Add a comment about interrupt priorities. --- clock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clock.c b/clock.c index ecfa572..9056814 100644 --- a/clock.c +++ b/clock.c @@ -27,6 +27,13 @@ void clock_setup() { // no compare match, CTC mode TCCR2A = MASK(WGM21); + // TODO: Timer 2 has higher priority than Timer 1 used for the stepper + // interrupts, which is bad. See AVR Reference Manual p. 9: + // "The interrupts have priority in accordance + // with their Interrupt Vector position. The + // lower the Interrupt Vector address, the higher + // the priority." + // in conjunction with p. 63 (interrupt vector table). // 128 prescaler (16MHz / 128 = 125KHz) TCCR2B = MASK(CS22) | MASK(CS20);