| UMBC | CMSC 391 -- Programming Microcontrollers |
| Bit | TMOD Bit Function |
|---|---|
| 7 | Gate -- OR gate enable bit which controls RUN/STOP of timer 1. Set to 1 by program to
enable timer to run if bit TR1 in TCON is set and signal on external interrupt |
| 6 | C/ |
| 5 | M1 -- Timer/counter operating mode select bit 1. Set/cleared by program to select mode. |
| 4 | M0 -- Timer/counter operating mode select bit 0. Set/cleared by program to select mode. |
| 3 | Gate -- OR gate enable bit which controls RUN/STOP of timer 0. Set to 1 by program to enable timer to run if bit TR0 in TCON is set and signal on external interrupt |
| 2 | C/ |
| 1 | M1 -- Timer/counter operating mode select bit 1. Set/cleared by program to select mode. |
| 0 | M0 -- Timer/counter operating mode select bit 0. Set/cleared by program to select mode. |
| M1 | M0 | Mode | Description |
|---|---|---|---|
| 0 | 0 | 0 | Use the THX register as an 8-bit counter and the TLX as a 5-bit counter. |
| 0 | 1 | 1 | Use the THX register as an 8-bit counter and the TLX as an 8-bit counter. |
| 1 | 0 | 2 | Use only the TLX register as an 8-bit counter. |
| 1 | 1 | 3 | In modes 0 - 2, Timers 0 and 1 may be programmed independently. In mode 3: Timer 0 in mode 3 becomes two separate 8-bit counters. Timer 1 in mode 3 may still be used, but will generate no interrupts. |
TMOD is not bit addressable.
Direct Byte Address is 89h.
The only difference in counting and time is the source of the clock pulses to the counters.