PDA

View Full Version : 100KHz pwm



jmgelba
- 7th January 2009, 21:33
Hi folks, not visited the site in a while. I see this place is much more livelier!
I'm still using old skool v2.43 and 18F1320's. I need a 100KHz pwm, but the data sheet is saying max is 30 something KHz.
How can I get a 100KHz pwm out of a 1320, or if I cannot, what is a decent replacement part these days?

Darrel Taylor
- 7th January 2009, 22:55
PBP's HPWM command is limited to 32767 Hz, but you can easily get 100khz (and much higher) from the CCP module.
You just need to set the registers manually.

jmgelba
- 7th January 2009, 23:10
Not sure how to use the ccp yet - never needed to use it so far.
Is there a ccp tutorial with pbp sample code anywhere? A quick search dosent reveil too much.

Heads off to locate the manual.

Darrel Taylor
- 7th January 2009, 23:15
Bruce has a good explanation here.
It's for 38khz, but you just change the numbers for higher freqs. ...

Using The PIC Microcontroller Hardware PWM Feature & Infrared Communications
http://www.rentron.com/Infrared_Communication.htm

And for easy PWM calculations ...

mister_e's PicMultiCalc.
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2957
<br>

Charles Linquis
- 8th January 2009, 01:45
If you look at the "special use" label about 3/4 of the way down in this program, you can see how it is done.

http://www.picbasic.co.uk/forum/showthread.php?t=7986&highlight=monitor+program