
412 EMBEDDED SYSTEMS
11.3.3.7 | Timer 0 Interrupt Register (TOIR)
is register has bits for each of the matching states of MR0 to MR3. When a timer
operates in the interrupt mode and a match occurs, an interrupt is generated, and the
corresponding fl ag bit in T0IR is set. To ‘clear’ it, a ‘1’ must be written into this same
register. en only will the interrupt fl ag be ‘reset’.
Table 11.8 shows that the corresponding bit for Timer 0 in T0IR is bit 0. In
Example11.7, the instruction used is
T0IR = 0x01; // Clear match 0 interrupt
Steps of the Program (Example 11.7)
i) e operation of the timer is quite straight forward. When a match occurs, ...