PDA

View Full Version : 12F683 HPWM Usage



MARAD75
- 14th November 2007, 20:57
I am using a 12F683 to use the PWM module in it. I am strictly limited to an 8 pin device due to size constraints and PCB layout.
I realize that the CCP1 pin is GP2. What I need to do is occasionally use another pin, such as GP5 for the PWM output. Is this even possible with this device? If so, does anyone have information and maybe sample code so that this can be done with PBP?
There is only one pin to be used for the HPWM output at a time. (either GP2 OR GP5) They will never be used together at the same time in this setup!
If it is not possible to do this with the 12F683, can anyone suggest another 8 pin chip that may have this capability?
Thanks for the help!
Ron

BrianT
- 14th November 2007, 21:09
The data sheet for the 12F683 shows no CCP multiplex facility. That means the HPWM signal can only ever appear at pin 5.

You can of course generate software PWM on any output pin but this will not run in background in the way that HPWM will.

HTH
Brian

mister_e
- 15th November 2007, 02:16
If i remind correctly the 12f615 allow an alternate PWM output as it have a ECCP module built-in... weird for a 8 pin device. But read the datasheet first as i'm not 100% it will work as you expect. Maybe the alternate pin will ONLY work in Half-bridge mode...
<hr>
EDIT yup, by the datasheet, it seems to work only when used in half-bridge mode...