thanks very much, I will give this a try, kind regards pete --- In , "Anton Erasmus" <antone@s...> wrote: > On 7 Oct 2004 at 15:05, bty639886 wrote: > > > > > > > Is there any way to reset the processor from within the firmware? > > > > I am currently using the Watchdog feature, and I know if I stop > > toggling the watchdog then my processor will time out and reset. > > > > However, I need to be able to do different things depending on > > the 'cause' of the reset... > > > > ie if its a watchdog timeout that caused reset I need to do X,Y,Z > > before normal operation but if its a software triggered reset (eg > > after I have updated a parameter or something in flash) then I only > > want it to do Y,Z > > > > Obviously I could use some external hardware, however is there any way > > to do it in software???? > > > > What I have done in the past is to have a 32bit value in a portion of RAM which is not > initialised by the C startup code. (If you have any). I then write a specific value into this > address, before I cause a deliberate watchdog reset. After a reset one can then check > the value. If it is the special value, then it was a "Software Reset" otherwise it was a > watchdog reset. > > Regards > Anton Erasmus > -- > A J Erasmus |