PWM-frequency-timer

hello,

I'm working on Arduino Due board.

Talking about PWM signal, i want to achieve, as output on pins 7,8,9, a duty cycle with a frequency that could change from 20 Hz to 500 Hz, chosen by user. Is it possible?

I saw that i can change pwm frequency for these pins changing the pin divisor. I would like to use these just to set the timer, and after change the duty cycle frequency as i prefer.

thank you in advance

You cannot change the frequency once the sketch is running as it is set in void setup(). However you can change the duty cycle which you could use to create a pseudo frequency change. But you are not actually changing the frequency, only the duty cycle.

Bill