hi,
actually i hav to generate pulses to rotate a stepper motor ,using microcontroller dallas .i have to do this by adjusting timer0 values.how to calculate th0,tl0 values .
i hav to write in embedded c code,using keil compiler.
i am getting confused.pls help me.
simple...
timer0 is 16 bit so maximum value =FFFF (65535 in decimal)
formula:
timer value= 65536-(delay value in us,ms,or second)/1.085us;
let u want to put a delay of 25ms..
then
ur required value=65536-25ms/1.085us; which=42494.525
in hex this=A5FE;
so wrie
TL0=0xFE;
TH0=0xA5;
y i put 65536 becoz timer flag becomes high after ffff+1;
y i put 1.085us..... its time for 1 machine cycle i.e
1/(crystal frequency / 12) crystal freq. 11.0592MHz in this case....
hope it will help u......
so must press the helped me button!!!!