Timer-LF now using OUTTGL instead of XOR
... | ... | @@ -24,7 +24,7 @@ int main(void) |
*/ | ||
PORTB_DIR |= (1 << LED1) | (1 << LED2); | ||
PORTB_OUT |= (1 << LED1); //Only to start with LEDs off | ||
PORTB_OUTTGL |= (1 << LED1); //Only to start with LEDs off | ||
//We will be using a timer overflow interupt with timer A | ||
//We set the prescaler to clk=clk/256 | ||
... | ... | @@ -49,8 +49,7 @@ int main(void) |
ISR(TCA0_OVF_vect){ | ||
PORTB_OUT ^= (1 << LED1); | ||
PORTB_OUT ^= (1 << LED2); | ||
PORTB_OUTTGL |= (1 << LED1) | (1 << LED2); | ||
|
||
TCA0_SINGLE_INTFLAGS |= ( TCA_SINGLE_OVF_bm); //Clear the interupt flag | ||
... | ... |