Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .org $00
- rjmp START
- .org OVF1addr ;Timer 1
- rjmp BCD
- .org OVF0addr ;Timer 0
- rjmp MUX
- START:
- ldi r16,HIGH(RAMEND)
- out SPH,r16
- ldi r16,LOW(RAMEND)
- out SPL,r16
- TIMER1:
- ldi r16,(1<<CS10)|(0<<CS11)
- out TCCR1B,r16
- TIMER0:
- ldi r16,(1<<CS00)|(1<<CS01)
- out TCCR0,r16
- ldi r16,(1<<TOIE0)|(1<<TOIE1) ;FÖR BÅDE TIMER1 OCH TIMER0
- out TIMSK,r16
- RESET:
- clr r16
- clr r17
- clr r18
- clr r19
- sei ;ENABLE INTERUPTS
- PORT:
- ldi r16,$ff
- out DDRA,r16
- ldi r16,$ff
- out DDRB,r16
- DONE:
- rjmp DONE
- BCD:
- inc r18
- out PORTB,r18
- reti
- MUX:
- inc r19
- out PORTA,r18
- reti
- /* BRA LÄNKAR
- http://maxembedded.com/2011/06/avr-timers-timer1/
- http://maxembedded.com/2011/06/avr-timers-timer0/
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement