I'm new here, so hello to you all. I have spent so long solving this problem, it has driven me crazy. I hope it hasn't come up before on the list and I am posting this simply to share what I have found in the hope that it might help someone stay sane. I am using PORTA 0..3 of the PIC for an LCD display data bus and PORTA 4 for a logic level output. The output gets either set or cleared by the software and then a suitable message is displayed. On this output is a pull-up resistor, a series resistor and then a transitor switch to drive a relay. Sorry if the ASCII "art" doesn't work, but I think you will know what I mean anyway. _ +5V | | | | 1k |_| / | ______ |- |/ RA4 O--------|-----|______|-------- | | BC109 10k |_| \ \ _|_ 0V This all worked OK while it was on my bread board, but when I transfered it to a PCB, strange behavior started. RA4 would only assert for a few 10's of micro seconds, then return to zero. At first I suspected my code, then the chip, then random resets. When I looked at RA4 with my 'scope, I found it only had about 3 volts on it when it was on (with switching spikes when the other pins were being changed). The reason for this was that I had miss-read a 10k resistor for a 1k, and both the pull-up and the base resistor were 10k, which if you ignore the base emitter drop of the transistor, was acting like a potential divider. What I think was happening is due to the read/ modify/ write cycle when a port is assigned a new value, when my port was being read in, sometimes the 3V was being read as a 1, sometimes as a 0, (possibly depending on the spike) and hence its state seemed to magically change. I do hope this helps someone, I searched on the PIC archive before I fixed the problem myself, and didn't turn up anything. All the best....Mike. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics