I want to force a reboot if a serious error occurs. I have tried the _trap_(0x00); function which inserts the SRST instruction but nothing happens. In debug mode i get an error message in the output window - Error occured during device access.
What does the mean and how can i force a reboot?
Any help appreciated.
1) Do you have an way to monitor the /RSTOUT pin? 2) Could you verify that the _trap_(0) generates the SRST instruction (it should but just to be sure it is not just a jump to 0)?
From the manual: The Reset Output RSTOUT provides a special reset signal for external circuitry. RSTOUT is activated at the beginning of the reset sequence, triggered via RSTIN, a watchdog timer overflow or by the SRST instruction. For internal resets the activation of RSTOUT can be disabled. RSTOUT remains active (low) until the end of the reset sequence, until disabled by user software, or latest until the EINIT instruction is executed.
This should give you an indication if the device going through a reset.
Im not using the Watchdog.
How about using it? That is, the implementation of your soft reset function would enable the watchdog, program it for the shortest interval you can, and then spin, waiting for the WDT to reset the chip.
Thanks guy's ...