|
|
View previous topic :: View next topic |
Author |
Message |
Jazib
Joined: 04 Mar 2014 Posts: 1
|
more than 2 pwm pins in 18f4550/16f877A |
Posted: Tue Mar 04, 2014 5:44 am |
|
|
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
|
|
Posted: Tue Mar 04, 2014 8:03 am |
|
|
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: 19548
|
|
Posted: Tue Mar 04, 2014 9:02 am |
|
|
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: 9245 Location: Greensville,Ontario
|
|
Posted: Tue Mar 04, 2014 2:29 pm |
|
|
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 |
|
|
|
|
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
|