개발 환경 및 실습도구
- Software
- STM32CubeIDE 1.16.1
- Repository: STM32Cube_FW_F4_V1.28.1
- Hardware
STM32CubeMX
Pinout & Configuration
System Core
- SYS
- RCC
- High Speed Clock (HSE): Crystal/Ceramic Resonator
LED가 연결된 PE13 핀으로 사용할 수 있는 TIM을 설정합니다.

Timers
TIM1을 다음과 같이 설정합니다.
- TIM1
- TIM1 Mode and Configuration
- Channel3: PWM Generation CH3
- Configuration
- Parameter Settings
- Counter Settings
- Prescaler (PSC - 16 bits value): 420-1
- Counter Mode: Up
- Counter Period (AutoReload Register - 16 bits value ): 2000-1
- Internal Clock Division (CKD): Division by 4
- PWM Generation Channel 3
- Mode: PWM mode 1
- Pulse (16 bits value): 0
- Output compare preload: Enable
- Fast Mode: Disable
- CH Polarity: High
- CH Idle State: Reset
- User Constants
- NVIC Settings
- DMA Settings
- GPIO Settings
$$
UpdateEvent = \frac{Timer_{clock} / 4}{(Prescaler+1)(Period+1)} \quad\quad
$$