>On Mon, 26 Jun 2000, Peter McAlpine wrote: > >> Hi All, >> I have seen somewhere a circuit for how to connect standard >> 5v output ports to RS232 serial port of a PC using a couple >> of diodes... but can't find it again. >> >> Anyone point me in the right direction please? > >I just connect the PIC's xmit pin directly to the PC RxD, and the PC's TxD >to the PIC through a 22K resistor... works fine for me. You need to >invert the data, of course. I've also seen a lot of different methods of >doing this with transistors, Zeners, etc. - I guess it just depends on how >close to "real" RS232C you want to get, but the drivers & receivers I have >looked at see anything below .7V as low and anything above 1.4V as high >(if I remember correctly), so TTL/CMOS levels work fine. *** Standard warning which always provokes bitter *** does/does not/does too/ I do not/ Oh you Beast .... !!! argument :-) Using a resistor alone to input over or under voltage data to a PIC pin will SOMETIMES and non-repeatably and unreliably affect PIC operation. Using the catch diodes like this does work often/sometimes but IS out of spec and when it fails you can't blame Mchip. It's happened to me :-) It WILL happen to you sometime. YMWontV. Solutions: - Reverse biased Schottky diodes to either supply from pin. - 2 resistors in series for input resistor with 1N4148 type diodes at mid point of resistors to supply and ground (back biased usually). - More complex systems. First 2 above actually technically still violate spec BUT the first prevents the protection diodes conducting (which is the aim of the exercise and the second may allow a minute amount of conduction of the protection diodes but probably not. RM