![](http://datasheet.mmic.net.cn/290000/ST90T158M9LVT6_datasheet_16157244/ST90T158M9LVT6_130.png)
130/199
ST90158 - STANDARD TIMER (STIM)
9.4 STANDARD TIMER (STIM)
Important Note:
This chapter is a generic descrip-
tion of the STIM peripheral. Depending on the ST9
device, some or all of the interface signals de-
scribed may not be connected to external pins. For
the list of STIM pins present on the particular ST9
device, refer to the pinout description in the first
section of the data sheet.
9.4.1 Introduction
The Standard Timer includes a programmable 16-
bit down counter and an associated 8-bit prescaler
with Single and Continuous counting modes capa-
bility. The Standard Timer uses an input pin (STIN)
and an output (STOUT) pin. These pins, when
available, may be independent pins or connected
as Alternate Functions of an I/O port bit.
STIN can be used in one of four programmable in-
put modes:
– event counter,
– gated external input mode,
– triggerable input mode,
– retriggerable input mode.
STOUT can be used to generate a Square Wave
or Pulse Width Modulated signal.
The Standard Timer is composed of a 16-bit down
counter with an 8-bit prescaler. The input clock to
the prescaler can be driven either by an internal
clock equal to INTCLK divided by 4, or by
CLOCK2 derived directly from the external oscilla-
tor, divided by device dependent prescaler value,
thus providing a stable time reference independ-
ent from the PLL programming or by an external
clock connected to the STIN pin.
The Standard Timer End Of Count condition is
able to generate an interrupt which is connected to
one of the external interrupt channels.
The End of Count condition is defined as the
Counter Underflow, whenever 00h is reached.
Figure 64. Standard Timer Block Diagram
n
STOUT
1
EXTERNAL
INTERRUPT
1
INPUT
&
CLOCK CONTROL LOGIC
INEN INMD1 INMD2
STP
8-BIT PRESCALER
STH,STL
16-BIT
DOWNCOUNTER
STANDARD TIMER
CLOCK
OUTMD1 OUTMD2
OUTPUT CONTROL LOGIC
INTERRUPT
CONTROL LOGIC
END OF
COUNT
INTS
INTERRUPT REQUEST
CLOCK2/x
STIN
1
(See Note 2)
Note 2:
Depending on device, the source of the INPUT & CLOCK CONTROL LOGIC block
may be permanently connected either to STIN or the RCCU signal CLOCK2/x. In devices without STIN and CLOCK2, the
INEN bit must be held at 0.
INTCLK/4
MUX
Note 1:
Pin not present on all ST9 devices
.
9