
Timers
17.2 Timers
The simulator peripheral timer has three timer/counter modules: Timers 0, 1, and 2; a system timer module; and a watchdog module. The Timer/Counter 0 module is identical to the Timer/Counter 1, so we shall only describe the opera- tions of Timer/Counter 0.
Figure 17−1. Timer/Counter 0 − Mode 2
The first of the two selection boxes provides a list of four
The interrupt trigger type is determined by the state of the IT0 bit within the TCON register. Clearing this bit implies level triggering, and setting it implies falling edge triggering. If the level triggering option is selected, care must be taken to make sure that the state of the INT0 pin returns to a high state (non−active) before re- turning from an ISR, otherwise the interrupt request will be reasserted. For most intents and purposes, it is unrealistic that you would be able to switch the check box INT0 on and off fast enough to avoid causing an unintended interrupt request. For this reason, an edge triggered interrupt option is recommended for simula- tion. Whatever the case may be, both trigger types are accommodated and imple- mented in this simulation package.