Searching \ for '[PIC]: PWM output wave form' 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: 'PWM output wave form'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PWM output wave form'
2002\07\20@200545 by Dave King

flavicon
face
Remembered to give Roman the gears today but forgot to post my question ;-]

So here goes.

I keep reading that the pwm output generated from the pic is not that
sharp/clean
a signal. I've seen the suggestions for cleaning it up which is simple to
implement but
I was wondering if anyone has a image of the raw pwm wave form and perhaps
another after its filtered?

It might be a bit longer before I can get something running here to see it
myself so
I was curious if anyone could take a snap of the scope for me.

Thanks.

Dave

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


2002\07\20@232752 by Brent Brown

picon face
--Message-Boundary-26196
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

> I keep reading that the pwm output generated from the pic is not that
> sharp/clean a signal. I've seen the suggestions for cleaning it up
> which is simple to implement but I was wondering if anyone has a image
> of the raw pwm wave form and perhaps another after its filtered?

Not sure why you should think that the PWM output is not sharp/clean
because in my experience it is so with a PIC. Nice square edges, 0V
when low, 5V when high, duty cycle and fequency just what you tell it
to be. A PWM waveform is a "square" wave, where you have the ability
to alter the ratio of the high and low periods. See attached diagram
for examples.

Normally you filter a PWM signal when your intention is to produce an
analog value. Ideally the output signal is then a DC voltage (no
waveform) that the average value of the PWM waveform. Typically you
might use this to produce an analog voltage from 0-5V from a duty
cyle of 0-100%. Less than perfect filtering (such as a simple RC
filter) can leave some AC ripple at hte PWM frequency on the signal.

Does this help?

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


--Message-Boundary-26196
Content-type: Image/GIF; name="PWM.gif"
Content-disposition: attachment; filename="PWM.gif"
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aZKJHfhR6GiOqqrpcJ66qaSZpBh
q7Rq6lCdnXJa4XXnsfoRT144iqmvHr6aa3Cyah5nkE7mWbqssrsiCyK1P8lB4lJwcsOtlNR8
61ct4r6Zpi7dOqmunGC26+678MYr77z01mvvvfiaIKa546a7b4z/LhlwnP7ma/DBCCes8MIM
N+zwwxCXMfCTBYMLcMX9WiwwxnxF7DFbEQAAOw==

--Message-Boundary-26196--

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


2002\07\20@233940 by Scott Dattalo

face
flavicon
face
On Sat, 20 Jul 2002, Dave King wrote:

> Remembered to give Roman the gears today but forgot to post my question ;-]
>
> So here goes.
>
> I keep reading that the pwm output generated from the pic is not that
> sharp/clean
> a signal. I've seen the suggestions for cleaning it up which is simple to
> implement but
> I was wondering if anyone has a image of the raw pwm wave form and perhaps
> another after its filtered?
>
> It might be a bit longer before I can get something running here to see it
> myself so
> I was curious if anyone could take a snap of the scope for me.

Dave,

Back in March when we were talking about this stuff, I wrote an Octave
(open source implementation of MATLAB) script to synthesize a sine wave
from Pulse Modulate (but not PWM) signal. A PWM filtered signal will look
similar.

The script:

http://www.dattalo.com/swsd.m

http://www.dattalo.com/p2.png
http://www.dattalo.com/p3.png
http://www.dattalo.com/p4.png

p2.png and p4.png show two full cycles of the filtered sine, the
difference is that the RC time constant is slightly different. p3.png is a
close-up shot of p2.png.

Roman has some similar screen shots too:

http://centauri.ezy.net.au/~fastvid/picsound.htm

Scott

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


2002\07\21@002219 by Dave King

flavicon
face
Brent, Scott

I going to use the pwm to drive a 2N2222A which is in turn going to control
a mosfet.
I wanted to know if the pwm that is produced is a clean square wave or if
it is really
dirty and has to be cleaned before it will let the 2222 switch nicely.

Of course I read the bit about the dirty pwm output in a app note and now
can't find it
again. And if I had a pic running right now I could look and not have to
ask dumb
questions ;-]  Was just curious if anyone had actually noticed this or if
its another
"caution"  to just ignore.

Thanks

Dave

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\07\21@005238 by Dmitriy A. Kiryashov

picon face
Hi Brent.

Somebody posted it here already sometime ago...
You can produce +5 ... -4.5 volts output by
using PWM from single +5 source.

WBR Dmitry.


Brent Brown wrote:
>
> Normally you filter a PWM signal when your intention is to produce an
> analog value. Ideally the output signal is then a DC voltage (no
> waveform) that the average value of the PWM waveform. Typically you
> might use this to produce an analog voltage from 0-5V from a duty
> cyle of 0-100%. Less than perfect filtering (such as a simple RC
> filter) can leave some AC ripple at hte PWM frequency on the signal.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\07\21@021126 by Brent Brown

picon face
> I going to use the pwm to drive a 2N2222A which is in turn going to
> control a mosfet. I wanted to know if the pwm that is produced is a
> clean square wave or if it is really dirty and has to be cleaned
> before it will let the 2222 switch nicely.
>
> Of course I read the bit about the dirty pwm output in a app note and
> now can't find it again. And if I had a pic running right now I could
> look and not have to ask dumb questions ;-]  Was just curious if
> anyone had actually noticed this or if its another "caution"  to just
> ignore.

Dave,

It is a really clean square wave as far as I have seen, no nasty
glitches or double pulses to cause any problems. I have not heard of
any such cautions. It is a push-pull output like most PIC outputs and
will drive the 2N2222 nicely with an appropriate base drive resistor.

It can also drive a MOSFET directly, perhaps even better than if you
used the 2N2222 in between. That is, if the MOSFET does not have too
much gate capacitance and if 5V gate voltage is OK.

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

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\07\21@090707 by Scott Dattalo

face
flavicon
face
On Sat, 20 Jul 2002, Dave King wrote:

> Brent, Scott
>
> I going to use the pwm to drive a 2N2222A which is in turn going to control
> a mosfet.
> I wanted to know if the pwm that is produced is a clean square wave or if
> it is really
> dirty and has to be cleaned before it will let the 2222 switch nicely.

The only concern I'd have is that the gate capacitance of the MOSFET will
filter narrow pulses. You mention a 2N2222A, which is an NPN BJT, and I
assume it's configured with the emitter tied to ground and the collecter
tied to the gate of the MOSFET. If so, then this means you're using a
resistor to turn on the MOSFET. That resistor and the capacitance of the
MOSFET's gate will form a relatively slow RC circuit (unless the resistor
is tiny - in which case you'll burn quite a bit of power). I'd suggest
getting rid of the 2N2222 and using a MOSFET driver instead:

PIC I/O --> MOSFET driver ---> MOSFET

Scott

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\07\21@123815 by Peter L. Peres

picon face
On Sat, 20 Jul 2002, Dave King wrote:

>I going to use the pwm to drive a 2N2222A which is in turn going to control
>a mosfet.

Use a pushpull driver with 2N2907+2N2222 to drive the gate. Not a single
transistor, and make sure the FET is rated for 5V gate voltage (4.2
actually).

The PWM out of the PIC is 'very' clean to be used as described. Don't
forget to use a small gate resistor.

Peter

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\07\21@205222 by Dave King

flavicon
face
>It is a really clean square wave as far as I have seen, no nasty
>glitches or double pulses to cause any problems. I have not heard of
>any such cautions. It is a push-pull output like most PIC outputs and
>will drive the 2N2222 nicely with an appropriate base drive resistor.
>
>It can also drive a MOSFET directly, perhaps even better than if you
>used the 2N2222 in between. That is, if the MOSFET does not have too
>much gate capacitance and if 5V gate voltage is OK.

Thanks Brent

Thats what I wanted to know.

I'll have to see about driving the mosfet directly. You realize this might
require
further dumb questions aka pleading for help to the list ;-]

Cheers

Dave

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


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