Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; ErsteAsmSchritte.asm
- ;
- ; Created: 19.10.2017 14:54:38
- ; Author : Jan
- ;
- .def temp = R16
- .org 0x002E rjmp int0Ovfl
- .ORG INT_VECTORS_SIZE ; End of interrupt table
- .equ LED_DDR = DDRB
- .equ LED_PORT = PORTB
- int0Ovfl:
- cbi LED_PORT,7
- reti
- init:
- sbi LED_DDR,7 // set pin as out
- ret
- initTim0:
- ldi temp, (1<<CS02) | (1<<CS01) // prescaler 1024 -> TCCR0B
- out TCCR0B,temp // write to TCCR0B
- ldi temp, (1<<TOIE0) // timer overflow enable -> TIMSK0
- sts TIMSK0,temp // write to TIMSK0
- sei // enable interrupts
- ret
- ; Replace with your application code
- main:
- call init
- call initTim0
- rjmp main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement