CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Dual PWM at SAME frequency different duty cycles

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
vsmguy



Joined: 13 Jan 2007
Posts: 91

View user's profile Send private message Visit poster's website

Dual PWM at SAME frequency different duty cycles
PostPosted: Sun Jan 14, 2007 11:33 am     Reply with quote

Guys

Did a lot of homework and got incremental and HBridge controller working for my DC Geared motor control system.

Now I am finding reason to focus on the firmware, but am really confused if I can get the PIC16F877A/PIC18F4550 to output 2 PWM at SAME frequency (the freq at which the HBridge is driven) but at 2 different duty cycles (to control the RPM of the two motors)...

Is is possible to have two different duty cycles of the same freq from two different pins of a PIC.

I am obviously asking about hardware PWM as a software solution would tie up the PIC too much AFAIC...

Do get back.

Vimal
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 14, 2007 12:40 pm     Reply with quote

Quote:

If I can get the PIC16F877A/PIC18F4550 to output 2 PWM at SAME
frequency (the freq at which the HBridge is driven) but at 2 different
duty cycles (to control the RPM of the two motors)...

The standard PWM modules already do this. In fact, they have to
have the same frequency. They both run off the same Timer2.
The only thing that can be different between CCP1 and CCP2 is
the duty cycle. The following thread has a example program
(which you have already seen) that does exactly what you want to do.
http://www.ccsinfo.com/forum/viewtopic.php?t=17729
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group