> >I'm fairly new to PIC development and am just trying some things out >right now. I want to get my PC and PIC talking over a serial port and >am having trouble figuring some things out. It's a 16F84A. > >I'm using a DB-9 connector from my PC to the PIC, with the TX and RX >pins connected to I/O pins on my PIC. What I'm having trouble with is >pin 5 on the DB-9, which is apparently should go to ground. > >If I have pin 5 connected to the same ground as my PIC, the PIC will >not start. I have a serial LCD hooked up for debugging, and nothing >appears. If I disconnect pin 5, the PIC will start up just fine and >display my debugging output. > >My test program is also supposed to send text to the PC via the serial >port. If the serial ground pin is not connected, and the PIC starts, >nothing is received by the PC. If I connect the serial ground to the >PIC ground after it has started, one of the following happens: the PC >will receiving data just fine, the PIC will reset, or the PIC will >just stop doing anything. > >I'm confused on what I should be doing with the ground pin on the >serial port. Should it be on the same ground as the PIC? If I connect >my multimeter to pin 5, then to the PIC ground, I see it's putting out >9V. Does that seem normal? It seems like I probably shouldn't be >connecting 9V to the same ground line that the PIC connects to, but I >don't know for sure. > >Thanks! > >-- >Ben Sinclair >ben@bensinclair.com Hi Ben, Now did you ever stop to think that the I/O lines you connected to the RS232 port were in fact putting out -9V and not GND putting out 9V? Connect the GNDs, they must be connected. -BUT- You cannot directly connect the PIC to the rs232 port. You need level conversion. Ok, this can be done with a resistor but something has got to drop +/-9 rs232 to the PICs 0-5V. Better circuits use transistors, have neat power stealing arrangements (half duplex comms) and also invert the signal required for UART use. Also, pick your i/o pins carefully if bit banging. Not all have the required input protection diodes to make this work. (RA4 on your 18F84A!? The timer-1 pin?) Without some sort of buffering, you are putting -9V directly into your PIC. You wonder why it stops working? :) If you want to use the UART (after a million piclisters beat you away from the 16F84A to a better chip with a UART. What that is they can't decide!) :) then you also need to invert the rs232. you can use a max232 or equal to do both jobs. That is what it is designed for. There are many very nice rs232 modules you can use. See the RCL-1 unit on www.piclist.com and www.sparkfun.com have great stuff too Don't have the URL for it but Olin has something along these lines and there are many other. Also consider a USB to rs232 module like an FTDI chip. You still use the UART but require not further level shifting or inversion. www.dontronics.com and sparkfun again are good sources. Look around www.piclist.com for an rs232 basics. You really appear to need to get a hold on them. Good luck with your new PIC adventure! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist