Overview
========
This WDOG Example project demonstrates an eight second watchdog and different
ways (once per second and one time after getting 2 second warning interrupt)
to feed it to postpone the reset. Finally allows the watchdog to time out.

NOTE: Please notice that because WDOG control registers are write-once only.
      And for the field WDT, once software performs a write "1" operation
	  to this bit, it can not be reset/cleared until the next POR, this
	  bit does not get reset/ cleared due to any system reset. So the
	  WDOG_Init function can be called only once after power reset when
	  WDT set, and the WDOG_Disable function can be called only once
	  after reset.

NOTE: It is very unlikely that this example can be executed in a debugger

NOTE: After flashing this example you have to put the board in ISP mode
      to be able to flash it again as the watchdog keeps resetting the
      connection to the debugger. See the User Manual on how to put the
      board in ISP mode.

Toolchain supported
===================
- IAR embedded Workbench  8.50.9
- Keil MDK  5.33
- GCC ARM Embedded  9.3.1
- MCUXpresso  11.3.0

Hardware requirements
=====================
- Mini/micro USB cable
- Embedded Artists iMX RT1062 Developer's Kit
- Personal Computer

Board settings
==============
No special settings are required.

Prepare the Demo
================
1.  Connect a USB cable between the host PC and the OpenSDA USB port on the target board. 
2.  Open a serial terminal with the following settings:
    - 115200 baud rate
    - 8 data bits
    - No parity
    - One stop bit
    - No flow control
3.  Download the program to the target board.
4.  Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo
================
These instructions are displayed/shown on the terminal window:
~~~~~~~~~~~~~~~~~~~~~~~
******** System Start ********
System reset by: Power On Reset!

- Test the WDOG refresh function by using interrupt.
--- wdog Init done, timeout=8s, irq=2s before ---
   Feeds the WDOG every second for the first 5 seconds
   and no interrupts should be seen during that period.
   Then stops feeding the WDOG and an interrupt should come 6s later.
   Will then feed once to reset the WDOG.
   After 6 seconds the interrupt will occur again and this time it will
   be ignored so the board will reset 2 seconds later.

  0s
WDOG has be refreshed!
  1s
WDOG has be refreshed!
  2s
WDOG has be refreshed!
  3s
WDOG has be refreshed!
  4s
WDOG has be refreshed!
  5s
WDOG has be refreshed! Should see interrupt in 6 seconds
  6s
  7s
  8s
  9s
 10s
 11s
GOT WARNING INTERRUPT!
WDOG has be refreshed! Should see interrupt in 6 seconds
 12s
 13s
 14s
 15s
 16s
 17s
GOT WARNING INTERRUPT!
Ignoring it. Should reset in 2 seconds
 18s

******** System Start ********
System reset by: Power On Reset!
...

~~~~~~~~~~~~~~~~~~~~~
Customization options
=====================

