Hi,
there’s no instruction that would reset the device directly. You can use se_illegal instruction to trigger program interrupt IVOR6 and then reset the device in exception handler.
Notice that if you use se_illegal instruction (opcode 0x0000) then it depends if the device is running in debug mode or in standalone mode:
- in debug mode, se_illegal works like software breakpoint. IVOR6 is not triggered. If you just step the code, it works like nop instruction. If you run the code and the program reaches se_illegal instruction, the device will stop execution and it will enter debug mode.
- if the device is running in standalone without debugger, se_illegal will trigger IVOR6 exception.
If you want to test IVOR6 exception in debug mode, use another invalid opcode. For example, 0x0003 is not assigned to any VLE instruction.
Mode Entry module can be used to reset the device. Use the code below in IVOR6 exception handler:
/* software reset */
ME.MCTL.R = 0x00005AF0;
ME.MCTL.R = 0x0000A50F;
Regards,
Lukas