Philips Semiconductors
Product specification
P83C557E4/P80C557E4/P89C557E4
Single-chip 8-bit microcontroller
1999 Mar 02
22
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.
Figure 19. Timer/Counter mode control (TMOD) register.
7
6
54
321
0
TMOD (89H)
GATE
C/T
M1
M0
GATE
C/T
M1
M0
Timer 1
Timer 0
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
TMOD.2
Timer or Counter Selector cleared for Timer operation (input from internal system clock). Set for Counter
operation (input from “Tx” input pin).
M1
M0
TMOD.5
TMOD.1
TMOD.4
TMOD.0
Timer 0, Timer 1 mode select see Table 13.
Table 13.
Timer 0 / Timer 1 operation select
M1
M0
OPERATING
0
8048 Timer “TLx” serves as 5-bit prescaler.
0
1
16-bit Timer/Counter “THx” and “TLx” are cascaded; there is no prescaler.
1
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.