13.15.3.4 Software Reset (SWR)

This device does not provide a specific RESET instruction; however, a hardware Reset can be performed in software (software Reset) by executing a software Reset command sequence. The software Reset acts like a MCLR Reset. The software Reset sequence requires the system unlock sequence to be executed before the SWRST bit (RSWRST[0]) can be written.

A software Reset is performed as follows:

  1. Write the system unlock sequence.
  2. Set the SWRST bit (RSWRST[0]) = 1.
  3. Read the RSWRST register.

Setting the SWRST bit (RSWRST[0]) will arm the software Reset. The subsequent read of the RSWRST register triggers the software Reset, which must occur on the next clock cycle following the read operation. To ensure no other user code is executed before the Reset event occurs, it is recommended that four NOP instructions or a while(1) statement be placed after the READ instruction.

The SWR Status bit (RCON[6]) is set to indicate the software Reset.