|
.include "tn15def.inc"
.equ LED = 0
.def temp = r16
.def t1_count = r27
.cseg
.org 0
Vectors:
rjmp Reset_entry
rjmp Interrupt0
rjmp Pins_change
rjmp Timer1_compare
rjmp Timer1_overflow
rjmp Timer0_overflow
rjmp EEPROM_ready
rjmp Comparator_int
rjmp ADC_complete
Interrupt0:
Pins_change:
Timer1_compare:
;Timer1_overflow:
Timer0_overflow:
EEPROM_ready:
Comparator_int:
ADC_complete:
reti
Reset_entry:
cbi PORTB,LED ; Pin B.0 = 0 (LED off)
sbi DDRB,LED ; Pin B.0 - output (LED)
ldi temp,5
out TCCR1,temp ; Timer1 prescaler = 1
ldi temp,4
out TIMSK,temp ; Enable Timer1 interrupt
sei
main_loop:
rjmp main_loop
Timer1_overflow:
inc t1_count
cpi t1_count,2
brcs t01
cbi PORTB,LED ; LED on
clr t1_count
reti
t01:
sbi PORTB,LED ; LED off
reti
E-mail: info@telesys.ru