Searching \ for '[PIC] direct-connect PWM outputs?' 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: 'direct-connect PWM outputs?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] direct-connect PWM outputs?'
2012\05\15@202726 by Lee Mulvogue

flavicon
face

       Simple and possibly(?) dumb question; if I connect two PWM output
pins of a PIC together, can it cause damage to the PIC?  ie., will
"input" power being applied to an "output" PWM pin smoke it?
       I am producing sound via PWM, and currently add two samples together
in code before outputing to one PWM channel, but it would be a lot
simpler in most respects to just send the two samples to their own PWM
channel and hard-mix them; the higher the output level the better, so
was just going to essentially solder the two pins together; bad idea?
       Currently my two samples are only 7bit resolution, feeding an 8bit
PWM, as they can add together to get a max of 255.  If I use two
separate channels, I can increase them to 8bit.  Not a huge deal for
the sounds I'm producing, but would make creation, processing etc much
easier.
       Lee

-------------------------
Msg sent via Webmail - http://hosting.myob.com

2012\05\15@212828 by Bob Ammerman

flavicon
face
You certainly cannot connect the two pins together.

However, you should have some sort of low-pass filter on your PWM.  This is often just a simple RC network. You can just have separate resistors to the top of the filter capacitor from each of the PWM outputs.

However, you certainly can get the effect you want in software. You can even use 8-bit samples but you have to average them rather than simply adding them before sending them to the PWM. I don't know if you are using C or ASM, but it is basically trivial to do the averaging if you are in ASM. It is a little slower in C.

-- Bob Ammerman
RAm Systems

{Original Message removed}

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