CMOS
Advanced Member level 3
Non-linearity in PWM
Hi,
I am using PWM output of P89C51RD2 to generate variable voltage in one of my applications. The PWM5 (P1.7) output of uC is connected to passive R-C (18k - 2.2uF) LPF circuit followed by op-amp ampilfier and buffer using LM358.
The full scale output is at PWM register value = 255 (99.9% duty cycle) adjusted to 7.5V by adjusting gain of op-amp.
Now if I want 5V outtput, the PWM register value required should be 255*5V/7.5V = 170. But I am getting 5V output at PWM register value = 202 !
Same is the case with 5.5V. It should be obtained at 187 but it is obtained at 214 !
What is causing this non-linearity? Can anyone please explain?
Hi,
I am using PWM output of P89C51RD2 to generate variable voltage in one of my applications. The PWM5 (P1.7) output of uC is connected to passive R-C (18k - 2.2uF) LPF circuit followed by op-amp ampilfier and buffer using LM358.
The full scale output is at PWM register value = 255 (99.9% duty cycle) adjusted to 7.5V by adjusting gain of op-amp.
Now if I want 5V outtput, the PWM register value required should be 255*5V/7.5V = 170. But I am getting 5V output at PWM register value = 202 !
Same is the case with 5.5V. It should be obtained at 187 but it is obtained at 214 !
What is causing this non-linearity? Can anyone please explain?