fminniti
Newbie level 1
Hi people.
I'm quite new on Timer 2 programming for 8952 and I have a simple problem.
I'm trying to use Timer 2 as a clock out, and following Atmel instructions cannot make it work.
I'm using Keil to compile and simulate, and I get frustrated since Th2 and TL2 neveer changes their values.
Could anybody help with this single issue?
Thanks
This is part of the code to generate a 50% duty cycle on P1.0 as indicated on Atmel Manual which is not working
t2con data 0c8h
t2mod data 0c9h
rcapl data 0cah
rcaph data 0cbh
tl2 data 0cch
th2 data 0cdh
org 0000h
mov t2con,#00h ;clears t2con.1 (C/T)
mov t2mod,#02h ;sets t2mod.1 (T2OE)
mov rcapl,#0fdh
mov rcaph,#0ffh
mov tl2,#0fdh
mov th2,#0ffh
mov t2con,#04h ;starts timer (Sets TR2)
here:
inc a
mov p2,a ;just to check program and Keil
sjmp here ;are running properly
end
I'm quite new on Timer 2 programming for 8952 and I have a simple problem.
I'm trying to use Timer 2 as a clock out, and following Atmel instructions cannot make it work.
I'm using Keil to compile and simulate, and I get frustrated since Th2 and TL2 neveer changes their values.
Could anybody help with this single issue?
Thanks
This is part of the code to generate a 50% duty cycle on P1.0 as indicated on Atmel Manual which is not working
t2con data 0c8h
t2mod data 0c9h
rcapl data 0cah
rcaph data 0cbh
tl2 data 0cch
th2 data 0cdh
org 0000h
mov t2con,#00h ;clears t2con.1 (C/T)
mov t2mod,#02h ;sets t2mod.1 (T2OE)
mov rcapl,#0fdh
mov rcaph,#0ffh
mov tl2,#0fdh
mov th2,#0ffh
mov t2con,#04h ;starts timer (Sets TR2)
here:
inc a
mov p2,a ;just to check program and Keil
sjmp here ;are running properly
end