/** 
  @page Internal_OSC_Calib AN3300 Internal RC Oscillators Calibration readme file 
  
  @verbatim
  ******************** (C) COPYRIGHT 2012 STMicroelectronics *******************
  * @file    Internal_OSC_Calib/readme.txt 
  * @author  MCD Application Team
  * @version V1.1.0
  * @date    24-January-2012
  * @brief   Description of the AN3300 "STM32L1xxx Internal RC oscillators calibration".
  ******************************************************************************
  * THE PRESENT FIRMWARE 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 FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * FOR MORE INFORMATION PLEASE READ CAREFULLY THE LICENSE AGREEMENT FILE
  * LOCATED IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE.
  *
  ******************************************************************************
   @endverbatim

@par Description

  This application note describes a firmware that:
    1- calibrates the internal RC oscillators (HSI and MSI) using an accurate 
       reference frequency.
    2- measures the internal RC oscillators (LSI and MSI)

  By default the firmware calibrates the HSI oscillator (selected as system clock
  source) with minimum error method using LSE oscillator as reference signal.
  Connect an oscilloscope to PA8 to display the HSI frequency.
  Once the calibration has finished, the HSI value is displayed on LCD.
  After that, MSI and LSI oscillators are measured and the values are displayed
  on LCD.

  If the MSI oscillator is selected as system clock source, MSI is calibrated
  and then LSI is measured.
  Note: System clock source can be configured using the automatic clock 
  configuration system "STM32L1xx_Clock_Configuration_V1.0.0.xls" provided with
  STM32L1x_StdPeriph_Lib package.

  Known Limitation:
   - When the LSE oscillator is used as reference frequency, MSI should be calibrated
     at 4MHz, 2MHz or 1 MHz ranges, no limitation on HSI calibration.
   - LSI frequency can't be measured if MSI oscillator (selected as system clock source)
     is configured in ranges 64KHz, 128KHz and 512 KHz.

@par Directory contents 

 - "Internal_OSC_Calib\inc": contains the firmware header files 
    - main.h                   Main header file
    - InternOscCalibration.h   Internal Oscillators (HSI and MSI) calibration configuration file
    - LSIMeasurement.h         LSI measurement configuration file
    - MSIMeasurement.h         MSI measurement configuration file
    - stm32l1xx_conf.h         Library Configuration file
    - stm32l1xx_it.h           Interrupt routines declaration

 - "Internal_OSC_Calib\MDK-ARM": contains pre-configured project for RVMDK toolchain

 - "Internal_OSC_Calib\RIDE": contains pre-configured project for RIDE toolchain

 - "Internal_OSC_Calib\TASKING": contains pre-configured project for TASKING toolchain

 - "Internal_OSC_Calib\EWARM": contains pre-configured project for EWARM toolchain

 - "Internal_OSC_Calib\TrueSTUDIO": contains pre-configured project for TrueSTUDIO toolchain

 - "Internal_OSC_Calib\src": contains the firmware source files
    - main.c                   Main program
    - InternOscCalibration.c   Internal Oscillators (HSI and MSI) calibration routines
    - LSIMeasurement.c         LSI measurement routine 
    - MSIMeasurement.c         MSI measurement routine
    - system_stm32l1xx.c       CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
    - stm32l1xx_it.c           Interrupt routines source

@note The "system_stm32l1xx.c" is generated by an automatic clock configuration 
      system and can be easily customized to your own configuration. 
      To select different clock setup, use the "STM32L1xx_Clock_Configuration_V1.1.0.xls" 
      provided with the AN3309 package available on <a href="http://www.st.com/internet/mcu/family/141.jsp">  ST Microcontrollers </a>


@par Hardware and Software environment

  - This example runs on STM32L1xx Ultra Low Power High- and Medium-Density Devices.
  
  - This example has been tested with STMicroelectronics STM32L152D-EVAL (STM32L1xx 
    Ultra Low Power High-Density) and STM32L152-EVAL (STM32L1xx Ultra Low 
    Power Medium-Density) evaluation board and can be easily tailored to any 
    other supported device and development board.

  - STM32L152-EVAL and STM32L152D-EVAL Set-up
     - Leds: LD1 and LD2
     - By default, the LSE method is used so no hardware connection is required
       (the 32.768 KHz quartz is already connected in STM32L152-EVAL and STM32L152D-EVAL).
       In case of using other reference frequency, connect the source to PB8
       (The source voltage levels have to correspond to levels allowed for this pin).


@par How to use it ?

In order to run the internal RC oscillators calibration demo, you have do the following:

   - EWARM:
       - Open the Internal_OSC_Calib.eww workspace
       - In the workspace toolbar select the project config:
          - STM32L152-EVAL: to configure the project for STM32L Ultra Low Power Medium-density devices
          - STM32L152D-EVAL: to configure the project for STM32L Ultra Low Power High-density devices
       - Load project image: Project->Debug
       - Run program: Debug->Go(F5)
       
   - RIDE:
      - Open the Internal_OSC_Calib.rprj project
      - In the configuration toolbar(Project->properties) select the project config:
          - STM32L152-EVAL: to configure the project for STM32L Ultra Low Power Medium-density devices
          - STM32L152D-EVAL: to configure the project for STM32L Ultra Low Power High-density devices
      - Rebuild all files: Project->build project
      - Load project image: Debug->start(ctrl+D)
      - Run program: Debug->Run(ctrl+F9)

   - MDK-ARM:
      - Open the Internal_OSC_Calib.uvproj project
      - In the build toolbar select the project config:
          - STM32L152-EVAL: to configure the project for STM32L Ultra Low Power Medium-density devices
          - STM32L152D-EVAL: to configure the project for STM32L Ultra Low Power High-density devices
      - Rebuild all files: Project->Rebuild all target files
      - Load project image: Debug->Start/Stop Debug Session
      - Run program: Debug->Run (F5)

    - TASKING:
      - Open TASKING toolchain.
      - Click on File->Switch Workspace->Other and browse to TASKING workspace directory.
      - Click on File->Import, select General->'Existing Projects into Workspace' and then click "Next". 
      - Browse to TASKING workspace directory, select the project:
          - STM32L152D-EVAL: to configure the project for STM32L Ultra Low Power High-density devices
      - Rebuild all project files: Select the project in the "Project explorer" 
        window then click on Project->build project menu.
      - Run program: Run->Debug 
   - TrueSTUDO:
      - Open the TrueSTUDIO toolchain.
      - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace directory.
      - Click on File->Import, select General->'Existing Projects into Workspace' and then click "Next". 
      - Browse to the TrueSTUDIO workspace directory, select the project:
          - STM32L152-EVAL: to configure the project for STM32L Ultra Low Power Medium-density devices
          - STM32L152D-EVAL: to configure the project for STM32L Ultra Low Power High-density devices
      - Rebuild all project files: Select the project in the "Project explorer" 
        window then click on Project->build project menu.
      - Run program: Run->Debug (F11)

@note
- Ultra Low Power Medium-density devices are STM32L151xx and STM32L152xx 
  microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes.
- Ultra Low Power Medium-density Plus devices are STM32L151xx, STM32L152xx and 
  STM32L162xx microcontrollers where the Flash memory density is 256 Kbytes.
- Ultra Low Power High-density devices are STM32L151xx, STM32L152xx and STM32L162xx 
  microcontrollers where the Flash memory density is 384 Kbytes.

 * <h3><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h3>
 */
