PIC PWM LP Filter Help

May 20, 2015 16 Replies

The PIC in the diagram below is programmed to produce 5 frequencies grouped around 40Hz. It outputs a 5Vpp PWM signal.



This passes fine through R9 and R10, but as soon as I connect either of the 473 caps to ground it kills the signal.



formatting link



I don't understand why. It's just a passive filter and the PIC seems to be working normally.



I have tried everything I can think of. Can anyone suggest a solution?



David King


Are you using the CCP1 hardware PWM?

You **need** a bypass capacitor from Vdd to Vss. You **need** appropriate load capacitors on the clock crystal.

These are non-optional.

What's with R8?? Do you have /MCLR disabled? Regardless, you should have a pullup resistor on it. Is LVP disabled in the configuration?

Just a few things..

Best regards, Spehro Pefhany Amazon link for AoE 3rd Edition: http://tinyurl.com/ntrpwu8 Microchip link for 2015 Masters in Phoenix: http://tinyurl.com/l7g2k48

I don't quite understand what R3 and R21 are doing. As shown, each one will constantly dissipate some current from the + or - rail, and depending on where they are set, will try to feed some juice back into the filter and the PIC through R11 and R12.

If you're trying to add an adjustable DC bias to the signal from the PIC, replacing R11 and R12 with suitably small *capacitors* might help.

Plus, I agree with what Sphero said about the capacitors on the clock crystal and the bypass capacitor.

You might try running just the PIC and the filter (R9/C5/R10/C6) on a single-ended +5 V supply. When that works right, you can start playing with the rail splitter.

Matt Roberds

** You have drawn the caps as electros - are they 47nF or 47uF ?? 47uF would sure as heck kill a 40Hz signal.

... Phil

On a sunny day (Wed, 20 May 2015 11:27:40 +1000) it happened snipped-for-privacy@supernet.com wrote in :

I would first put a big decoupling cap between PIC Vdd and Vss, that is a requirement for it to work normally.

When you say that the PIC seems to be working, do you mean that the expected signal continues to appear on RB3 (as determined by a scope), even though it vanishes after R9, when the capacitor is attached?

Sylvia.

R3 and 12 adjust the input bias to two op amps.

Yes, the PIC does work on a 5V supply, which is why I am stumped that it does not in the virtual ground version.

David King

Sorry, but the electro symbol is all my (free) schematic program does.

They are 473's.

David King

Thank you for your suggestions. I must say the circuit works fine, as drawn, on a simple 5VDC supply.

But I will certainly try the changes you suggest.

David King

If it worked you would not be posting here would you?

For example adding the "473" capacitors adds an extra load. Without the bypass capacitor from Vdd to Vss this could create a power dropout that resets the PIC each time it tries to switch this load.

John Devereux

What do you want to happen?

John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com

I would change U3 to a 7805 and leave out D3.

But the biggest thing I would do, particularly if you keep D3, is to put a bypass cap on the VDD line, possibly two. One that's between 1uF and 10uF for bulk bypass, and one 100nF, as close to U1 as possible.

Tim Wescott Wescott Design Services http://www.wescottdesign.com

Cap symbols with one curved plate don't necessarily call out electrolytic. If you want to pick nits you can claim that they call out something more or less polarized, like paper caps or other wrapped caps with the outer foil attached to the curved bit in the schematic.

Cap symbols with a '+' sign call out electrolytic caps.

Tim Wescott Wescott Design Services http://www.wescottdesign.com

I found that the PIC was not startig with an even 5V.

Thanks John, and other respondents. Will do this weekend.

David King

** Firstly, C1 through C4 on the same schem are clearly electros and drawn the same way. Secondly, the OP said his PIC was "working normally" which left only the "473" caps as culprits.

My Q was worth asking to remove the ambiguities.

.... Phil

Yup, and 47nF won't do very much for him either at 40Hz.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required