Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .def tmp = r16
- .def mask1 = r17
- .def mask2 = r18
- .def counter = r20
- .cseg
- rjmp reset
- .org $00C
- rjmp t1
- .org $026
- rjmp t0
- reset:
- ldi tmp, high(RAMEND)
- out SPH, tmp
- ldi tmp, low(RAMEND)
- out SPL, tmp
- ldi tmp, 0xff
- out DDRA, tmp
- out PORTA, tmp
- ldi tmp, (1 << WGM12) | (1 << CS10) | (1 << CS11)
- out TCCR1B, tmp
- ldi tmp, (1 << WGM01) | (1 << CS02)
- out TCCR0, tmp
- ldi tmp, high(28799)
- out OCR1AH, tmp
- ldi tmp, low(28799)
- out OCR1AL, tmp
- ldi tmp, 72
- out OCR0, tmp
- ldi tmp, (1 << OCIE1A) | (1 << OCIE0)
- out TIMSK, tmp
- sei
- ldi tmp, 0xff
- ldi mask1, 0x01
- ldi mask2, 0x80
- main:
- rjmp main
- t1:
- eor tmp, mask1
- out PORTA, tmp
- reti
- t0:
- inc counter
- cpi counter, 200
- brne t0_jump
- eor tmp, mask2
- ldi counter, 0
- out PORTA, tmp
- t0_jump:
- reti
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement