
ST52T430/E430
10 PWM/TIMER
ST52x430
offers
three
on-chip
PWM/Timer
peripherals:TIMER0, TIMER1 and TIMER2.
The ST52x430 timers have the same internal
structure. The timer consists of an 8-bit counter
with a 16-bit programmable prescaler, giving a
Figure 10.1 Timer Peripheral Block Diagram
Next, the generic timer is called Timer x, where x
can be 0, 1 or 2.
Each timer has two different working modes, which
can be selected by setting the correspondent
TxMODE bits of REG_CONF5, REG_CONF8 and
REG_CONF10 registers: Timer Mode and PWM
(Pulse Width Modulation) Mode.
All Timers have Autoreload Functions in PWM
Mode.
Each
timer
output
is
available,
with
its
complementary signal on external pins by setting
PAx
and
PCx
bits
of
REG_CONF12
and
Note: In order to enable timer output (TxOUT or
TxOUT) the related pin must be configured in
Output Mode by setting REG_CONF4 and
In particular, TIMER0 can also use external
START/STOP signals (Input capture and Output
compare), external RESET signal and external
CLOCK: PA4/T0STRT, PA0/T0RES and PA5/
T0CLK pins.
Note: In order to use T0RST, T0STR, T0CLK
external signals the related pins must be
configured
in
Input
Mode
by
setting
REG_CONF4 and REG_CONF7 registers (see
For each timer, the content of the 8-bit counter is
incremented on the Rising Edge of the 16-bit
prescaler output (PRESCOUT) and it can be read
at any instant of the counting phase, saved in a
location of RAM memory. The PWM/Timer x
Counter value can be read from the Input Register
PWM_x_COUNT (Input Registers 12, 14 or 16.
The PWM/Timer x Status can be read from the
Input Register PWM_x_STATUS (Input Registers
10.1 Timer Mode
Timer Mode is selected by fixing the TxMODE bit
of
REG_CONF5,
REG_CONF8
and
Each TIMERx requires three signals: Timer Clock
(TMRCLKx), Timer Reset (TxRES) and Timer Start
can be generated internally, or, only for Timer 0,
externally by setting T0RST, T0STR, T0CLK bits of
REG_CONF7 register.
TMRCLKx is the Prescaler x output, which
increments the Counter x value on the rising edge.
TMRCLKx is obtained from the internal clock
signal (CLKM) or, only for TIMER0, from the
external signal provided on the PA5/T0CLK pin.
BIT0
BIT1
BIT2
BIT3
BIT4
BIT5
BIT14
BIT15
BIT3
BIT0
BIT1
BIT2
BIT6
BIT4
BIT5
BIT7
17- 1MULTIPLEXER
16-BITPRESCALER
8-BITCOUNTER
PRESCx
CLKM
TMRCLK
TxRES
TxSTRT