> From: John Dammeyer > > > > >GOTO 00 is not same as (COLD)reset. It depends on application program > >what happends by GOTO 00, if the program expect to be running after > >reset, ie expect some re-gisters have "reset" value, then GOTO 00 > >might just hang your program. > > > >antti > Personally I have never considered it wise to rely on what state the > hardware might be in after a cold start. I believe robust programming means > initializing every thing to the state you want it right after power up and > before you use those peripherals. > > So having said that I would jump t a routine that would a) disable all > interrupts if your flavour of the PIC has them and b) GOTO zero. If that > hangs your program you probably deserve it. It's no _less_ wise to rely on the published reset state than to rely on the machine's correct execution of your initialisation code. Really, in a small ram machine you shouldn't be wasting space doing something which the manufacturer has guaranteed will be done for you. I will concede, however, that you should document any reliance on reset state. In the case of the original posting, where it is desired to simulate a reset, then the above paragraph is not entirely true. Nevertheless one cannot truly simulate a reset by executing instructions from location zero. For a start, assertion of !MCLR immediately puts all port pins in a high impedance state. This cannot be done by sequential instructions since only one port can be hi-Z'd(*) at once. Also, are you _really_ going to go to the trouble of randomising your file registers? Regards, SJH Canberra, Australia (*) Some times I envy the American pronunciation of 'Z' (zee) since it is much easier to say 'hi-zeed' than 'hi-zeded'. Also the American use of 'EZ' (easy) looks all wrong in the English speaking world - eezed?