Hi Mario, I think my reply on PIC input protection will be relevant. I'll just add that a simple diode across the shunt resistor can add a degre= e of=20 protection. A 1A or more silicon diode is relatively robust and cheap, and = is a good=20 fit if the knee of the conduction curve is above your analog input range. I= f AC is=20 necessary, add another diode the other way. For higher voltages you might u= se=20 multiple diodes in series, but pretty soon a zener or TVS diode becomes a b= etter=20 choice, then add series R to analog input and... On 26 Jan 2018 at 16:08, Mario wrote: >=20 > Hello, > I'm playing with my SMPS step up (boost) design, where the controller is = a PIC. >=20 > I thus have +12V power input, an inductor, a MOSFET, and a diode that cha= rges a > high voltage capacitor, and a voltage divider before the diode, to monito= r voltage > (via a first PIC ADC input) of the cap without actually discharging it co= ntinuously. >=20 > The gate of the MOSFET is connected to a +5V rail through a 1k resistor a= nd I use > a PIC output in open drain configuration to ~quickly stop the MOSFET from= conducting > (the opposite doesn't need to be ultrafast, as the SMPS will be always us= ed in > discontinuos mode, thus current is zero whenever the MOSFET starts to con= duct). > Switching frequency is pretty low. >=20 > While it's certainly not the most performant boost circuit, I like its si= mplicity > and low components count. >=20 > Now, I also need to monitor current (for which I have devoted a second AD= C input), > and thus I have placed a shunt resistor between the source of the MOSFET = and the > 0V rail. I can be 100% sure that the voltage out of it will never exceed = the PIC > ADC max input voltage, also due to insufficient input current from the po= wer supply. > The shunt has also pretty low resistance so the voltage never reachs 0.5V= (not much > resolution from the ADC, but enough to not want to add an OpAmp, as space= on board > is very very limited). >=20 > Question is: should I put a series resistor between the PIC ADC input and= the > shunt? Theoretically the voltage will never go below 0V and will never go= above > 0.5V (as explained above), but I fear some insidious aspects that maybe I= haven't > been able to consider, maybe for some hard to grasp parasitic capacitance= , etc.. > could the shunt voltage go below 0V and thus fry my PIC ADC input pin unl= ess I put > a series resistor? Is this series resistor necessary? >=20 > If it's totally useless, I don't want to put it, it's a matter of princip= le. :D >=20 > Thank you very much for augmenting my design knowledge and experience. >=20 > Kind regards, > Mario >=20 > --=20 > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .