Alan, Did your enhanced code by any chance use some peripheral that changes the function of PORTB,5? Just a thought. You don't say what part you're using, so I can't be sure, but it may be worth checking out. Another thought. Check to make sure you didn't inadvertantly change a bit reference or port reference Somewhere in your enhanced code. I don't know how many times I've been bitten by the fact that somehow I changed a port from B to A or C for instance. And it takes me a while to track it down. Again, just food for thought. Regards, Jim -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of alan smith Sent: Wednesday, December 19, 2007 3:26 PM To: Microcontroller discussion list - Public. Subject: [PIC] PortB works....no it doesnt....yes it does... OK this is a little wierd. Start off with some baseline code, where I have an input on PORTB bit 5. The entire port is being used in fact for inputs, so TRISB is 0xFF. Signal from the hall sensor works just fine, executes the code just fine. Now, add enhacements to the code, more features, etc. Code executes down to the same point...and it does NOT see the PORTB,5 is changing. Hmmm...old code reloaded, looking at PORTB,5....what do ya know....its seeing it. New code...nope...bit never changes in the watch window. I did a loop at the very top of the code to just loop on nothing so I could break it and look at the watch window. Any thoughts? In both cases TRISB is 0xFF --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. -- 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