English
Language : 

C501_1 Datasheet, PDF (60/121 Pages) Siemens Semiconductor Group – 8-Bit Single-Chip Microcontroller
On-Chip Peripheral Components
C501
6.2.2.2 Auto-Reload (Up or Down Counter)
Timer 2 can be programmed to count up or down when configured in its 16-bit auto-reload mode.
This feature is invoked by a bit named DCEN (Down Counter Enable, SFR T2MOD, 0C9H). When
DCEN is set, timer 2 can count up or down depending on the value of pin T2EX (P1.1).
Figure 6-15 shows timer 2 automatically counting up when DCEN = 0. In this mode there are two
options selectable by bit EXEN2 in SFR T2CON.
Figure 6-15
Timer 2 Auto-Reload Mode (DCEN = 0)
If EXEN2 = 0, timer 2 counts up to FFFFH and then sets the TF2 bit upon overflow. The overflow
also causes the timer registers to be reloaded with the 16-bit value in RC2H and RC2L. The values
in RC2H and RC2L are preset by software.
If EXEN2 = 1, a 16-bit reload can be triggered either by an overflow or by a 1-to-0 transition at the
external input T2EX (P1.1). This transition also sets the EXF2 bit. Both the TF2 and EXF2 bits can
generate an timer 2 interrupt if enabled.
Setting the DCEN bit enables timer 2 to count up or down as shown in figure 6-16. In this mode the
T2EX pin controls the direction of count.
Semiconductor Group
6-26