gc80c520a CORERIVER Semiconductor, gc80c520a Datasheet - Page 44

no-image

gc80c520a

Manufacturer Part Number
gc80c520a
Description
Midas1.0 Family Mask Rom/eprom/romless 8-bit Turbo Microcontrollers
Manufacturer
CORERIVER Semiconductor
Datasheet
interrupts as not in the baud rate generator mode. So Timer 2 can be used as a baud rate generator and
a clock generator simultaneously. For this configuration, the baud rates and clock frequencies are not
independent since both functions use the values in the RCAP2H and RCAP2L registers.
Timer 2 is programmed for the clock-out mode as follows:
The formula gives the clock-out frequency as a function of the system oscillator frequency and the value
in the RCAP2H and RCAP2L registers:
The generated clock signal is brought out to T2 pin (P1.0)
Figure 6-16 and Figure 6-17 illustrate the operating modes supported by Timer/Counter 2.
T2EX PIN
OSC
OSC
(Clock-out frequency) = (Oscillator frequency) / [ 4 * {65536 - (RCAP2H, RCAP2L)}]
T2 PIN
T2 PIN
Set T2OE bit in T2MOD register.
Clear C/T2 bit in T2CON register.
Determine the 16-bit reload value from the formula and enter it in RCAP2H/RCAP2L registers.
Enter a 16-bit initial value in timer registers TH2/TL2. It can be the same as the reload value or a
different one depending on the application.
To start the timer, set TR2 run control bit in T2CON register.
T2M
T2M
1/12
1/12
1/4
1/4
Transition
Detection
Figure 6-16 Timer/Counter 2 in Capture, Auto reload, and Clock-out Mode
[Auto Reload Mode (DCEN=1)]
0
1
0
1
C/T2=1
C/T2=0
CONTROL
C/T2=0
C/T2=1
EXEN2
Capture
CONTROL
[Capture Mode]
(Down Counting Reload Value)
TR2
(Up Counting Reload Value)
CONTROL
TR2
RCAP2L RCAP2H
0FFh
RCAP2L RCAP2H
TL2
TL2
EXF2
TH2
0FFh
TH2
Overflow
Overflow
T2EX PIN
TF2
Count
Direction
1=UP
0=Down
Toggle
Interrupt
Timer 2
Page 44 of 187
Interrupt
Timer 2
EXF2
TF2
T2EX PIN
OSC
OSC
(P1.0)
(P1.1)
T2EX
T2 PIN
T2
T2M
1/12
1/4
Transition
Detection
1/2
Transition
Detection
[Auto Reload Mode (DCEN=0)]
0
1
CONTROL
Functional Description
CONTROL
EXEN2
EXEN2
C/T2=0
C/T2=1
Reload
[Clock-Out Mode]
CONTROL
C/T2
TR2
CONTROL
TR2
EXF2
RCAP2L RCAP2H
1/2
TL2
TH2
RCAP2L RCAP2H
Interrupt
Timer 2
TL2
Overflow
(T2MOD.1)
CONTROL
T2OE
TH2
EXF2
TF2
Interrupt
Timer 2

Related parts for gc80c520a