Stephen D. Barnes wrote: > int test; > /************* START OF MAIN FUNCTION ***************/ > int main ( void ) > { > test = 1; > while (test < 10) > { > test ++; > } > } > > when the last bracket is reached, a software reset occurs. Why? Well what *should* it do when the top level MAIN returns? This is something that makes no sense in a microcontroller, so the compiler probably sticks a RESET instruction or jump to 0 in there. Short answer: Don't do that. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist