gc80c520a CORERIVER Semiconductor, gc80c520a Datasheet - Page 43

no-image

gc80c520a

Manufacturer Part Number
gc80c520a
Description
Midas1.0 Family Mask Rom/eprom/romless 8-bit Turbo Microcontrollers
Manufacturer
CORERIVER Semiconductor
Datasheet
MiDAS1.0 Family
6.2.4.2.2 Auto-reload Mode, Counting Up
The auto-reload mode as an up-counter is enabled by clearing the CP/RL2 bit in the T2CON SFR and
clearing the DCEN bit in T2MOD SFR. In this mode, Timer/Counter 2 is a 16-bit up-counter. When the
counter rolls over from FFFFh to 0000h, TL2 and TH2 are reloaded with the 16-bit value in SFRS
RCAP2L and RCAP2H. The TF2 bit is also set. If the EXEN2 bit is set, then a negative transition of T2EX
pin will also cause a reload. The EXF2 bit in T2CON is also set.
6.2.4.2.3 Auto-reload Mode, Counting Up/Down
Timer/Counter 2 operates in auto-reload mode as an up/down-counter if CP/RL2 bit in T2CON is cleared
and the DCEN bit in T2MOD is set. In this mode, Timer/Counter 2 is an up/down-counter whose direction
is controlled by the T2EX pin. When T2EX is high, Timer 2 counts up. Timer overflow occurs at FFFFh
which sets the TF2 flag. The overflow also causes the 16-bit value in RCAP2H and RCAP2L registers to
be reloaded into the timer registers TH2 and TL2. When T2EX is low, Timer 2 counts down. Timer
underflow occurs when the count in the timer registers TH2 and TL2 equals the value stored in RCAP2H
and RCAP2L registers. The underflow sets TF2 flag and reloads FFFFh into the timer registers.
The EXF2 bit toggles when Timer 2 overflows or underflows according to the direction of the count. EXF2
does not generate any interrupt in this mode. This bit can be used to provide 17-bit resolution.
6.2.4.2.4 Baud Rate Generator Mode
The baud rate generator mode is selected by setting either the RCLK or TCLK bits in T2CON SFR. In this
mode, Timer/Counter 2 is a 16-bit counter with automatic reload when the count rolls over from FFFFh to
0000h. However, rolling-over does not set the TF2 bit. If EXEN2 bit is set, a negative transition of the
T2EX pin will set EXF2 bit in the T2CON and cause an interrupt request. Timer 2 interrupt caused by TF2
will be ignored in this mode.
6.2.4.2.5 Programmable Clock-out
In the clock-out mode, Timer 2 operates as a 50% duty cycle, programmable clock generator. The input
clock increments TL2 at (Oscillator frequency) / 2. Timer 2 repeatedly counts to overflow from a loaded
value. At overflow, the Timer 2 registers TL2 and TH2, will be reloaded with the 16-bit value in registers
RCAP2L and RCAP2H, which are preset by software. In this mode, Timer 2 overflows do not generate
Page 43 of 187

Related parts for gc80c520a