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 in 12F683?

Status
Not open for further replies.

MikeMl

Well-Known Member
Most Helpful Member
Using the 31kHz RC clock in a 12F683, can I run the CCP PWM such that the Period is 30.4Hz (2bits of Fosc concatenated with the 8 bits in PR2)? That is 31000/(4*255), which is a period of ~33ms?

If so, does than allow me to control the PW from (0/1024)*33ms to (1023/1024)*33ms using 8bits in CCPRL1 concatenated with CCP1CON<5:4>?
 
I have to believe that if you are running on the 31kHz RC, then the answer is yes.

You could get the full 10-bits by using the 1:1 prescaler [31000/(1*1020)]
 
Good, I'm building a battery charger for lead-acid batteries, and want to use the PWM to control the average voltage level across the battery terminals. Running at ~30Hz is fine for this application. I will make the PW inversely proportional to the difference between the actual battery voltage, and the desired temperature based on ambient temperature.
 
Status
Not open for further replies.

Latest threads

Back
Top