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