Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .org 0000
- jmp START
- .org INT0addr
- jmp INT0_our
- .org INT1addr
- jmp INT1_OUR
- .equ TIME_MEM = $100
- .def multi = r20
- START:
- ldi r16,HIGH(RAMEND)
- out SPH,r16
- ldi r16,LOW(RAMEND)
- out SPL,r16
- call INIT
- call RESET
- call KLAR
- RESET:
- ldi r16, $00
- ldi XH, high(SEC_EN)
- ldi XL, LOW(SEC_EN)
- st X+, r16
- st X+, r16
- st X+, r16
- st X+, r16
- ldi multi, $3
- ret
- ;----------------------------------INTERRUPTS----------------------------------;
- INT0_OUR: ;klocka
- reti
- INT1_OUR: ;lcd timer
- out PORTB, multi
- dec multi
- sbrc multi, 2
- ldi multi, $3
- reti
- ;----------------------------------HELP----------------------------------;
- INIT:
- ldi r16,$7F ; 0111 1111
- out DDRA,r16
- ldi r16,$03
- out DDRB,r16
- ENABLE_INTERUPTION:
- ldi r16,(1<<INT0)|(1<<INT1)
- out GICR,r16
- ldi r16, (1<<ISC01)|(1<<ISC00)|(1<<ISC11)|(1<<ISC10)
- out MCUCR,r16
- sei
- ret
- KLAR:
- call INT1_OUR
- rjmp KLAR
- ;----------------------------------DATA----------------------------------;
- .org 180
- TABELL: .db $60,$5B,$73,$65,$37,$3F,$62,$7F,$77, $00
- .dseg
- TIME: .byte 4
- SEC_EN: .byte 1
- SEC_TIO: .byte 1
- MIN_EN: .byte 1
- MIN_TIO: .byte 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement