datasheetbank_Logo
数据手册搜索引擎和 Datasheet免费下载 PDF

P80C557E6EBB 查看數據表(PDF) - Philips Electronics

零件编号
产品描述 (功能)
比赛名单
P80C557E6EBB
Philips
Philips Electronics Philips
P80C557E6EBB Datasheet PDF : 64 Pages
First Prev 21 22 23 24 25 26 27 28 29 30 Next Last
Philips Semiconductors
Single-chip 8-bit microcontroller
Product specification
P83C557E6/P80C557E6
6.7 Timer / Counters
The P8xC557E6 contains three 16-bit timer/event counters: Timer 0,
Timer 1 and Timer T2 and one 8-bit timer, T3. Timer 0 and Timer 1
may be programmed to carry out the following functions:
Measure time intervals and pulse durations
Count events
Generate interrupt requests
6.7.1 Timer 0 and Timer 1
Timers 0 and 1 each have a control bit in SFR TMOD that selects
the timer or counter function of the corresponding timer.
In the timer function, the register is incremented every machine
cycle. Thus, one can think of it as counting machine cycles. Since a
machine cycle consists of 12 oscillator periods, the count rate is
1/12 of the oscillator frequency.
In the counter function, the register is incremented in response to a
1-to-0 transition at the corresponding external input pin, T0 or T1. In
this function, the external input is sampled during S5P2 of every
machine cycle. When the samples show a HIGH in one cycle and a
LOW in the next cycle, the counter is incremented. Thus, it takes
two machine cycles (24 oscillator periods) to recognize a 1-to-0
transition. There are no restrictions on the duty cycle of the external
input signal, but to insure that a given level is sampled at least once
before it changes, it should be held for at least one full machine
cycle.
Timer 0 and Timer 1 can be programmed independently to operate
in one of four modes:
Mode 0: 8-bit timer or 8-bit counter each with divide-by-32
prescaler
Mode 1: 16-bit time-interval or event counter
Mode 2: 8-bit time-interval or event counter with automatic
reload upon overflow
Mode 3: -Timer 0: one 8-bit time-interval or event counter
and one 8-bit time-interval counter
-Timer 1: stopped
When Timer 0 is in Mode 3, Timer 1 can be programmed to operate
in Modes 0, 1 or 2 but cannot set an interrupt request flag or
generate an interrupt. However the overflow from Timer 1 can be
used to pulse the serial port baud-rate generator.
With a 16 MHz crystal, the counting frequency of these
timer/counters is as follows:
In the timer function, the timer is incremented at a frequency of
1.33 MHz - a division by 12 of the system clock frequency
0 Hz to an upper limit of 0.66 MHz (1/24 of the system clock
frequency) 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 durations.
When configured as a counter, the register is incremented on every
falling edge on the corresponding input pin, T0 or T1. The
incremented register value can be read earliest during the second
machine cycle after that one, during which the incrementing pulse
occurred.
The counters are started and stopped under software control. Each
one sets its interrupt request flag when it overflows from all HIGHs
to all LOWs (or automatic reload value), with the exception of mode
3 as previously described.
7
6
5
4
3
2
1
0
TMOD (89H)
GATE
C/T
M1
M0
GATE
C/T
M1
M0
Timer 1
Timer 0
Figure 19. Timer/Counter mode control (TMOD) register.
Table 12. Description of TMOD bits
SYMBOL
BIT
FUNCTION
Gate
TMOD.7
TMOD.3
Gating control when set. Timer/Counter “x” is enabled only while “INTx” pin is high and “TRx” control pin is set.
When cleared Timer “x” is enabled whenever “TRx” control bit is set.
C/T
TMOD.6 Timer or Counter Selector cleared for Timer operation (input from internal system clock). Set for Counter
TMOD.2 operation (input from “Tx” input pin).
M1
TMOD.5 Timer 0, Timer 1 mode select see Table 13.
TMOD.1
M0
TMOD.4
TMOD.0
Table 13.
M1
0
0
1
1
1
Timer 0 / Timer 1 operation select
M0
OPERATING
0
8048 Timer “TLx” serves as 5-bit prescaler.
1
16-bit Timer/Counter “THx” and “TLx” are cascaded; there is no prescaler.
0
8-bit auto-reload Timer/Counter “THx” holds a value which is to be reloaded into “TLx” each time it overflows.
1
(Timer 0) TL0 is an 8-bit Timer/Counter controlled by the standard Timer 0 control bits. TH0 is an 8-bit timer
only controlled by Timer 1 control bits.
1
(Timer 1) Timer/Counter 1 stopped.
1999 Mar 02
22

Share Link: 

datasheetbank.com [ Privacy Policy ] [ Request Datasheet ] [ Contact Us ]