This is an example to
1. Generate PWM signal on PB1 pin using TIM3 Channel 4
2. To blink LED on PD12 pin using TIM7 interrupt @ 20Hz (10Hz blinking)
Used STM32 Cube mx ( STM32CubeMX v5.6.1 ) and Keil uVision v5.29
Tool suite is MDK-ARM from keil
If you need to drive a motor with this PWM, using L298 motor driver or similar, you must connect two more GPIO pins configured as digital outputs to control motor direction. Suggested to use PD13 and PD14 as they have LEDs mounted on STM32F4 Discovery board.
Download
0 formats
No download links available.
STM32F4 PWM and timer interrupt example using STM32F4 Discovery | NatokHD