I am trying to follow some guides (for instance this) to generate some analog signals (for instance a sine wave of 50 Hz) with Arduino (but my questions are general).
But I have two basic questions:
1) The author of the guide chooses to generate that sine wave starting from a PWM signal of 31372Hz. As I understood, it is possible to choose an arbitrary frequency (with some limits obviously) since it is determined by some settings on the MCU internal timers. How do we choose it? Does its choice depend on the low - pass filter we decide to apply?
2) The guide shows the procedure for generating the first half wave on a pin, and the second half wave on another pin. Then, the voltage difference between them is taken, with a circuit called "H bridge". Is there any method to generate the full waveform directly on a single pin?