On Fri, Jan 06, 2012 at 11:00:23AM -0200, Isaac Marino Bavaresco wrote: > Em 6/1/2012 10:26, Byron Jeff escreveu: > > On Fri, Jan 06, 2012 at 07:20:08AM -0200, Isaac Marino Bavaresco wrote: > >> Em 06/01/2012 06:34, William "Chops" Westfield escreveu: > >>>>> Is there anything I can add to protect the chip from unwanted negat= ive voltage? > >>> Well, to start with, there should be a substantial resistor; about 10= k. > >>> This will rely on the internal protection diodes to clamp the voltage= s to levels that won't cause problems. There is plenty of reason to assume= that this is insufficient, but microchip does publish app notes where this= is done (apparently successfully.) > >>> ... > >> > >> I prefer to use an external Zener diode plus two resistors to clamp th= e > >> voltages, forming a "T" with the Zener as the "leg" of the "T". > > What's the purpose of the resistor between the zener and the PIC input? >=20 >=20 > If the RS-232 is connected when the PIC is not powered, the pin will > have 4.7V and the board will be powered by the PIC's internal parasitic > diode and large currents may flow through it, perhaps violating some > parameter. The series resistor will limit the incoming current. With a 4.7V zener and a 4.7K series resistor, the maximum current the unpowered PIC will see is 1 mA. All the rest of current from the higher incoming voltage will be shunted to ground by the zener. > With the additional resistor (say 1K) the current will be limited to a > few mA, well inside the allowed range. >=20 >=20 > > For > > quick and dirty testing, I use a 4.7K resistor in series with the RS-23= 2 > > output and a 4.7V zener. For more permanent circuits I use this as the = base > > input to a NPN transistor inverter with a pullup resistor to protect th= e > > PIC's input from the -0.7V the zener allows when the RS-232 output swin= gs > > negative. >=20 >=20 > When using an NPN transistor I use a small signal diode from ground to > base to protect the base-emitter junction from reverse biasing. The PIC > will never see the -0.7V because the base-collector junction will be > reverse biased, but the transistor's base-emitter junction may be > damaged as they are usually rated for -5V. The zener serves the purpose of that small signal diode with the input voltage is negative as the zener is now forward biased. So the base-emitter voltage is never more that -0.7V which is nowhere near the reverse bias breakdown voltage for the transistor. I haven't had any problems so far, and it's a heck of a lot easier than trying to track down a MAX232 or equivalent. I haven't seen a USB serial adapter yet that swings any more than +/- 5V, and every one so far works fine with 0-5V going into their inputs. With the near universal death of dedicated serial and parallel ports on PC's, USB serial adapters are my current bit wiggling interface. BAJ >=20 >=20 > Best regards, >=20 > Isaac >=20 > =20 >=20 > > The last time this discussion came up, Russel noted to me that allowing= the > > negative voltage to the PIC input, even though it's clamped by the > > protection diodes, causes the part to operate outside of it's range > > specified in the datasheet (-0.3V minimum). Hence the transistor in the > > permanent circuit. I'm unsure what if any damage that 150 uA of current= at > > -0.7V can do to the input. > > > > BAJ > > >=20 > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 Byron A. Jeff Department Chair: IT/CS/CNET College of Information and Mathematical Sciences Clayton State University http://cims.clayton.edu/bjeff --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .