/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
* File Name          : readme.txt
* Author             : MCD Application Team
* Version            : V2.0.0
* Date               : 06/13/2008
* Description        : Description of the AN2592 Application note's OutputCompareToggleMode
*                      example.
********************************************************************************
* 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.
*******************************************************************************/

Example description
===================
This example demonstrates how to perform a long range output compare, toggle mode,
using timer link system.

Two timers are used for this example TIM2 and TIM3, they are synchronized as follows:
  1/ TIM2 is configured to be used as slave for the TIM3.
  2/ TIM2 is used in One Pulse Mode: at each pulse received on its input, a pulse 
  will be generated after the delay loaded in the corresponding registers (TIM2_CCRx). 
  3/ TIM3 generates the input signal for TIM2.
  TIM3 OC1 signal  is used as Trigger Output(TRGO), this event will trigger the 
  slave Timer (TIM2) counter, so the slave mode	is the Trigger mode.
  
  TIM3 Configuration: 
  - Output Compare Active Mode: the TIM3 delay is the MSB part of the TIM2 output signal.
  - TIM3CLK = 72MHz
  - Prescaler = 65535

  TIM2 Configuration: 
  - Output Compare Active Mode: the TIM2 delays are the LSB parts of the TIM2 output signals.
  - TIM2CLK = 72MHz
  - Prescaler = 0 
 
  TIM2 Output Compare delays compute:

  CC1 delay = (MSB*65535 + LSB1)  / TIM2CLK  
            = 1.25 ms

  CC2 delay = (MSB*65535 + LSB2)  / TIM2CLK 
            = 1.48 ms 

  CC3 delay = (MSB*65535 + LSB3)  / TIM2CLK 
            = 1.76 ms 

Directory contents
==================
stm32f10x_conf.h  Library Configuration file
stm32f10x_it.c    Interrupt handlers
stm32f10x_it.h    Interrupt handlers header file
main.c            Main program


Hardware environment
====================
This example runs on STMicroelectronics STM3210B-EVAL and STM3210E-EVAL evaluation
boards and can be easily tailored to any other hardware.

Connect the
- PA.00 (TIM2_CH1)
- PA.01 (TIM2_CH2)
- PA.02 (TIM2_CH3)
- PB.00 
pins to an oscilloscope to monitor the different waveform.


How to use it
=============
 + RVMDK
    - Open the 32Bits_Timer_OutputCompare_ToggleExample.Uv2 project
    - In the build toolbar select the project config:
        - STM3210B-EVAL: to configure the project for STM32 Medium-density devices
        - STM3210E-EVAL: to configure the project for STM32 High-density devices
    - Rebuild all files: Project->Rebuild all target files
    - Load project image: Debug->Start/Stop Debug Session
    - Run program: Debug->Run (F5)    

 + EWARM5
    - Open the 32Bits_Timer_OutputCompare_ToggleExample.eww workspace.
    - In the workspace toolbar select the project config:
        - STM3210B-EVAL: to configure the project for STM32 Medium-density devices
        - STM3210E-EVAL: to configure the project for STM32 High-density devices
    - Rebuild all files: Project->Rebuild all
    - Load project image: Project->Debug
    - Run program: Debug->Go(F5)

 + RIDE
    - Open the 32Bits_Timer_OutputCompare_ToggleExample.rprj project.
    - In the configuration toolbar(Project->properties) select the project config:
       - STM3210B-EVAL: to configure the project for STM32 Medium-density devices
       - STM3210E-EVAL: to configure the project for STM32 High-density devices
    - Rebuild all files: Project->build project
    - Load project image: Debug->start(ctrl+D)
    - Run program: Debug->Run(ctrl+F9)  

 + HiTOP
    - Open the HiTOP toolchain, a "using projects in HiTOP" window appears.
    - Select open an existing project.
    - Browse to open the 32Bits_Timer_OutputCompare_ToggleExample.htp:
        - under STM32F10B_EVAL directory: to select the project for STM32 Medium-density devices.
        - under STM32F10E_EVAL directory: to select the project for STM32 High-density devices
    - Rebuild all files: Project->Rebuild all
    - Click on ok in the "download project" window.
    - Run program: Debug->Go(F5).
    Note: 
          - When using High-density devices, it is mandatory to reset the target
            before loading the project into  target.
          - It is recommended to run the reset script (click on TR button in the
            toolbar menu) after loading the project into target.

NOTE:
 - Medium-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 32 and 128 Kbytes.
 - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
   the Flash memory density ranges between 256 and 512 Kbytes. 
    

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