PDA

View Full Version : pics with 3 hardware PWM ports



CBUK
- 29th July 2004, 10:19
hey people, im just wondering if anybody knows of any pics with 3 hardware ports to use the HPWM command on, i am a common user of the 16F877 which only has 2,...... to cut a long story short im after a third line as im using some full colour leds (i.e. 3 primary colours) of which im looking to control for various colours and cycling.. failing that it would mean 2 pics and linking them with a comms line, but its a bit of a waste just for one extra line.

the reason im looking to use the hardware option rather than software is that im going to have a reasonable amount of code to allow for cycling and manual adjustment ect and feel that the refresh times would be to long to provide sufficent updating..

many thanks

Chris

Dwayne
- 29th July 2004, 15:05
the reason im looking to use the hardware option rather than software is that im going to have a reasonable amount of code to allow for cycling and manual adjustment ect and feel that the refresh times would be to long to provide sufficent updating..

Just a idea...Would using 3 regular pins work? By changing the time the pin is held on, will vary the width of the pulse...

Granted If you go into a menu...you may not have that "Pulse Train", and kill yourself....

Dwayne

puma
- 31st July 2004, 11:03
hello,

According to mellabs there are several pics with 3 or more HPWM channels.
Naming only 3HPWM:
16F737
16F747
16F767
16F777

The Puma,

CBUK
- 31st July 2004, 11:44
thanks for that puma, the need for having hardware driven pwm is because i shall be driving LED's directly by MOSFETs and need the constant PWM to act as a brightness control hence running more efficently espically with the number of leds im driving rather than having to dissipate the excess unneeded power as in analogue outs with power transistors. using the software outputs dwayne has the disadvantage that because im using RS485 communications between pics is that if i have any errors in timing then i'll loose the software pulses and it'll be blackout! i.e. i have a time out loop to carry out other communications tasks, as well as a display and controls for the 3 sets of RGB leds's
thanks for your help

Chris

anj
- 5th August 2004, 00:14
Gday Chris
If i understand what you are trying to do correctly, there may be another way to do what you want with only one PWM line.
You take the PWM output from one pin, and run it to each of the three Mosfets through suitable load limiting resistors.
Then place pulldown diodes on each line ( from between the mosfet and resistor ), back to individual pins on the PIC.
You can then run background PWM to set general brightness, then by pulling relevant diode pins low, you can effectively turn off those lines. As such yr main loop can control on/off times of each colour line, then adjust general brighness every now and then as reqd.
Andrew