Likely reason: The oscilliscope and/or the power supply and/or any other piece of connected equipment are not correctly grounded. You're getting some sort of ground loop current when you connect the oscilliscope ground to your circuit (and therefore powersupply and other equipment) ground. Make sure that the serial device that's connected, the power supply, and the oscilliscope all have good grounds, or are correctly floating. Maybe try using a battery to supply the circuit. Also make a test program that simply blinks the LED (doesn't depend on the serial input) and try connecting and disconnecting the serial line to see if the ground problem is there. Or simply measure the current of the ground lines when connected, and voltage when not connected. Also check power strips for proper grounding. I had one that had an internal loose ground, and after a 50 foot extension cord in the basement gave the computer a nicely live case. -Adam On 8/16/06, Nikhil Kakkar wrote: > I dont have the circuit in front of me now, but I have seen the > oscilloscope affect the performance, when just the ground of the cable > was connected to the same ground as the circuit. I have also seen it > show me different outputs when connected to the RX pin(I am using > serial communication) and at the TX pin. > I am using the internal oscillator, so my guess was that the > oscillator some how loads the clock and shifts the period etc. That > could some how cause the outputs to wary. But that was just a shot in > the dark. > > > On 8/16/06, David VanHorn wrote: > > On 8/16/06, Nikhil Kakkar wrote: > > > > > > I am using a PIC18F1320 with the MPLAB compiler. I wrote the code, and > > > while testing it I get a set of outputs with the oscilloscope, but > > > when i disconnect the oscilloscope, the outputs are different. > > > For example, I read in a byte over the serial port and compare it with > > > a variable. If it matches then I light an LED. With the oscilloscope > > > connected the LED never lights, without it it does. > > > I am using the internal oscillator of the PIC. Could it be that the > > > oscillation times change because of the oscilloscope? > > > > > > You've not said yet where you are connecting the scope. > > That's a very interesting bit of information > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist