
The STM32 PWM_2 example program shows how to configure and use the timer TIM4 of STMicroelectronics STM32F103xx microcontroller to generate pulse-width modulation.
TIM4 is configured to generate an update interrupt every 100 ms. On every update interrupt the duty cicles of channel 3 and channel 4 are changed. The result is that the LEDs PB8 and PB9 are pulsating.
The configuration of the clocks and the timer TIM4 is done using the Configuration Wizard in file STM32_Init.c.
Two µVision targets are available:
The example is tesed with the Keil Evaluation Board MCBSTM32.
Download File