Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pwm resolution concept

Status
Not open for further replies.
Iam bit confused with pwm resolution in pic controllers. Generally i am using the following equation to calculate ptper reguster
Frequency of clock/ pwm frequency = ptper value. The duty cycle is loaded based on the value of ptper value

Pdc = ptper * duty cycle / 100.
Now my confusion is the pwm resolution. What exactly is this, should i calculate everytime. Please advise.
 
Try to think of it this way...

- Timer 2 will count until it equals PR2 and then it starts again this is the frequency..

- CCPRxL combined with the two DCB bits in the CCPxCON determine when the pin is high or low..

- If Timer 2 < CCPRxL + DCB1+DCB2 then the pin is high otherwise the pin is low...

The best explanation is in the pic12f1840 datasheet....

Don't let the register name upset you... These are the original names...

Once the ptper (PR2 ) is set and the Timer is configured... All you need to change is the CCPRxL ( OCxR) register.

What chip are you actually using...
 
Iam bit confused with pwm resolution in pic controllers. Generally i am using the following equation to calculate ptper reguster
Frequency of clock/ pwm frequency = ptper value. The duty cycle is loaded based on the value of ptper value

Pdc = ptper * duty cycle / 100.
Now my confusion is the pwm resolution. What exactly is this, should i calculate everytime. Please advise.

You can think of resolution like the number of segments needed for the 'period' of time, so for 10 bit there are 1024 segments.
A 50% duty cycle means that for 512 segments the signal is on and for 512 segments is off.
 
If you perfectly low-pass filter the PWM signal to a DC level, and the PIC is powered with 5.000Vcc, then you get 1023 = ((2^10)-1) equal steps from 0V to 5.000V*1023/1024 = 4.995V. The step size is 4.995V/1023 = 0.00488V
 
Last edited:
Hello Pradeep. Your question should really be posted in its own (new) thread; not appended to an existing thread which discusses a different topic...

In LTSpice, there is a generic multi-winding transformer model which can be customized with a few parameters. I dont know how to do that in Proteus.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top