CLKPR = 0;
/* Timer */
- PRR0 &= ~_BV(PRTIM2);
- OCR2A = F_CPU / 256 / 1000 - 1; /* Timer2: 1000Hz interval (OC2A) */
- TCCR2A = (0b10 << WGM20); /* CTC Mode */
- TCCR2B = (0b110 << CS20); /* Prescaler 256 */
- TIMSK2 = _BV(OCIE2A); /* Enable TC2.oca interrupt */
+ PRR1 &= ~_BV(PRTIM3);
+ OCR3A = F_CPU / 1000 - 1; /* Timer3: 1000Hz interval (OC3A) */
+ TCCR3B = (0b01<<WGM32)|(0b001<<CS30); /* CTC Mode, Prescaler 1 */
+ TIMSK3 = _BV(OCIE3A); /* Enable TC2.oca interrupt */
}
static