Previous in Forum: Big Gas Price Jump Expected   Next in Forum: How can I make a clinker?
Close
Close
Close
Rate Comments: Nested
Active Contributor

Join Date: Aug 2008
Posts: 15

Urgent question about 8051 timer

10/12/2008 12:57 PM

in order to generate 5ms delay using 11.0592mhz crystal, what are the values to be loaded into TH0 and TL0? (mode1, 16 bit counter) in mazidi, the values say: 5ms/1.085us=60926 thus TH=EE and TL=00 but another book tells me to do the no. to be loaded is19457 and also instructs to perform the following calculation before lading the values in TH and TL: TH0 * 256 + TL0 = 19457 assuming TL0=1 TH0=76. thus the values to be loaded are:th=4c and tl=01 which one is correct? please help!!!

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Engineering Fields - Control Engineering - New Member China - Member - New Member

Join Date: Sep 2006
Location: CHINA
Posts: 2945
Good Answers: 14
#1

Re: Urgent question about 8051 timer

10/12/2008 8:49 PM

Both of them are right, depend on which way youwill get in.

In fact, we usually use the second values in practice as timer output. in this way the microchip timer ram content is implememting substraction operation. while timer implement add operation, when overflow the timing is done. the first one is rare use.

I use the second one in program of timing or call subroutine.

Register to Reply
Register to Reply

Previous in Forum: Big Gas Price Jump Expected   Next in Forum: How can I make a clinker?

Advertisement