This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F2812 PWM DAC

Hi everyone,

I generated the sinewave pwm and I passed the output via 1st order Low Pass Filter. I am getting almost a sinewave. The Resistance & Capacitance values what i used is 10k & 1nF. Resultant signal i am getting 2V and 60microseconds.

But when i try same for triangular & Ramp i am getting both looking a triangular waveform.???

Am I doing in the right manner are else i have to change anything???

  • Umesh,

    I have two comments that may help lead you to your issue:

    1) Have you looked at the output of the PWM (the signal between the PWM pin of the MCU and the RC-filter)?  It should be a square wave that looks roughly like this with a sinusoidal PWM (http://masters.donntu.edu.ua/2007/fema/rudenko_y/library/art9/fig4.gif).  A PWM-simulated ramp (or PWM-simulated triangle wave) would look similar but with a different progression of duty cycles within the output signal frequency.

    2) According to some rough calculations your cutoff frequency appears to be ~16kHz.  This seems low to me.  The cutoff frequency of your filter should ideally be between the PWM frequency and the maximum desired frequency of your output signal (but closer to the PWM frequency).  You may want to check on this.

    This appnote may be useful:
    AppNote Here


    Thank you,
    Brett

  • Hi Brett,

    Thanks for your valuable reply..

    I have gone through the application note.. I will try with PWM frequency frequency of 100KHz and & I will design my filter with cutoff frequency say 80KHz..

    Thanks & regards,

    Umesh T