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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/12/06 16:32
Read: times


 
#107153 - Event counter explained
Responding to: ???'s previous message
Timer Mode Register

"TMOD"

Bit Name Timer Description
_____________________________________________________________
7 Gate 1 Gate bit; when set, timer only runs while INT-bar is high. This bit is used in conjunction with interrupts and will be dealt with later.
6 C/T-bar 1 Counter/timer select bit; when set timer is an event counter, when cleared timer is an interval timer.
5 M1 1 Mode bit 1
4 M0 1 Mode bit 0
3 Gate 0 Gate bit; when set, timer only runs while INT-bar is high.
2 C/T-bar 0 Counter/timer select bit; when set timer is an event counter, when cleared timer is an interval timer.
1 M1 0 Mode bit 1
0 M0 0 Mode bit 0



The functions of the 8-bits of TMOD are described in the above table. The top four bits are for timer 1 and the bottom four bits have the exact same function but for timer 0.


The Gate bits are used in conjunction with interrupts.
As mentioned above, the timers can be used for counting external events or for timing intervals. If you wish the timer to be an event counter you set the corresponding C/T-bar bit. Similarly, if you wish it to be an interval timer you reset the corresponding C/T-bar bit.

There are two mode bits (M1 and M0) for each timer. The table below describes their function.

M1,M0,Mode Description
0 0 0 13-bit timer mode (this mode exists simply to keep the 8051 backwards compatible with its predecessor, the 8048, which had a 13-bit timer)

0 1 1 16-bit timer mode
1 0 2 8-bit auto-reload mode
1 1 3 Split timer mode





List of 17 messages in thread
TopicAuthorDate
timer/ counter            01/01/70 00:00      
   clarify            01/01/70 00:00      
   To rephase my Question            01/01/70 00:00      
      what is "the event counter"            01/01/70 00:00      
         Event counter explained            01/01/70 00:00      
            I know what the datasheet (the "bible")            01/01/70 00:00      
   Try prioritizing            01/01/70 00:00      
      About Prioritizing            01/01/70 00:00      
      Priority            01/01/70 00:00      
   Should of been original question sorry !            01/01/70 00:00      
      a few comments            01/01/70 00:00      
         i dont have to stick to P2.2            01/01/70 00:00      
            never us a register for a dedicated purp            01/01/70 00:00      
               Thanks for tip            01/01/70 00:00      
                  you do not need that            01/01/70 00:00      
               thanks            01/01/70 00:00      

Back to Subject List