update...can anybody answer this? help on programming

hi again..hopefully i am somewhere along the lines of 'close'

i wont tell the program objectives...but i made prg that works actually

but donno whatthe outputs mean... here is the program

#include <8051io.h>
#include <8051bit.h> /* Bit set/clear macros */
#include <8051reg.h>

void main()
{
int i;
serinit(9600);
asm
{
MOV TMOD,#10H
MOV TL1,#047H
MOV TH1,#0FFH
}
for(i=0; i<1; i++)
printf( "\nTimer=%d %d", TH1, TL1 );
}

the output is Timer=253 254

however if i change the timer to 0 which is TMOD,#01
and the printf( TH0, TL0); then i get this output Timer=255 71

can anybody explain what is this number mean? is it frequency? square wave signal? please help... thanks ...
[828 byte] By [hkboy313] at [2007-11-19 1:47:25]
# 1 Re: update...can anybody answer this? help on programming
well... a timer with microprocessor programming is (simply) a counter, which can (depends on the controller type) count up or downwards, with a desired (depends also on the controller type) frequency, often a multiple of the controllers frequency.
on overflow it will generate an interrupt, then you know, chosen time is over.

so i think (don't know anything about the 8051) that TL1 and TH1 are in fact the two halfs of the 16bit count register for the timer1.

so what your printf does is outputting the actual position of your timer.

its not a frequency, nor a square wave signal... its only the position of your counter.
example: if one count operation took 1 second and you want to wait 10 seconds. you set your timer register to 10 (if it counts downwards). if the register reaches 0, 10 seconds are over.
bigBA at 2007-11-10 3:56:05 >
# 2 Re: update...can anybody answer this? help on programming
You'll have to explain what TMOD, TL1 and TH1 are. If I assume TL1 and TH1 are the low- and high-order bytes of a 16-bit word, then your first printed result, "253 254", corresponds to the 16-bit value FDFE, or -514. The second printed value, "255 71" corresponds to the 16-bit value FF47, or -185.

Who knows what these numbers mean? Your question provides no clues whatsoever.
TSYS at 2007-11-10 3:57:05 >
# 3 Re: update...can anybody answer this? help on programming
would you mind giving me an example of a square wave signal ? thank you again.
hkboy313 at 2007-11-10 3:57:59 >
# 4 Re: update...can anybody answer this? help on programming
[ Merged threads ]
Andreas Masur at 2007-11-10 3:59:05 >
# 5 Re: update...can anybody answer this? help on programming
what do you mean by "giving a example of a square wave signal"?

should i draw you a picture? *justjoking*

look at the other thread started by you... i gave an answer
bigBA at 2007-11-10 4:00:02 >