[Problem] [Example Code] ;Long Time Delay using the 16-bit timer .equ T1START =
ID: 1810899 • Letter: #
Question
[Problem]
[Example Code]
;Long Time Delay using the 16-bit timer
.equ T1START = $7FF6
.def TEMP = R16
.def TEMP2 = R17
.def COUNTER = R18
.nolist
.include "tn2313def.inc"
.list
.ORG $0000
rjmp RESET
.ORG OVF1addr
rjmp COUNT
.ORG INT_VECTORS_SIZE
RESET:
ldi TEMP, low(RAMEND)
out SPL, TEMP
ldi TEMP, (1<<TOIE1)
out TIMSK, TEMP
clr COUNTER
in TEMP, MCUCR
ldi TEMP2, (0<<SM1) | (0<<SM0) | (1<<SE)
or TEMP, TEMP2
out MCUCR, TEMP
ldi TEMP, (0<<SM1) | (0<<SM0) | (1<<SE)
out MCUCR, TEMP
ldi TEMP, (0<<CS12) | (0<<CS11) | (1<<CS10); starts clock
out TCCR1B, TEMP
sei
MAIN:
nop
nop
rjmp MAIN
COUNT:
ldi TEMP, high(T1START)
out TCNT1H, TEMP
ldi TEMP, low(T1START)
out TCNT1L, TEMP
inc COUNTER
reti
Explanation / Answer
the question is not clear. the data is very confusing......
please repost the question with some proper details so dat i can solve it and give u the best possible answer.....
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.