# PWM frequency, resolution and duty # Scope: Ideal timer PWM rate and duty quantization; edge-aligned timer. # Status: illustrative worked example; engineering review pending. # Inputs are example values. Checks are editable example requirements, not standards. clock = 48000000 Hz prescaler = 48 periodCounts = 1000 compareCounts = 250 frequency := clock/(prescaler*periodCounts) [Hz] duty := compareCounts/periodCounts resolution := 1/periodCounts check compare within period: compareCounts <= periodCounts scenario alternative: clock = 3.84e+07 Hz