William "Chops" Westfield wrote: > 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, Now, I do not remember what device this is, but executing the RESET instruction on a PIC18 (or one of the later PIC16 that has that instruction) is doing all register initializations that a hard reset does. What we do not know is if the exit(0) realy executes a real RESET instruction. If it could, depending on the device... -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist