Reading about the arduino analogWrite function I have come to understand that it uses PWM for the variable DC voltage. (by controlling the width of the pulse)
However how do we control the frequency of the pulse? I came across a few articles about the same but couldn't get them. Any help is appreciated.
Moreover how effective is it to use that analogWrite voltage as say a biasing voltage? Or maybe as a variable Vcc itself. Does the fact that DC is obtained via PWM will effect underlying circuitry expected working (where the underlying circuitry is anything one can do with a transistor)
Best Answer
Changing PWM frequency is not directly supported by Arduino command set, but it can be done. For this you need to know a couple of things:
On top of that, some of the PWM pins are attached to timer0, which is heavily relied upon for other system tasks (like
delay();
). So fiddling with PWM may change the execution speed of some code.