On Sep 26, 2009, at 12:39 PM, Quintin Beukes wrote: > The problem can be reproduced, however, by finish reading from the > serial interface, then later one doing an exit(0). After doing that a > few times all serial comms in the future are messed up. So you are undoubtably running into the differences between doing a "real" reset and the partial re-start that happens (perhaps) when you do exit(0). A "real" reset will return most of the peripherals to a default state, as well as restarting the program. A "software reset" might ONLY return the program to its start address, with the peripherals still running. Without being really careful, it is very easy to get (for example) a serial interrupt before your code has initialized the serial ISR service routine variables, causing ... trouble. As others have said, doing exit(0) at all is a bad idea. If you ARE going to do this, you could try to reset some of the peripherals. As a minimum, be sure to turn off the global Interrupt enable before doing exit(). BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist