English
Language : 

MV20556 Datasheet, PDF (13/30 Pages) Mosel Vitelic, Corp – 8 - Bit MCU Mouse Controller
MOSEL VITELIC INC.
Preliminary
MV20556
Timer/Counter
Timer/Counter Overall
The MV20556 contains two 16-bit counters for
measuring time internals, measuring pulse widths,
counting events and generating precise, periodic
interrupt requests. Each can be programmed
independently to operate as an 8048 8-bit timer with
divide by 32 prescaler or as an 8-bit counter with divide
by 32 prescaler (Mode 0), as a 16-bit time-interval or
event counter (Mode 1), or as an 8-bit time-interval or
event counter with automatic reload upon overflow
(Mode 2).
Additionally, counter 0 can be programmed to a mode
that divides it into one 8-bit time-internal or event
counter and one 8-bit time-interval counter (Mode 3).
When counter 0 is in Mode 3, counter 1 can be
programmed to any of the three aforementioned
modes, although it cannot set an interrupt request flag
or generate an interrupt. This mode is useful because
counter 1's overflow can be used to pulse the serial
port's transmission-rate generator. Along with their
multiple operating modes and 16-bit precision, the
counters can also handle very high input frequencies.
These range from 3 MHz to 40 MHz (for 3 MHz to 40
MHz crystal) when programmed for an input that is a
division by 12 of the oscillator frequency and from 0 Hz
to an upper limit of 1 MHz (for 25 MHz crystal) when
programmed for external inputs. Both internal and
external inputs can be gated to the counter by a second
external source for directly measuring pulse widths.
The counters are started and stopped under software
control. Each counter sets its interrupt request flag
when it overflows from all ones to all zeros (or
auto-reload value). The operating modes and input
sources are summarized in right side Figures.
counter. TH1 holds the reload value. TL1 is
incremented. The value in TH1 is reload onto TL1 when
TL1 overflows from all ones.
Mode 3: Prevents incrementing of timer/counter
When counter 1's mode is reprogrammed to mode 3
(from mode 0, 1 or 2), it disables the incrementing of
crystal
oscillator
÷12
exteranl
source
TIMER 0
8
8
TH0
TL0
MODE 0: 8-bit timer/counter with prescaler
MODE 1: 16-bit timer/counter
MODE 2: 8-bit auto-reload timer/couner
crystal
oscillator
÷12
exteranl
source
TIMER 1
8
8
TH1
TL1
MODE 0: 8-bit timer/counter with prescaler
MODE 1: 16-bit timer/counter
MODE 2: 8-bit auto-reload timer/couner
Mode 0, 1 and 2
Overflow
(Interrupt
request)
flag 0
Overflow
(Interrupt
request)
flag 1
pulse
to
serial
port
crystal
oscillator
÷12
exteranl
8
source
TL0
Overflow
8
(Interrupt
TH0
request)
flag 1
Counter 1/Timer 1
Counter 1/Timer 1 can be configured in one of four
modes by software program code on the fly:
Mode 0: 8-bit timer/counter with prescaler
Provides an 8-bit counter with a divide-by-32 prescaler
or an 8-bit timer with a divideby-32 prescaler.
MODE 3: 8-bit timer/counter
crystal
oscillator
÷12
exteranl
source
TIMER 1
8
8
TH1
TL1
Overflow
(Interrupt
request)
flag 0
Mode 1: 16-bit timer/counter
Configures counter 1 as a 16-bit timer/counter.
Mode 2: 8-bit auto-reload timer/counter
MODE 0: 8-bit timer/counter with prescaler
MODE 1: 16-bit timer/counter
MODE 2: 8-bit auto-reload timer/couner
Configures counter 1 as an 8-bit auto-reload timer/
Specifications subject to change without notice, contact your sales representatives for the most recent information.
Mode 3
13/27
pulse
to
serial
port
PID256** 07/97