Level 1 — Basic calculation
PWM Timer: Frequency, Duty Cycle & Resolution
Timer TOP and compare values, actual frequency, resolution, duty step and average output of a microcontroller PWM, with the waveform.
How it works — PWM Timer: Frequency, Duty Cycle & Resolution
Inputs
- D
- Duty cycle (%)
- T
- Target PWM frequency (kHz)
Formula
- f = f_clk/(N·(TOP + 1))
- bits = log₂(TOP + 1)
- V_avg = D·V
- V_rms = √D·V
Results
- Vavg
- Average output voltage
- ton
- Actual duty cycle
Inputs
Results
Enter your values and press Calculate. The defaults are a worked example.
Formula
f = f_clk/(N·(TOP + 1)) · bits = log₂(TOP + 1) · V_avg = D·V · V_rms = √D·V
Formulas are evaluated in SI units; inputs and results are converted.
Show the math
Worked solution
Press Calculate to see every step with your values substituted.
Calculation level & design standard
Level 1 — Basic calculation
A direct engineering equation.
Preliminary engineering calculation — no jurisdiction-specific code compliance claimed. Verify the applicable requirements with a qualified professional.
Assumptions
- Up-counting (fast PWM) timer; ideal square-wave output.
References
- Microchip AVR / ST STM32 reference manuals — timer chapters
Results are for preliminary design and education. Verify against the governing code and have critical work checked by a licensed professional engineer.
More Electrical Engineering tools
- Electrical Engineering DC Motor Speed, Torque & PWM Drive Steady-state speed, current, back-EMF, power and efficiency of a permanent-magnet or separately excited DC motor driven by a PWM duty cycle. Open tool
- Electrical Engineering ADC / DAC Resolution, Sampling & Aliasing LSB size, output code, ideal SQNR, Nyquist frequency, aliasing and data rate of an analog-to-digital converter, with a sampling chart. Open tool
- Electrical Engineering UART Baud-Rate Divisor & Error Baud-rate divisor, actual baud rate and error of a UART for a clock and oversampling, with bit time and throughput. Open tool
- Electrical Engineering PID Controller Step Response (Closed-Loop Simulation) Simulate a PID loop on a first-order-plus-dead-time or second-order plant: step response, overshoot, rise and settling time, steady-state error, actuator limits and SIMC tuning. Open tool