TIM_TimeBase

所属分类:单片机开发
开发工具:C/C++
文件大小:726KB
下载次数:83
上传日期:2016-08-30 16:51:12
上 传 者且逆风
说明:  博世 Bmi160驱动串口输出,spi读取
(Bosch Bmi160 drive serial output, spi read)

文件列表:
TIM_TimeBase\.cproject (91293, 2016-08-18)
TIM_TimeBase\.project (790, 2016-08-18)
TIM_TimeBase\.settings\org.eclipse.cdt.managedbuilder.core.prefs (1045, 2016-08-18)
TIM_TimeBase\.settings\org.eclipse.core.resources.prefs (387, 2016-08-18)
TIM_TimeBase\CSpyServer.log (0, 2016-08-18)
TIM_TimeBase\driver\bmi160.c (2165, 2016-08-18)
TIM_TimeBase\driver\bmi160.h (161053, 2016-08-18)
TIM_TimeBase\driver\flash.c (8026, 2016-08-18)
TIM_TimeBase\driver\flash.h (397, 2016-08-18)
TIM_TimeBase\driver\gpio.c (111, 2016-08-18)
TIM_TimeBase\driver\gpio.h (193, 2016-08-18)
TIM_TimeBase\driver\spi.c (4563, 2016-08-16)
TIM_TimeBase\driver\spi.h (425, 2016-08-11)
TIM_TimeBase\driver\sys.c (6930, 2016-08-18)
TIM_TimeBase\driver\sys.h (2361, 2016-08-02)
TIM_TimeBase\driver\sysclock.c (2308, 2016-08-16)
TIM_TimeBase\driver\sysclock.h (125, 2016-08-16)
TIM_TimeBase\driver\systick.c (682, 2016-08-16)
TIM_TimeBase\driver\SysTick.h (230, 2016-08-02)
TIM_TimeBase\driver\timer.h (293, 2016-08-18)
TIM_TimeBase\driver\timer2.c (1369, 2016-08-18)
TIM_TimeBase\driver\timer3.c (1322, 2016-08-18)
TIM_TimeBase\driver\uart.c (5108, 2016-08-18)
TIM_TimeBase\driver\uart.h (917, 2016-08-18)
TIM_TimeBase\driver\user_data.h (4229, 2016-08-18)
TIM_TimeBase\driver\Variable_define.c (1351, 2016-08-18)
TIM_TimeBase\driver\Variable_define.h (2869, 2016-08-18)
TIM_TimeBase\interface\Algorithm.c (6853, 2016-08-18)
TIM_TimeBase\interface\Algorithm.h (771, 2016-08-18)
TIM_TimeBase\interface\CmdProcess.c (57851, 2016-08-19)
TIM_TimeBase\interface\CmdProcess.h (402, 2016-08-18)
TIM_TimeBase\Libraries\startup_stm32f30x.s (23015, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_adc.h (18695, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_adc.h~RF8fb80b.TMP (18676, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_can.h (27231, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_cec.h (12347, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_comp.h (11336, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_crc.h (4649, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_dac.h (15673, 2016-08-18)
TIM_TimeBase\Libraries\STM32F30x_StdPeriph_Driver\inc\stm32f37x_dbgmcu.h (4513, 2016-08-18)
... ...

/** @page TIM_TimeBase TIM base Example @verbatim ******************** (C) COPYRIGHT 2012 STMicroelectronics ******************* * @file TIM_TimeBase/readme.txt * @author MCD Application Team * @version V1.1.0 * @date 20-September-2012 * @brief TIM Time Base Example Description. ****************************************************************************** * * 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. * ****************************************************************************** @endverbatim @par Example Description This example shows how to configure the TIM peripheral in Output Compare Timing mode with the corresponding Interrupt requests for each channel in order to generate 4 different time bases. The TIM3CLK frequency is set to SystemCoreClock (Hz), to get TIM3 counter clock at 6 MHz so the Prescaler is computed as following: - Prescaler = (TIM3CLK / TIM3 counter clock) - 1 SystemCoreClock is set to 72MHz. The TIM3 CC1 register value is equal to 40961, CC1 update rate = TIM3 counter clock / CCR1_Val = 1757.77 Hz, so the TIM3 Channel 1 generates an interrupt each 6.8ms The TIM3 CC2 register is equal to 27309, CC2 update rate = TIM3 counter clock / CCR2_Val = 263***9 Hz so the TIM3 Channel 2 generates an interrupt each 4.55ms The TIM3 CC3 register is equal to 13654, CC3 update rate = TIM3 counter clock / CCR3_Val = 5273.18 Hz so the TIM3 Channel 3 generates an interrupt each 2.27ms The TIM3 CC4 register is equal to 6826, CC4 update rate = TIM3 counter clock / CCR4_Val = 10547.9 Hz so the TIM3 Channel 4 generates an interrupt each 1.13ms. When the counter value reaches the Output compare registers values, the Output Compare interrupts are generated and, in the handler routine, 4 leds (LED3, LED4, LED5 and LED6) are toggled with the following frequencies: - LED3: 878.88 Hz (CC1) - LED4: 1318.24Hz (CC2) - LED5: 2636.59Hz (CC3) - LED6: 5273.95Hz (CC4) @par Directory contents - TIM_TimeBase/stm32f30x_conf.h Library Configuration file - TIM_TimeBase/stm32f30x_it.c Interrupt handlers - TIM_TimeBase/stm32f30x_it.h Header for stm32f30x_it.c - TIM_TimeBase/main.c Main program - TIM_TimeBase/main.h Header for main.c - TIM_TimeBase/system_stm32f30x.c STM32F30x system source file @note The "system_stm32f30x.c" file contains the system clock configuration for STM32F30x devices, and is customized for use with STM32F3-Discovery Kit. The STM32F30x is configured to run at 72 MHz, following the three configuration below: + PLL_SOURCE_HSI - HSI (~8 MHz) used to clock the PLL, and the PLL is used as system clock source. + PLL_SOURCE_HSE - HSE (8 MHz) used to clock the PLL, and the PLL is used as system clock source. - The HSE crystal is not provided with the Discovery Kit, some hardware modification are needed in manner to connect this crystal. For more details, refer to section "4.10 OSC clock" in "STM32F3 discovery kit User manual (UM1570)" + PLL_SOURCE_HSE_BYPASS - HSE bypassed with an external clock (fixed at 8 MHz, coming from ST-Link circuit) used to clock the PLL, and the PLL is used as system clock source. - Some hardware modification are needed in manner to bypass the HSE with clock coming from the ST-Link circuit. For more details, refer to section "4.10 OSC clock" in "STM32F3 discovery kit User manual (UM1570)" User can select one of the three configuration in system_stm32f30x.c file (default configuration is PLL_SOURCE_HSE_BYPASS). @par Hardware and Software environment - This example runs on STM32F30x Devices. - This example has been tested with STMicroelectronics STM32F3-Discovery (MB1035) and can be easily tailored to any other supported device and development board. - STM32F3-Discovery Set-up - Use LED3, LED4, LED5 and LED6 connected respectively to PE.09, PE.08,PE.10 and PE.15 pins and connect them on an oscilloscope to show the different Time Base signals. @par How to use it ? In order to make the program work, you must do the following : + EWARM - Open the TIM_TimeBase.eww workspace - Rebuild all files: Project->Rebuild all - Load project image: Project->Debug - Run program: Debug->Go(F5) + MDK-ARM - Open the TIM_TimeBase.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_TimeBase" - 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 for ARM - Open the TrueSTUDIO for ARM 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_TimeBase" - 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 STMicroelectronics

*/

近期下载者

相关文件


收藏者