Searching \ for '[PIC]: Driving multiple PWM outputs from 1 PIC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=pwm
Search entire site for: 'Driving multiple PWM outputs from 1 PIC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Driving multiple PWM outputs from 1 PIC'
2003\02\05@005859 by Ian McLean

flavicon
face
Hello all,

I am rather new to this list, so I hope my question does not seem to dumb to
you all, but here goes...

Is it possible to drive more than one PWM output at different duty cycles
from the one PWM output pin (CCP1) on the PIC16F877 ?  This would be to
control two Peltier devices from the one PIC.  If so, can anyone give me a
suggestion on how to do this - I am not very keen on "emulating" PWM on
another port pin as timing then becomes too critical a factor - or am I
wrong here too?  I am seriously running out of available port pins on the
PIC in my current project.  To get two fan speed sensors running, I have
gone to the trouble of NAND gating the two pulses into Timer1 using a port B
pin to switch the gate between the two inputs.  At the moment I am seriously
considering using two PICS joined by SSP to do the job, but that seems to be
massive overkill.  Any suggestions anyone ?

Regards
Ian McLean

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu>

2003\02\05@013441 by Brent Brown

picon face
On 5 Feb 2003 at 16:49, Ian McLean wrote:

> Hello all,
>
> I am rather new to this list, so I hope my question does not seem to
> dumb to you all, but here goes...
>
> Is it possible to drive more than one PWM output at different duty
> cycles from the one PWM output pin (CCP1) on the PIC16F877 ?  This
> would be to control two Peltier devices from the one PIC.  If so, can
> anyone give me a suggestion on how to do this - I am not very keen on
> "emulating" PWM on another port pin as timing then becomes too
> critical a factor - or am I wrong here too?  I am seriously running
> out of available port pins on the PIC in my current project.  To get
> two fan speed sensors running, I have gone to the trouble of NAND
> gating the two pulses into Timer1 using a port B pin to switch the
> gate between the two inputs.  At the moment I am seriously considering
> using two PICS joined by SSP to do the job, but that seems to be
> massive overkill.  Any suggestions anyone ?

There are two PWM outputs on the 877, CCP1 and CCP2. Splitting the
use of one of these would almost certainly require another PIC pin to
switch some external circuit, and you say you don't have enough I/O.

Anyway, one way to do it, the assumption being you are converting the
PWM signal to analog to drive something, is a CMOS switch controlled
by a spare PIC pin switching the PWM signal alternately into two RC
filters followed by Op Amp buffers. When the switch leaves one RC
input open it works like a sample and hold circuit.

--
Brent Brown, Electronic Design Solutions
16 English Street, Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/txt: 025 334 069
eMail:  .....brent.brownKILLspamspam@spam@clear.net.nz

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu>

2003\02\05@042518 by Ian McLean

flavicon
face
Thanks for the advise - this prompted me to read a little deeper into the
datasheet on the f877 and a little entry in a table made it all clear.
CCPx  CCPy
PWM   PWM   - The PWMs will have the same frequency, and update rate (TMR2
interrupt).

The tables in the datasheet make it clear - but NOT the paragraph on PWM -
this only refers to CCP1 - and that confused me ...
"In Pulse Width Modulation (PWM) mode, the CCP1 pin
produces up to a 10-bit resolution PWM output. Since
the CCP1 pin is multiplexed with the PORTC data latch,
the TRISC<2> bit must be cleared to make the CCP1
pin an output."

I should have read the tables closer.  AFter reading this paragraph,
something in my head convinced me that CCP2 was for Capture/Compare only.

I thought my question might have been an ignorant one - and I was right.

Having two PWM modules solves my problem.  They both run off the Timer2
interrupt at the same Period but that is perfect for my application as I am
driving two of the same devices - and I only need to be able to set
different duty cycles.

Thanks for setting me straight.  That is something new about the f877 I have
learnt today - read the datasheet CLOSELY.


{Original Message removed}

2003\02\05@084430 by Olin Lathrop

face picon face
> Is it possible to drive more than one PWM output at different duty
cycles
> from the one PWM output pin (CCP1) on the PIC16F877 ?

Of course not!  How do you expect to get two PWM output streams from one
pin!!?

> This would be to
> control two Peltier devices from the one PIC.

By the way, Peltier devices are badly suited to be driven via PWM.  Their
inefficiency goes up with the drive level, so you want to use the lowest
drive level possible, which means continuous operation.  In other words,
continuous 50% is more efficient than half full on and half off.  You can
still use PWM from the PIC to control this, but it should be filtered so
that the Peltier device sees a reasonably constant level.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu>

2003\02\05@090259 by Wouter van Ooijen

face picon face
> By the way, Peltier devices are badly suited to be driven via
> PWM.

IIRC Peltier devices are heat pumps? If so their action is inherently
slow due to thermal inertia, so you can PWM at a *very* low frequency,
like N seconds on each minute. Easy in software, and would probably
avoid the inefficiency Olin mentions.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu>

2003\02\05@091515 by Roman Black

flavicon
face
Wouter van Ooijen wrote:

> IIRC Peltier devices are heat pumps? If so their action is inherently
> slow due to thermal inertia, so you can PWM at a *very* low frequency,
> like N seconds on each minute. Easy in software, and would probably
> avoid the inefficiency Olin mentions.


The one I bought came with a warning NOT to use
PWM under 2kHz, apparently that produces too much
thermal stress. Very low frequencies (like you
mentioned) may be ok and are used in some cheap
car fridges, but a slowly ramping PWM at higher
than 2kHz will give the longest life, possibly
run from a nicely filtered buck converter even
better still always providing DC to the device.
-Roman

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu>

2003\02\05@092150 by Wouter van Ooijen

face picon face
> The one I bought came with a warning NOT to use
> PWM under 2kHz, apparently that produces too much
> thermal stress. Very low frequencies (like you
> mentioned) may be ok and are used in some cheap
> car fridges, but a slowly ramping PWM at higher
> than 2kHz will give the longest life, possibly
> run from a nicely filtered buck converter even
> better still always providing DC to the device.

So you need a 'hybrid' approach, with the real PWM at a very low
frequency, and the edges of that PWM smoothed by a high frequency PWM?
Does not sound to difficult, especially because the ramp-up time of the
higher frequency PWM is not critical.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu>

2003\02\05@094044 by Ian McLean

flavicon
face
This was my opinion too.  Both the Melcor and the Tellurex sites recommend
PWM as the most efficient way to control the Peltier if it is driven at
something above 2kHz - below this causes thermal stress - above this creates
the least thermal stress in your power supply too - especially if you use a
Mosfet driver - which I am doing.

PWM at a LOW frequency is not however recommended because it definately
creates thermal stresses in the Peltier device.

So, you think PWM is still the way to go ?  I am running it at a frquency of
5kHz, and with my PID loop, can maintain the tempurature within 1degree.


{Original Message removed}

2003\02\05@095238 by hael Rigby-Jones

picon face
{Quote hidden}

As Olin stated, you should use a filter (an LC filter is appropriate) to
ensure minimum ripple through the TEC.  Driving PWM directly into the TEC is
very innefficient.

Regards

Mike

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu>

2003\02\05@095828 by Gregory A. Pruden

flavicon
face
Hi Ian,
Could you describe the filter that you are using with your TEC?
Gregory

-----Original Message-----
From: Ian McLean [TakeThisOuTianmcleanEraseMEspamspam_OUTOPTUSHOME.COM.AU]
Sent: Wednesday, February 05, 2003 9:24 AM
To: RemoveMEPICLISTspamTakeThisOuTMITVMA.MIT.EDU
Subject: Re: [PIC]: Driving multiple PWM outputs from 1 PIC

This was my opinion too.  Both the Melcor and the Tellurex sites recommend
PWM as the most efficient way to control the Peltier if it is driven at
something above 2kHz - below this causes thermal stress - above this creates
the least thermal stress in your power supply too - especially if you use a
Mosfet driver - which I am doing.

PWM at a LOW frequency is not however recommended because it definately
creates thermal stresses in the Peltier device.

So, you think PWM is still the way to go ?  I am running it at a frquency of
5kHz, and with my PID loop, can maintain the tempurature within 1degree.


-----Original Message-----
From: pic microcontroller discussion list
[PICLISTEraseMEspam.....MITVMA.MIT.EDU]On Behalf Of Roman Black
Sent: Thursday, 6 February 2003 1:05 am
To: EraseMEPICLISTspamMITVMA.MIT.EDU
Subject: Re: [PIC]: Driving multiple PWM outputs from 1 PIC


Wouter van Ooijen wrote:

> IIRC Peltier devices are heat pumps? If so their action is inherently
> slow due to thermal inertia, so you can PWM at a *very* low frequency,
> like N seconds on each minute. Easy in software, and would probably
> avoid the inefficiency Olin mentions.


The one I bought came with a warning NOT to use
PWM under 2kHz, apparently that produces too much
thermal stress. Very low frequencies (like you
mentioned) may be ok and are used in some cheap
car fridges, but a slowly ramping PWM at higher
than 2kHz will give the longest life, possibly
run from a nicely filtered buck converter even
better still always providing DC to the device.
-Roman

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamEraseMEmitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspam_OUTspamKILLspammitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspamspammitvma.mit.edu>

2003\02\05@100906 by Ian McLean

flavicon
face
The problem I see with an LC filter is picking a good inductor value.
Because I am drawing large amounts of current, the inductor cannot be too
small.  But it cannot be too large either or I will getting ringing on my
power supply side.  Any suggestions for a good combo for cap and choke to do
the job ?


{Original Message removed}

2003\02\05@100909 by Olin Lathrop

face picon face
> IIRC Peltier devices are heat pumps? If so their action is inherently
> slow due to thermal inertia, so you can PWM at a *very* low frequency,
> like N seconds on each minute. Easy in software, and would probably
> avoid the inefficiency Olin mentions.

No, because the inefficiency is a function of the steady state operating
point, not due to switching.  I was assuming the Peltier device was being
used to cool something, as most are.  Since these devices are not 100%
efficient, they have to remove both the heat from the item to be cooled,
plus the heat from the inefficiency.  As the current increases, so does
the portion of the power spent in removing its own waste heat.  Eventually
increasing current actually increases the cold side temperature.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspamspamspamBeGonemitvma.mit.edu>

2003\02\05@101430 by hael Rigby-Jones

picon face
> -----Original Message-----
> From: Ian McLean [SMTP:RemoveMEianmcleanKILLspamspamOPTUSHOME.COM.AU]
> Sent: Wednesday, February 05, 2003 3:06 PM
> To:   PICLISTSTOPspamspamspam_OUTMITVMA.MIT.EDU
> Subject:      Re: [PIC]: Driving multiple PWM outputs from 1 PIC
>
> The problem I see with an LC filter is picking a good inductor value.
> Because I am drawing large amounts of current, the inductor cannot be too
> small.  But it cannot be too large either or I will getting ringing on my
> power supply side.  Any suggestions for a good combo for cap and choke to
> do
> the job ?
>
>
What sort of current are you talking about?  You can get some high current
surface mount inductors that are still quite physicaly small.  Obviously the
higher the PWM frequency the better, as smaller value components can be
used.

Regards

Mike

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestSTOPspamspamEraseMEmitvma.mit.edu>

2003\02\05@101954 by Ian McLean

flavicon
face
8 to 16 amps at 12V PWM with duty cycles between 50 and 100%.  I am using a
cascaded Mosfet switch to both drive the current and to isolate the 12V side
from the logic side.  I am keeping the frequency at 5kHz - well above the
2kHz stress point.

{Original Message removed}

2003\02\05@105421 by hael Rigby-Jones

picon face
       > From: Ian McLean [SMTP:KILLspamianmcleanspamBeGonespamOPTUSHOME.COM.AU]
> > Sent: Wednesday, February 05, 2003 3:06 PM
> >
> > The problem I see with an LC filter is picking a good inductor value.
> > Because I am drawing large amounts of current, the inductor cannot be
> too
> > small.  But it cannot be too large either or I will getting ringing on
> my
> > power supply side.  Any suggestions for a good combo for cap and choke
> to
> > do
> > the job ?
> >
> >
> What sort of current are you talking about?  You can get some high current
> surface mount inductors that are still quite physicaly small.  Obviously
> the
> higher the PWM frequency the better, as smaller value components can be
> used.
>
       From:   Ian McLean [SMTP:EraseMEianmcleanspamEraseMEOPTUSHOME.COM.AU]
       Sent:   Wednesday, February 05, 2003 3:17 PM

       8 to 16 amps at 12V PWM with duty cycles between 50 and 100%.  I am
using a
       cascaded Mosfet switch to both drive the current and to isolate the
12V side
       from the logic side.  I am keeping the frequency at 5kHz - well
above the
       2kHz stress point.

Hmm, that's quite a bit, certainly inductors for that level aren't going to
be very tiny.  The TEC's I deal with take around 1.2 Amps at no more than
3.3 volts, so getting SM parts for filtering isn't such a problem.  Check
out the PDF at http://www.scanti.ru/docs/datasheets/slos365.pdf which is the
datasheet for a PWM TEC power driver from TI.  It contains a lot of design
theory for LC filtering and has an equation to work out the efficiency loss
from rippple in the TEC supply.

Vishay make a reasonable range of high power inductors
http://www.vishay.com/inductors/dc-more-5A/

Regards

Mike

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-request@spam@spamspam_OUTmitvma.mit.edu>

2003\02\05@131820 by Spehro Pefhany

picon face
At 03:01 PM 2/5/2003 +0100, you wrote:
> > By the way, Peltier devices are badly suited to be driven via
> > PWM.
>
>IIRC Peltier devices are heat pumps? If so their action is inherently
>slow due to thermal inertia, so you can PWM at a *very* low frequency,
>like N seconds on each minute. Easy in software, and would probably
>avoid the inefficiency Olin mentions.

No, Olin is correct, the problem is I^2R heating in the device.
Consider the ratio of average current (determines heat pumped) to RMS
(determines heat loss). It is 1:1 for DC, whereas at 50% duty cycle
PWM it is 1:2.  You can, of course, *increase* the frequency and put a
relatively small gapped inductor in series with the Peltier device so that
the current it sees has low ripple- you don't *have* to use an inefficient
linear regulator.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spamBeGonespeffspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestspam_OUTspammitvma.mit.edu>

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...