Figure 9.2 Timer 0 External START/STOP Mode
ST52T400/T440/E440/T441
Level
Edge
s ta rt
s ta rt
sto p
sto p
sta rt
s ta rt
R eset
C lo c k
C o u n te d
0
1
2
3
4
4
0
1
V a lu e
EDGE: After the reset, on the first TSTRT rising
edge, the TIMER starts counting and, at the next
rising edge, it stops. In this manner, the period of
an external signal may be measured.
The Timer output signal, TIMEROUT, is a signal
with a frequency equal to the 16 bit-Prescaler out-
put signal, TMRCLK, divided by the Output Regis-
ter PWM_COUNT value (8 bit) (Output Registers
9, Table 2.3), that is the value to count.
TIMEROUT waveform can be of two types:
type 1: TOUT waveform equal to a square wave
with a 50% duty-cycle
type 2: TOUT waveform equal to a pulse signal
with the pulse duration equal to the Prescaler out-
put signal.
Figure 9.3 TIMEROUT Signal Type
Prescout*Counter
Timer Output
Type1
Type2
The Timer output signal waveform type can be
selected by setting the correspondent TMRW bit
of REG_CONF6.
9.2 PWM Mode
PWM working mode is obtained by setting the cor-
respondent TMODE bit of REG_CONF5 to “1”.
TIMEROUT, in PWM Mode, consists of a signal,
with a fixed period, whose duty cycle can be mod-
ified by the user.
TIMEROUT signal is available on TOUT pin and
TIMEROUT complementary signal is available on
TOUTN pin, setting the relative bits on PORT A,
REG_CONF12[1] and REG_CONF12[2], to “0”
and REG_CONF4[6] and REG_CONF4[2] to “0”.
The PWM TIMEROUT period can be fixed by set-
ting the 16-bit prescaler output and an initial
autoreload 8-bit counter value stored in the Output
Register PWM_RELOAD, as illustrated in Figure
9.4. The Output Register PWM_RELOAD value is
automatically reloaded in the Counter when it
restarts counting.
NOTE: the Start/Stop and Set/Reset signals
should be moved together in PWM mode. If the
Start/Stop bit is reset during the PWM mode work-
ing, the TxOUT signal keeps its status until the
next start.
57/94