/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name          : Readme.txt
* Author             : MCD Application Team
* Date First Issued  : 01/16/2007
* Description        : Description of STANDBY mode software provided with AN2476.
********************************************************************************
* History:
* 01/16/2007 : V1.0
********************************************************************************
* 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 shows how to enter the system to STANDBY mode and wake-up from this
mode using: external RESET, WKP_STDBY pin or RTC Alarm (if RTC_ON is set
in conf.h file)
In the associated software, the system clock is set to 60 MHz, the EXTIT line7
is configured to generate an interrupt on falling edge.

If RTC is set on (by uncomment the line '#define RTC_ON' in 75x_conf.h file):
The RTC is programmed to generate an interrupt each 1 second.
In the RTC interrupt handler, a led connected to P2.18 pin is toggled, and a led
connected to P0.16 is on. This is used to indicate whether the MCU is in STANDBY
or RUN mode.
When a falling edge is detected on EXTIT line7 an interrupt is generated. In the 
EXTIT handler routine the RTC is configured to generate an Alarm event in 10 second
then the system enters STANDBY mode causing the P2.18 pin to stop toggling. 
A rising edge on WKP_STDBY pin or an external RESET will wake-up the system from
STANDBY. If within 10 second neither rising edge on WKP_STDBY nor external RESET
are generated, the RTC Alarm will wake-up the system.
After that the led connected to P0.16 is switched on and the VCO of the PLL
(FREEOSC) supplies the system clock.
After The clock configuration (system clock set to 60 MHz), the P2.18 pin restarts
toggling.

If RTC on is not set (by comment the line '#define RTC_ON' in 75x_conf.h file):
a led connected to P2.18 pin is switched on, to indicate the MCU is in RUN mode.
When a falling edge is detected on EXTIT line7 an interrupt is generated,
the system enters standby mode causing the P2.18 pin to switch off.
A rising edge on WKP_STDBY pin or an external RESET will wake-up the system from
STANDBY. Then the led connected to P0.16 is switched on and the VCO of the PLL
(FREEOSC) supplies the system clock.
After The clock configuration (system clock set to 60 MHz), the P2.18 pin is switched on.

The system clock is outputted on P0.01 pin, you can monitor this clock using an
oscilloscope.


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


Hardware environment
====================
 - Connect a led to pin P0.16 (LD3 on STR75x-EVAL board).
 - Connect a led to pin P2.18 (LD4 on STR75x-EVAL board).
 - Connect a push-button to WKP_STDBY pin (P1.15) (Wakeup push-button on
   STR75x-EVAL board).
 - Connect a push-button to EXTIT line7 pin (P1.05) (Key push-button on
   STR75x-EVAL board).
   

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
- Compile the directory content files and required Library files :
  + 75x_lib.c
  + 75x_rtc.c
  + 75x_gpio.c
  + 75x_mrcc.c
  + 75x_eic.c
  + 75x_extit.c
  + 75x_cfg.c
    
- Link all compiled files and load your image into Flash
- Run the example


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