Debian Codegraph @

examples/ASM/square-wave-tc0.S

raw
1 ; Generates Square wave on PB3 (OCR0)
2 #include <avr/io.h>
3
4 .section .text ; denotes code section
5 .global main
6 main:
7 ldi r16, (1 << WGM01) | (1 << COM00) | 1 ; Set TCCR0 in the CTC mode
8 sts TCCR0 , r16
9 ldi r16, 250
10 sts OCR0, r16
11 ldi r16, (1 << PB3)
12 sts DDRB, r16
13 .end