30.3.3.1 Step 1 (PRECLEAR)

The software must first perform a PRECLEAR action by writing PRECLEAR to the COMMAND register. This action places the SWDT into a state that permits it to be cleared by step 2.

A PRECLEAR command can be successfully accepted by the SWDT whether or not the window is open. It must be received in the correct sequence, i.e., before a CLEAR command, and not after another PRECLEAR. The PRECLEAR bit in the INTFLAGS register indicates when a PRECLEAR command can legally be received.

Writing a value other than PRECLEAR as the first step will cause an error, indicated by the ERROR bit in the INTFLAGS register. Additional bits in the INTFLAGS register indicate why an error occurred.