View previous topic :: View next topic |
Author |
Message |
kkobraa
Joined: 28 Sep 2003 Posts: 9 Location: AR, USA
|
How to setup 3 single PWM outputs in PIC18F4220? |
Posted: Wed Feb 09, 2005 12:38 pm |
|
|
Hi,
I'm using PIC18F4220 and don't know how to setup 3 independent PWM outputs. The datasheet from MicroChip introduces the "enhanced PWM", but I really don't know how to set it up. Everytime I tried, I got only 2 PWM outputs at CCP1 and CCP2.
Does anyone know how to set it up?
Thanks in advance
Ken. |
|
|
bluetooth
Joined: 08 Jan 2005 Posts: 74
|
|
Posted: Wed Feb 09, 2005 2:26 pm |
|
|
Ken:
Without looking in great detail, I think the 4420 has four PWM outputs, but they're intended to be used to drive various bridge configurations. Doesn't look like you can program three different, simultaneous duty cycles.
Look at the 4431 - it has what you want and will most likely drop in the same socket as the 4420 you're using now.
Good luck.... |
|
|
kkobraa
Joined: 28 Sep 2003 Posts: 9 Location: AR, USA
|
|
Posted: Wed Feb 09, 2005 3:01 pm |
|
|
Thanks for your reply.
I looked at the datasheet of 4431. It also has only 2 PWMs.
What if I generate another PWM using TIMER2? Is it possible to do this? If so, can someone show me how?
Thanks again.
Ken. |
|
|
bluetooth
Joined: 08 Jan 2005 Posts: 74
|
|
Posted: Wed Feb 09, 2005 4:29 pm |
|
|
Ken:
Look at the 4431 data sheet again....
Figure 17-1 shows FOUR discrete PWM generators in the Power Control Module.
This is what you want! |
|
|
|