ST52F513G3M6 STMicroelectronics, ST52F513G3M6 Datasheet - Page 75

ST52F513G3M6

Manufacturer Part Number
ST52F513G3M6
Description
Manufacturer
STMicroelectronics
Datasheet

Specifications of ST52F513G3M6

Cpu Family
ST52
Device Core Size
8b
Frequency (max)
20MHz
Interface Type
I2C/SCI/SPI
Program Memory Type
Flash
Program Memory Size
8KB
Total Internal Ram Size
256Byte
# I/os (max)
22
Number Of Timers - General Purpose
2
Operating Supply Voltage (typ)
3.3/5V
Operating Supply Voltage (max)
5.5V
Operating Supply Voltage (min)
2.7V
On-chip Adc
8-chx10-bit
Instruction Set Architecture
CISC
Operating Temp Range
-40C to 85C
Operating Temperature Classification
Industrial
Mounting
Surface Mount
Pin Count
28
Package Type
SO
Lead Free Status / Rohs Status
Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ST52F513G3M6
Manufacturer:
ST
0
Part Number:
ST52F513G3M6
Manufacturer:
ST
Quantity:
20 000
Part Number:
ST52F513G3M6TR
Manufacturer:
ST
Quantity:
20 000
Figure 12.4 PWM Mode with Reload
12.3 PWM Mode
The PWM working mode for each timer is obtained
by setting the TxMOD bit of the Configuration
Register PWMx_CR1.
The TxOUT signal in PWM Mode consists of a
signal with a fixed period, whose duty cycle can be
modified by the user.
The TxOUT period is fixed by setting the 16-bit
Prescaler bits (TxPRESC) in the PWMx_CR2 and
the 16-bit Reload value by writing the relative
Output Registers couple PWMx_RELOAD_x. The
16-bit Prescaler divides the master clock CLKM by
powers of two, determining the maximum length
period.
Reload determines the maximum value that the
counter can count before starting a new period.
The use of the two 16-bit values allows the TxOUT
period to be set with more precision when needed.
By decreasing the Reload value the counting
resolution decreases. In order to obtain the
maximum resolution, Reload value should be set
to 0FFFFh and the period corresponds to the one
established by the Prescaler value.
The value set in the 16-bit counter by writing the
Counter Output Registers couple, determines the
duty-cycle: when count reaches the Counter value
the TxOUT signal changes from high to low level.
The period of the PWM signal is obtained by using
the following formula:
T=PWMx
where TxPRESC equals the value set in the
TxPRESC bits of the PWMx_CR2 Configuration
Register and TMRCLKx is the period of the Timer
clock that drives the Prescaler.
The duty cycle of the PWM signal is obtained by
the following formula:
-
RELOAD * 2
TxPRESC
Counter
Reload
65535
Value
Value
Output
PWM
0
*TMRCLKx
Ton
T
Note: the PWM_x_COUNT value must be lower
than or equal to the PWM_X_RELOAD
When it is equal, the TxOUT signal is always at
high level. If the Output Register PWM_x_COUNT
is 0, TxOUT signal is always at a low level.
By using a 20 MHz clock a PWM frequency that is
close to 305 Khz can be obtained with a reload
equal to FFFFh and the Prescaler set to 0000h.
The TIMER0 clock CLKM can also be supplied
with an external signal, applied on the TCLK pin,
which must have a frequency that is at least two
times smaller than the internal master clock.
Note: The Timers have to complete the previous
counting phase before using a new value of the
Counter. If the Counter value is changed during
counting, the new values of the timer Counter are
only used at the end of the previous counting
phase. The Counter buffer is written in two steps
(one byte per time) and is latched only after the
LSB is written. In order to avoid side effects, the
user should write the MSB before writing the LSB.
By only writing the LSB, the PWM/Timer is used as
an 8 bit counter. The same mechanism is applied
to the two bytes of Reload but, differently of the
Counter it is set immediately. Nevertheless, it is
recommended that the Reload value be written
when the Timer is stopped in order to avoid
incongruence with the Counter value. The same
recommendation is made when reading the two
bytes of the counter: It is performed in two steps,
so if the timer is running, the carry of the LSB to the
MSB can cause the wrong 16-bit value reading. A
Reload value greater than 1 must always be used.
d
cycle
=
T
------- -
T
on
=
t
ST52510xx ST52513xx
t
----------------------------------------- -
PWMxRELOAD
PWMxCOUNT
value.
75/136

Related parts for ST52F513G3M6