mpc89x53a Megawin Technology, mpc89x53a Datasheet - Page 14

no-image

mpc89x53a

Manufacturer Part Number
mpc89x53a
Description
8-bit Micro-controller
Manufacturer
Megawin Technology
Datasheet
Functional Description
TIMERS/COUNTERS
MPC89x53A has three 16-bit timers, and they are named T0, T1 and T2. Each of them can
also be used as a general event counter, which counts the transition from 1 to 0.
While T0/T1/T2 is used as “timer” function, the time unit that used to measure the timer is
machine cycle. A machine cycle equals 12 or 6 oscillator periods, and depends on 12T mode
or 6T mode that the user configured this device.
While T0/T1/T2 is used as “1-0 event counter” function, the counting event is the “high-to-low
transition” of primitive pin T0/T1/T2. In this mode, the device periodically samples the status of
pin T0/T1/T2 once for each machine cycle. Whenever the sampled result turns from 1 to 0, the
device will count once on the counter. Becarefully, this kind of implementation for the counter
requires the high-duty or low-duty from pin T0/T1/T2 and must not too short compared to a
machine cycle.
There are two SFR designed to configure timers T0 and T1. They are TMOD, and TCON.
There are extra two SFR designed to configure timer T2. They are T2MOD, and T2CON.
SFR: TMOD
GATE: Gating control when set. If GATE=1, Timer/Counter x is enabled only while “/INTx” pin is high and
“TRx” control bit is set. When cleared Timer x is enabled whenever “TRx” control bit is set.
C//T: Timer or Counter function selector. 0: =timer, 1: =counter
{M1, M0}: mode select
GATE
Bit-7
14
{0, 0}: = 13-bit timer/counter for Timer0 and Timer1
{0, 1}: = 16-bit timer/counter for Timer0 and Timer1
{1, 0}: = 8-bit timer/counter with automatic reload for Timer0 and Timer1
{1, 1}: = for Timer0: = TL0 is 8-bit timer/counter, TH0 is locked into 8-bit timer
Bit-6
(for timer1 use)
C//T
for Timer1:= Timer/Counter1 Stopped
Bit-5
M1
MPC89x53A Data Sheet
Bit-4
M0
GATE
Bit-3
Bit-2
(for timer0 use)
C//T
Bit-1
M1
Bit-0
M0
MEGAWIN

Related parts for mpc89x53a