Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
simenpf
attinykurs
Commits
b452c9f5
Commit
b452c9f5
authored
Feb 13, 2017
by
Petter Breedveld
Browse files
Timer-LF now using OUTTGL instead of XOR
parent
424ddd91
Changes
1
Show whitespace changes
Inline
Side-by-side
Session2-LF/TIMER-LF.c
View file @
b452c9f5
...
...
@@ -24,7 +24,7 @@ int main(void)
*/
PORTB_DIR
|=
(
1
<<
LED1
)
|
(
1
<<
LED2
);
PORTB_OUT
|=
(
1
<<
LED1
);
//Only to start with LEDs off
PORTB_OUT
TGL
|=
(
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment