View previous topic :: View next topic |
Author |
Message |
chingB
Joined: 29 Dec 2003 Posts: 81
|
PWM Inquiry? |
Posted: Thu Feb 19, 2004 5:42 am |
|
|
Hi,
Is it possible to have a PWM using an interrupt? Can I use #int_ccp1 or other interrupt that will work with PWM?
I need your inputs about this.
Thank u. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Feb 19, 2004 10:34 pm |
|
|
If I use my favorite tool, http://www.google.com
and search for: 16F84 pwm int char
I find this code:
http://web.media.mit.edu/~stefanm/yano/picc_cheeks.html
This would appear to be software PWM, that is done with
the int_rtcc interrupt. Exactly what you are asking for.
How did I know to use those search terms with Goggle ?
1. I picked 16F84, because it's a PIC that does not
have hardware PWM. And, it's a very common PIC.
2. Search for PWM because that's what we're looking for.
3. Search for int and char, because we're looking for C
source code.
It's just lucky that the first link found by Google just
happens to use CCS. But also, CCS is a very popular
low cost compiler, so it's likely that CCS code will be
available on the net.
Using the techniques described above, you can use
Google to find the source code that you need. |
|
|
SteveS
Joined: 27 Oct 2003 Posts: 126
|
|
Posted: Fri Feb 20, 2004 7:23 am |
|
|
Good tip on using int and char to find C source. Using just 'C' doesn't always work so well.
It's the simple things that are hard....
- SteveS |
|
|
|