TIM_PWM_Input

所属分类:处理器开发
开发工具:Visual C++
文件大小:47KB
下载次数:3
上传日期:2013-10-23 05:47:02
上 传 者mustafabudak
说明:  STM32F4DISCOVERY RUNING TEST SAMPLE OK

文件列表:
TIM_PWM_Input\EWARM\stm32f4xx_flash.icf (1342, 2011-10-28)
TIM_PWM_Input\EWARM\TIM_PWM_Input.ewd (24221, 2011-10-28)
TIM_PWM_Input\EWARM\TIM_PWM_Input.ewp (26118, 2011-10-28)
TIM_PWM_Input\EWARM\TIM_PWM_Input.eww (167, 2011-10-28)
TIM_PWM_Input\main.c (5178, 2011-10-28)
TIM_PWM_Input\MDK-ARM\TIM_PWM_Input.uvgui.Administrator (3556, 2012-05-07)
TIM_PWM_Input\MDK-ARM\TIM_PWM_Input.uvopt (13572, 2012-05-07)
TIM_PWM_Input\MDK-ARM\TIM_PWM_Input.uvproj (17336, 2012-05-07)
TIM_PWM_Input\MDK-ARM\TIM_PWM_Input_TIM_PWM_Input.dep (6105, 2012-05-07)
TIM_PWM_Input\MDK-ARM\TIM_PWM_Input_uvopt.bak (13331, 2011-10-28)
TIM_PWM_Input\MDK-ARM\TIM_PWM_Input_uvproj.bak (17801, 2011-10-28)
TIM_PWM_Input\stm32f4xx_conf.h (3818, 2011-10-28)
TIM_PWM_Input\stm32f4xx_it.c (5273, 2011-10-28)
TIM_PWM_Input\stm32f4xx_it.h (2017, 2011-10-28)
TIM_PWM_Input\system_stm32f4xx.c (21172, 2011-10-28)
TIM_PWM_Input\TASKING\TIM_PWM_Input\.cproject (37647, 2011-10-28)
TIM_PWM_Input\TASKING\TIM_PWM_Input\.project (3095, 2011-10-28)
TIM_PWM_Input\TASKING\TIM_PWM_Input\TASKING\stm32f4xx.lsl (15846, 2011-10-28)
TIM_PWM_Input\TASKING\TIM_PWM_Input\TIM_PWM_Input.launch (4144, 2011-10-28)
TIM_PWM_Input\TrueSTUDIO\TIM_PWM_Input\.cproject (20653, 2011-10-28)
TIM_PWM_Input\TrueSTUDIO\TIM_PWM_Input\.project (4557, 2011-10-28)
TIM_PWM_Input\TrueSTUDIO\TIM_PWM_Input\.settings\com.atollic.truestudio.debug.hardware_device.prefs (222, 2011-10-28)
TIM_PWM_Input\TrueSTUDIO\TIM_PWM_Input\stm32_flash.ld (4978, 2011-10-28)
TIM_PWM_Input\TrueSTUDIO\TIM_PWM_Input\TIM_PWM_Input.elf.launch (4777, 2011-10-28)
TIM_PWM_Input\TASKING\.metadata\Link (0, 2011-10-28)
TIM_PWM_Input\TASKING\TIM_PWM_Input\TASKING (0, 2013-04-22)
TIM_PWM_Input\TrueSTUDIO\.metadata\Link (0, 2011-10-28)
TIM_PWM_Input\TrueSTUDIO\TIM_PWM_Input\.settings (0, 2013-04-22)
TIM_PWM_Input\MDK-ARM\TIM_PWM_Input (0, 2012-05-24)
TIM_PWM_Input\TASKING\.metadata (0, 2013-04-22)
TIM_PWM_Input\TASKING\TIM_PWM_Input (0, 2013-04-22)
TIM_PWM_Input\TrueSTUDIO\.metadata (0, 2013-04-22)
TIM_PWM_Input\TrueSTUDIO\TIM_PWM_Input (0, 2013-04-22)
TIM_PWM_Input\EWARM (0, 2013-04-22)
TIM_PWM_Input\MDK-ARM (0, 2013-04-22)
TIM_PWM_Input\TASKING (0, 2013-04-22)
TIM_PWM_Input\TrueSTUDIO (0, 2013-04-22)
TIM_PWM_Input (0, 2013-04-22)

/** @page TIM_PWM_Input TIM_PWM_Input @verbatim ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* * @file TIM_PWM_Input/readme.txt * @author MCD Application Team * @version V1.0.0 * @date 19-September-2011 * @brief Description of the TIM PWM_Input 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. ****************************************************************************** @endverbatim @par Example Description This example shows how to use the TIM peripheral to measure the frequency and duty cycle of an external signal. The TIMxCLK frequency is set to SystemCoreClock/4 (Hz), the Prescaler is 0 so the counter clock is SystemCoreClock/2 (Hz). SystemCoreClock is set to 168 MHz fro STM32F4xx Devices Revision A. TIM4 is configured in PWM Input Mode: the external signal is connected to TIM4 Channel2 used as input pin. To measure the frequency and the duty cycle we use the TIM4 CC2 interrupt request, so In the TIM4_IRQHandler routine, the frequency and the duty cycle of the external signal are computed. The "Frequency" variable contains the external signal frequency: TIM4 counter clock = SystemCoreClock / 2, Frequency = TIM4 counter clock / TIM4_CCR2 in Hz, The "DutyCycle" variable contains the external signal duty cycle: DutyCycle = (TIM4_CCR1*100)/(TIM4_CCR2) in %. The minimum frequency value to measure is 1280 Hz (TIM4 counter clock / CCR MAX). @par Directory contents - TIM_PWM_Input/stm32f4xx_conf.h Library Configuration file - TIM_PWM_Input/stm32f4xx_it.c Interrupt handlers - TIM_PWM_Input/stm32f4xx_it.h Interrupt handlers header file - TIM_PWM_Input/main.c Main program - TIM_PWM_Input/system_stm32f4xx.c STM32F4xx system clock configuration file @par Hardware and Software environment - This example runs on STM32F4xx Devices Revision A. - This example has been tested with STM32F4-Discovery (MB997) RevA and can be easily tailored to any other development board. - STM32F4-Discovery - Connect the external signal to measure to the TIM4 CH2 pin (PB.07). @par How to use it ? In order to make the program work, you must do the following : + EWARM - Open the TIM_PWM_Input.eww workspace - Rebuild all files: Project->Rebuild all - Load project image: Project->Debug - Run program: Debug->Go(F5) + MDK-ARM - Open the TIM_PWM_Input.uvproj project - 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->Import, select General->'Existing Projects into Workspace' and then click "Next". - Browse to TASKING workspace directory and select the project "TIM_PWM_Input" - Rebuild all project files: Select the project in the "Project explorer" window then click on Project->build project menu. - Run program: Select the project in the "Project explorer" window then click Run->Debug (F11) + TrueSTUDIO - 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 and select the project "TIM_PWM_Input" - Rebuild all project files: Select the project in the "Project explorer" window then click on Project->build project menu. - Run program: Select the project in the "Project explorer" window then click Run->Debug (F11) *

© COPYRIGHT 2011 STMicroelectronics

*/

近期下载者

相关文件


收藏者