• Experiments with timers:
    Experiment 1:
    Setup A0 at 50hz, Duty cycle 20%
    Setup A1 at 50hz, Duty cycle 40%
    Setup A2 at 50hz, Duty cycle 60%
    Setup A3 at 50hz, Duty cycle 80%
    Using isTimerEnabled3.js modify lines 168..172

    analogWrite(A0,0.2,{ freq : 50 }); 
    analogWrite(A1,0.4,{ freq : 50 }); 
    analogWrite(A2,0.6,{ freq : 50 }); 
    analogWrite(A3,0.8,{ freq : 50 });
    Results:
    Timer 5 Enabled
    CR1=81
    CR2=0
    SMCR=0
    DIER=0
    SR=f
    EGR=0
    CCMR1=6868
    CCMR2=6868
    CCER=1111
    CNT=d9ba
    PSC=15
    ARR=ffae
    CCR1=3322
    CCR2=6645
    CCR3=9968
    CCR4=cc8b
    DCR0
    DMAR=81
    
    

    Confirm with scope on pins A0, A1, A2, and A3.
    All outputs are 50 Hz.
    A0 duty cycle is 20%, A1 duty cycle is 40%, A2 duty cycle is 60%, A3 duty cycle is 80%
    Modify the A3 line and change the frequency to 10 hz

    analogWrite(A0,0.2,{ freq : 50 }); 
    analogWrite(A1,0.4,{ freq : 50 }); 
    analogWrite(A2,0.6,{ freq : 50 }); 
    analogWrite(A3,0.8,{ freq : 10 });
    Results:
    Timer 5 Enabled
    CR1=81
    CR2=0
    SMCR=0
    DIER=0
    SR=11
    EGR=0
    CCMR1=6868
    CCMR2=6868
    CCER=1111
    CNT=28fd
    PSC=6d
    ARR=ffae
    CCR1=3322
    CCR2=6645
    CCR3=9968
    CCR4=cc8b
    DCR0
    DMAR=81
    
    

    Use scope on pins A0, A1, A2, and A3 to check frequency and duty cycle.
    All outputs are 10 Hz.
    A0 duty cycle is 20%, A1 duty cycle is 40%, A2 duty cycle is 60%, A3 duty cycle is 80%
    Timer 5 values differ in the PSC registers for each case.
    PSC at 10Hz is x6d, PSC at 50Hz is 0x15, converting to decimal give 109 and 21.
    109/21 ~= 5

    Design consideration:
    If you need PWM outputs with different frequencies, you will need to select pins that use different timers for different frequencies.

About