STM8S/A Standard Peripherals Firmware Library: Synchronisation of TIM5 using TIM6

STM8S/A

Synchronisation of TIM5 using TIM6
  ******************** (C)COPYRIGHT 2014 STMicroelectronics *******************
  * @file    TIM5/TIM5_Synchronisation_with_TIM6/readme.txt
  * @author  MCD Application Team
  * @version V2.2.0
  * @date    30-September-2014
  * @brief   Description of the TIM5 Synchronisation using TIM6 Example.
  ******************************************************************************
  *
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2
  *
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  
Example description

This example provides a short description of how to use the TIM5 peripheral synchronised by TIM6. TIM5 is configured as a slave of TIM6.

TIM5 is configured to be enabled if it detects an edge on its input trigger (TRGI). TIM6 is configurated to generate an edge through its (TRGO) at the update event. TIM5 TRGI is configurated to be connected (internal connection) to TIM6 TRGO.

If line "TIM6_Cmd(ENABLE);" in main.c is commented, TIM6 is not enabled => no Edge is detected on TIM5 TRGI, ==> Result variable value will be equal to 0 (FAILED). If line "TIM6_Cmd(ENABLE);" in main.c is uncommented, TIM6 is enabled => TIM6 generate an Edge on its TRGO and an Edge is detected on TIM5 TRGI. ==> Result variable value will be equal to 1 (PASS).

Directory contents
Hardware and Software environment
  • This example runs only on STM8S903 devices.
  • This example has been tested with a STMicroelectronics generic board (STM8S903 device) and can be easily tailored to any other development board.
How to use it ?

In order to make the program work, you must do the following :

  • Copy all source files from this example folder to the template folder under Project
  • Open your preferred toolchain
  • Rebuild all files and load your image into target memory
  • Run the example
  • Example result can be displayed using "Result" variable.
Note:
  • High-Density STM8A devices are the STM8AF52xx STM8AF6269/8x/Ax, STM8AF51xx, and STM8AF6169/7x/8x/9x/Ax microcontrollers where the Flash memory density ranges between 32 to 128 Kbytes
  • Medium-Density STM8A devices are the STM8AF622x/4x, STM8AF6266/68, STM8AF612x/4x, and STM8AF6166/68 microcontrollers where the Flash memory density ranges between 8 to 32 Kbytes
  • High-Density STM8S devices are the STM8S207xx, STM8S007 and STM8S208xx microcontrollers where the Flash memory density ranges between 32 to 128 Kbytes.
  • Medium-Density STM8S devices are the STM8S105x and STM8S005 microcontrollers where the Flash memory density ranges between 16 to 32-Kbytes.
  • Low-Density STM8S devices are the STM8S103xx, STM8S003 and STM8S903xx microcontrollers where the Flash density is 8 Kbytes.

© COPYRIGHT STMicroelectronics

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com