mpc82g516a Megawin Technology, mpc82g516a Datasheet - Page 50

no-image

mpc82g516a

Manufacturer Part Number
mpc82g516a
Description
8-bit Microcontroller
Manufacturer
Megawin Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
mpc82g516aE
Manufacturer:
MEGAWIN
Quantity:
1 200
Part Number:
mpc82g516aF
Manufacturer:
MEGAWIN
Quantity:
20 000
11.2.4 Programmable Clock-Out from Timer 2
Using Timer 2, a 50% duty cycle clock can be programmed to come out from pin T2CKO (P1.0).
The clock-out frequency depends on the system clock frequency (Fosc) and the reload value filled in the
RCAP2H and RCAP2L registers, as shown in the following formula:
Where [RCAP2H,RCAP2L]= the content of RCAP2H and RCAP2L taken as a 16-bit unsigned integer.
Timer 2 is programmed for the clock-out mode as follows:
• 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 and RCAP2L registers.
• Enter a 16-bit initial value in TH2 and TL2 registers. It should be the same as the reload value.
• Start the timer by setting the run control bit TR2 in T2CON register.
In the clock-out mode, Timer 2 roll-overs will not generate an interrupt. This is similar to when it is used as a
baud-rate generator. It is possible to use Timer 2 as a baud-rate generator and a clock generator simultaneously.
Note, however, that the baud-rate and the clock-out frequency depend on the same overflow rate of Timer 2.
Figure 11-10. Programmable Clock-Out from Timer 2
MEGAWIN
T2EX Pin
* Fosc is the system clock.
(P1.1)
Fosc
Clock-Out Frequency =
Note:
Divided by 2, not by 12.
Transition
Detector
2
C/-T2=0
EXEN2
4 x (65536-[RCAP2H,RCAP2L])
TR2
MPC82G516A Data Sheet
EXF2
RCAP2L RCAP2H
Fosc
(8 Bits)
TL2
Timer 2
Interrupt
(8 Bits)
TH2
Reload
Overflow
D
CK
Q
Q
Clock-Out
(P1.0)
50

Related parts for mpc82g516a