Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/28/02 21:30
Read: times


 
#20283 - RE: Basic Question on 13 and 16 bit timers
Sean,

It really isn't too difficult: the timer/counter value is the concatenation of THx and TLx. In Mode 0 only 5 of the available bits in TLx are used, thus leaving us with 5+8 = 13 bits. In Mode 1 all 8 bits are used, so you have a 16-bit counter.

Let's assume Timer mode is configured. TLx is incremented every machine cycle (12 oscillator cycles on a 'standard' 8051). It starts at zero and counts to 31. At the next cycle, two things happen:
1. TLx is reset to zero
2. THx is incremented

The timer value can now be read as: 32*THx + TLx (in this case it's 32*1 + 0 = 32).

The same applies to Mode 1, except that TLx counts to 255 before it overflows and THx is incremented.

Hope this clarified things a bit.

Best regards,
Rob Klein.

List of 7 messages in thread
TopicAuthorDate
Basic Question on 13 and 16 bit timers            01/01/70 00:00      
RE: Basic Question on 13 and 16 bit timers            01/01/70 00:00      
RE: Basic Question on 13 and 16 bit timers            01/01/70 00:00      
RE: Basic Question on 13 and 16 bit timers            01/01/70 00:00      
RE: Basic Question on 13 and 16 bit timers            01/01/70 00:00      
RE: Basic Question on 13 and 16 bit timers            01/01/70 00:00      
RE: Basic Question on 13 and 16 bit timers            01/01/70 00:00      

Back to Subject List