mg87fe Megawin Technology, mg87fe Datasheet - Page 15

no-image

mg87fe

Manufacturer Part Number
mg87fe
Description
8 Bits Microcontroller
Manufacturer
Megawin Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
mg87fe2051AS20
Manufacturer:
MEGAWIN
Quantity:
20 000
Part Number:
mg87fe52AE
Manufacturer:
XILINX
Quantity:
1 200
Part Number:
mg87fe52AF
Manufacturer:
MEGAWIN
Quantity:
20 000
Part Number:
mg87fe52AF44
Manufacturer:
MEGAWIN原装
Quantity:
20 000
8.0 Timer0, Timer1 & Timer2
8.1 Timers/Counters
MG87FE/L52 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 to 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. Be carefully, 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.
TMOD:
M1
0
0
1
1
1
GATE
GATE
Bit7
C//T
M0
0
1
0
1
1
= 0, when TR0/1=1, Timer0/1 will be enabled.
= 1, Timer0/1 x is enabled only while “/INTx” pin is high and “TR0/1” control bits is
set. That x=0 or 1.
= 0, active as timer function; (Default)
= 1, active as counter function.
C//T
Bit6
13-bit timer/counter for Timer0 and Timer1
16-bits timer/counter for Timer0 and Timer1
8-bits timer/counter with automatic reload for Timer0 and Timer1
(Timer 0) TL0 is 8-bit timer/counter, TH0 is locked into 8-bit timer
(Timer 1) Timer/Counter1 Stopped
Megawin Technology Co., Ltd.
Timer-1
Bit5
M1
Preliminary
Bit4
M0
Operating Mode
GATE
Bit3
ver 1.3
C//T
Bit2
Date: 2009-JAN-20
Timer-0
MG87FE/L52
Bit1
M1
Bit0
M0
15

Related parts for mg87fe