Syntax

' -------------------------------------------------------------------------
' Program Description
' -------------------------------------------------------------------------
'
' Demonstrates the use of the RESETWDT instruction in SX/B.  When the
' RESETWDT instruction is removed (with comment), the LED will flash due
' to the SX being reset after the watchdog timer timeout.

' -------------------------------------------------------------------------
' Device Settings
' -------------------------------------------------------------------------

DEVICE          SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, WATCHDOG
FREQ            4_000_000
ID              "RESETWDT"

' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------

Led             VAR     RB.0

' =========================================================================
  PROGRAM Start
' =========================================================================

' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------

Start:
  OPTION = %11111110                            ' timeout = ~1.2 seconds
  LOW Led                                       ' LED off
  PAUSE 500                                     ' wait for LED on

Main:
  DO
    ' RESETWDT                                  ' prevent timeout
    HIGH Led                                    ' LED on
  LOOP