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.

Question on PIC PWM resolution

Status
Not open for further replies.

eblc1388

Active Member
I can't understand how the 5.5 bit resolution result in the image is calculated.

For PR2=0x17, that's 10111 in binary. Adding the two bits in CCP1CON to the right results in 1011111, which is the max possible value for duty cycle.

Therefore the possible value of duty cycle ranges from 0 to 1011111. But why is this 5.5 bit resolution?
 

Attachments

  • pic_pwm.gif
    pic_pwm.gif
    5 KB · Views: 187
Would 6.5 make you happier?

The expression should be log_base_2(96) = 6.58
96 is the number of possible values you get in the range [00.5F]
 
Papabravo said:
Would 6.5 make you happier?

The expression should be log_base_2(96) = 6.58
96 is the number of possible values you get in the range [00.5F]

Thanks for the clarification.

This "5.5 bit resolution" information appeared in Microchip datasheets and both the 16F and 18F Reference Manuals spanning several years(1997~2001) so I thought I better ask.
 
It's a good catch! Bravo
 
Status
Not open for further replies.

Latest threads

Back
Top