Should have mentioned also that the pins you are using are multiplexed with analog inputs. To use them as digital, you need to clear the ANSEL register. Check in the datasheet (I/O chapter page 98 specifically) for details. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist as MPLAB/ICD combination, you get strange results unless you are single stepping through the code inside that function. When the function terminates by executing a 'return' the variables are removed from the stack, and no longer exist. At this stage your debugger will again go strange with the values of these variables (IIRC it gives an error message that says they are 'Out of Scope'). If the other routine is now called the variables for that function are automatically created on the stack, and are unique to that function, even if they happened to reside at the same position in the stack. If the variables are declared 'static' in addition to the other attributes they have, then they are created in the normal RAM area, and are persistent between calls to the function, i.e. they keep their last value from the last time the function was called, or are uninitialized before the first call of the function unless initialisation values are declared. But they are still separate variables even though they have the same name. I don't know how the debugger identifies which one you wish to watch, I haven't had occasion to go down this road at this stage. -- Scanned by iCritical. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist