Commit b452c9f5 authored by Petter Breedveld's avatar Petter Breedveld

Timer-LF now using OUTTGL instead of XOR

parent 424ddd91
......@@ -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);
  • Dette burde være OUTTGL = bitmask; og ikke |=. Jeg tror outtgl leses som 0 uansett, og da gjør det liten forskjell, men du skal i utgangspunktet kun skrive masken rett til tgl- registeret

    Edited by Snorre Nilssen Vestli
Please register or sign in to reply
TCA0_SINGLE_INTFLAGS |= ( TCA_SINGLE_OVF_bm); //Clear the interupt flag
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment