/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name          : Readme.txt
* Author             : MCD Application Team
* Version            : V4.0
* Date               : 10/09/2007
* Description        : Description of the WDG Example.
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/

Example description
===================
This example highlights two main features of the Watchdog Timer peripheral:
  - Free running Timer Mode,
  - Watchdog mode.

The user has to select one mode by uncommenting the corresponding define in the
 main.c file.

It is made on 2 parts :

1) Timer mode
   - Configure the GPIO,
   - Set the timer period value,
   - Configure the interrupt channel priority,
   - Enable the count-down timer,
   - Infinite loop (the interrupt handler toggles the GPIO0 I/O port).

2) Watchdog mode
   - Configure the GPIO,
   - Set the prescaler and the count reload value,
   - Enable the IRQ0 for timer 3,
   - Enable the Output Compare for the TIM3 peripheral,
   - Configure the TIM3 Output Compare interrupt (output compare A),
   - Enable the Watchdog (with no possibility to disable),
   - Refresh and update the watchdog counter in TIM3 interrupt routine.
   - Change the "#define Refresh_Time" value to change the Watchdog reload 
     counter value. If the Refresh_Time < 32768, the Watchdog will generate a 
     system Reset.   
   - If a WDG reset has been occured the led connected to P1.15 (LD9 on mb393)
     will toggle. 
   - If Refresh_Time > 32768, all GPIO0 pin ( LD3, LD4, LD5 and LD6 on STR71x-Eval
     board are toggling and LD9 will be OFF.

NOTE: for the Watchdog mode example, the watchdog will generate a system reset. 
Therefore, the debugger connexion will be lost.


Directory contents
==================
 71x_conf.h  Library Configuration file
 71x_it.c    Interrupt handlers
 71x_it.h    Interrupt handlers header file
 main.c      Main program
 

Hardware environment
====================
This example works as standalone on the STR71x-Eval board (mb393) and extra 
hardware implementation is not required to run the example.


How to use it
=============
In order to make the program work, you must do the following :
- Create a project and setup all your toolchain's start-up files
- Ensure that Flash memory is mapped at address 0x0000 using H/W boot pins,
- Compile the directory content files and required Library files :
  + 71x_lib.c
  + 71x_wdg.c
  + 71x_apb.c
  + 71x_eic.c
  + 71x_tim.c
  + 71x_gpio.c
  + 71x_rccu.c

- Link all compiled files and load your image into FLASH
- Run the example

******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****
