I'm wanting to generate two pwm signals (125Hz @ 25% Duty Cycle) and (250Hz @ 25% Duty Cycle) continuously on two pins in a assembly program. I'm having trouble figuring out the prescaler I need to achieve these low frequencies and the values needed to set the OCRx register for my duty cycle. I've been trying to run some calculations using the following formula but I can't seem to achieve 125Hz with any of the prescalers listed in the datasheet for the timers (8,64,256,1024). I have a 16MHz external clock coming into my 328P chip. Am I going about determining these values the wrong way? How do I solve for these values to set the registers for the timers? Also do I need to be careful about which pins I choose if I want pwm signals emitting continuously at the same time from two pins?
Frequency I need = Freq_Osc / 256*N
N = Presacler
Freq_Osc = Frequency of Oscillator or External Clock in my case