EasyManua.ls Logo

ST STM32G474 User Manual

ST STM32G474
2126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1261 background imageLoading...
Page #1261 background image
RM0440 Rev 4 1261/2126
RM0440 General-purpose timers (TIM2/TIM3/TIM4/TIM5)
1343
in the TIMx_CR1 register. Moreover, the DIR and CMS bits must not be changed at the
same time by the software.
Writing to the counter while running in center-aligned mode is not recommended as it
can lead to unexpected results. In particular:
The direction is not updated if a value greater than the auto-reload value is written
in the counter (TIMx_CNT>TIMx_ARR). For example, if the counter was counting
up, it continues to count up.
The direction is updated if 0 or the TIMx_ARR value is written in the counter but no
Update Event UEV is generated.
The safest way to use center-aligned mode is to generate an update by software
(setting the UG bit in the TIMx_EGR register) just before starting the counter and not to
write the counter while it is running.
Dithering mode
The PWM mode effective resolution can be increased by enabling the dithering mode, using
the DITHEN bit in the TIMx_CR1 register. This applies to both the CCR (for duty cycle
resolution increase) and ARR (for PWM frequency resolution increase).
The operating principle is to have the actual CCR (or ARR) value slightly changed (adding
or not one timer clock period) over 16 consecutive PWM periods, with predefined patterns.
This allows a 16-fold resolution increase, considering the average duty cycle or PWM
period. The Figure 390 below presents the dithering principle applied to 4 consecutive PWM
cycles.
Figure 390. Dithering principle
When the dithering mode is enabled, the register coding is changed as following (see
Figure 391 for example):
The 4 LSBs are coding for the enhanced resolution part (fractional part).
The MSBs are left-shifted by 4 places and are coding for the base value. In 16-bit
mode, the 16-bit format is maintained.
MSv45752V1
1 clock cycle
Average duty cycle
75
DC = 7/5
DC = (7+¼)/5
DC = (7+½)/5
DC = (7+¾)/5
DC = 8/5

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the ST STM32G474 and is the answer not in the manual?

ST STM32G474 Specifications

General IconGeneral
SeriesSTM32G4
Core ProcessorARM Cortex-M4
Core Size32-bit
Max CPU Frequency170 MHz
Flash Memory512 KB
SRAM128 KB
GPIO Pins51
ADC Resolution12-bit
DAC Resolution12-bit
Operating Voltage1.7V to 3.6V
Communication InterfacesI2C, SPI, USART, USB
Operating Temperature-40°C to 85°C
PackageLQFP64, LQFP48
ConnectivityUSB, CAN
PeripheralsADC, DAC
Oscillator TypeInternal, External

Related product manuals