On 05-Jan-12 14:10, Adam Walley wrote: > Hello, > > I have been struggling to establish communication between my laptop and a > pic12f675. I am needing some help to get this working, because it's > starting to drive me nuts. I have tried various methods, but the > show-stopper always seems to be when I connect the laptop's serial ground > to the PIC's. I'm sure I am making some basic mistakes, but don't have mu= ch > electronics experience. My set-up is as follows: > > - 5V power supply (4xAA rechargeable cells) with de-coupling capacitor > across + and - lines > - 12F675 microchip > - laptop with usb-serial adapter listening on COM port with Hyperterminal > - some simple PIC code, which blinks an LED on one pin, and transmits a > bit-banged letter 'K' at 9600 8N1 on a second pin > > I would like to get to the stage where I can fine-tune my code, as I > suspect it will need some corrections, but I really need to get the wirin= g > right first. > > The laptop's serial pins appear to be operating at -9.6/+9.6V. I can crea= te > random characters by simply shorting the DTR and RX lines. > > I also have a ready-made MAX232CPE board, which works very well between a > PC and a Motorola phone. I have tried to use this with the PIC, but come = up > against the same problem: as soon as I connect the ground lines the PIC > stops working (blinking LED stops). > > I have read as many tutorials and FAQs as I could find on the web, have > tried different approaches with transistors and mosfets, but still cannot > get this working. > > One more point: I have attempted the same exercise with my Desktop PC on > its serial port, but only get the same results (which hopefully rules out > the USB adapter as the culprit). > > Any help would be appreciated. Check if MCLR pin is floating and restarting the PIC randomly. Write a program that blinks the LED only once, connect the battery and=20 try to touch the MCLR pin with your hand or a metallic object. If it=20 doesn't reset, connect the ground wire. The decoupling capacitor should be very close to PIC, not on the battery=20 or somewhere in the middle. Djula --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .