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

more than 2 pwm pins in 18f4550/16f877A

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



Joined: 04 Mar 2014
Posts: 1

View user's profile Send private message

more than 2 pwm pins in 18f4550/16f877A
PostPosted: Tue Mar 04, 2014 5:44 am     Reply with quote

how can i use 5 pins of my 18f4550 as independent pwms... i am confused because it has only 2 pwm pins as far as i know...
plz help
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Mar 04, 2014 8:03 am     Reply with quote

The microchip data sheet is your friend.

It tells you how the PWMs are related for each of the two PICs you've cited.

Mike
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Tue Mar 04, 2014 9:02 am     Reply with quote

and, the answer is you can't.

There is a key confusion with Microchip on a lot of the chips with this. They will list 'PWM pins', as the 'number' of PWM's, rather than the actual counters. So a chip that can develop (say) two switch-able complementary 'pairs' from a single PWM, gets listed as having four PWM's, but there is only one 'counter' driving this. While a chip that has this, and a conventional PWM as well, gets listed as having five. This is the case for the 4550. One conventional PWM. One ECCP. The latter can give a single output, or two pairs of outputs (with the same timing), for forward/reverse control of a half-bridge or full bridge drive. Only two actual timers though.

Worth pointing out, that you can 'add' PWM's very simply/cheaply, by using a small chip set up as an I2C slave, which has one or more hardware PWM's. Then just send commands to this to control these. The PIC16F18313 (engineering only when I last checked), gives you an I2C slave, and a couple of PWM channels, in an 8pin package....

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 04, 2014 2:29 pm     Reply with quote

There is 'hardware' PWM and 'software' PWM to consider. As pointed out, most here talk about the PICs hardware PWM modules, though depending on project requirements, software PWM might work fine for you.
It all depends upon speed, resolution,other functions the PIC must handle,COST !,time to complete,etc.
Something like an 8 channel RC servo controller using PWM can be done with a 16F84. Without knowing the full details and scope of your project it's still a 50/50 call.
Tell us more, and we can perhaps narrow down your viable options.

hth
jay
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