/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name : readme.txt
* Author : MCD Application Team
* Date First Issued : 05/21/2007
* Description : Description of the TIM1 Example2.
********************************************************************************
* History:
* 05/21/2007: V0.3
********************************************************************************
* THE PRESENT SOFTWARE 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 SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
Example description
===================
This example shows how to configure the TIM1 peripheral to generate 7 PWM signals
with 4 different duty cycles.
TIM1CLK is fixed to 72 MHz, the TIM1 Prescaler is equal to 0x0 so the TIM1 counter
clock used is 72 MHz.
TIM1 frequency is defined as follow:
TIM1 frequency = TIM1CLK/(TIM1_Period + 1) = 17.57 KHz.
The TIM1 CC1 register value is equal to 0x7FF, so the TIM1 Channel 1 and TIM1
Channel 1N generate a PWM signal with a frequency equal to 17.57 KHz
and a duty cycle equal to:
TIM1 Channel1 duty cycle = TIM1_CCR1 /( TIM1_Period + 1) = 50%.
The TIM1 CC2 register value is equal to 0x5FF, so the TIM1 Channel 2 and TIM1
Channel 2N generate a PWM signal with a frequency equal to 17.57 KHz
and a duty cycle equal to:
TIM1 Channel2 duty cycle = TIM1_CCR2 / ( TIM1_Period + 1)= 37.5%.
The TIM1 CC3 register value is equal to 0x3FF, so the TIM1 Channel 3 and TIM1
Channel 3N generate a PWM signal with a frequency equal to 17.57 KHz
and a duty cycle equal to:
TIM1 Channel3 duty cycle = TIM1_CCR3 / ( TIM1_Period + 1) = 25%.
The TIM1 CC4 register value is equal to 0x1FF, so the TIM1 Channel 4
generate a PWM signal with a frequency equal to 17.57 KHz KHz
and a duty cycle equal to:
TIM1 Channel4 duty cycle = TIM1_CCR4 / ( TIM1_Period + 1) = 12.5%.
The TIM1 waveform can be displayed using an oscilloscope.
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
====================
Connect the TIM1 pins to an oscilloscope:
- TIM1_CH1 pin (PA.08)
- TIM1_CH1N pin (PB.13)
- TIM1_CH2 pin (PA.09)
- TIM1_CH2N pin (PB.14)
- TIM1_CH3 pin (PA.10)
- TIM1_CH3N pin (PB.15)
- TIM1_CH4 pin (PA.11)
How to use it
=============
In order to make the program work, you must do the following:
- Create a project and setup all your toolchain's start-up files
- Compile the directory content files and required Library files:
+ stm32F10x_lib.c
+ stm32F10x_tim1.c
+ stm32F10x_gpio.c
+ stm32F10x_rcc.c
+ stm32F10x_nvic.c
+ stm32F10x_flash.c
- Link all compiled files and load your image into either RAM or Flash
- Run the example
******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE******
没有合适的资源?快使用搜索试试~ 我知道了~
基于(英蓓特)STM32V100的TIM1程序
共102个文件
h:27个
c:26个
o:10个
需积分: 3 9 下载量 146 浏览量
2009-01-17
10:13:18
上传
评论
收藏 417KB RAR 举报
温馨提示
基于(英蓓特)STM32V100的TIM1程序
资源推荐
资源详情
资源评论
收起资源包目录
基于(英蓓特)STM32V100的TIM1程序 (102个子文件)
TIM1.axf 126KB
TIM1_Uv2.Bak 3KB
TIM1_Opt.Bak 3KB
stm32f10x_tim1.c 111KB
stm32f10x_tim.c 97KB
stm32f10x_adc.c 54KB
stm32f10x_i2c.c 44KB
stm32f10x_rcc.c 42KB
stm32f10x_usart.c 33KB
stm32f10x_can.c 32KB
stm32f10x_flash.c 31KB
stm32f10x_nvic.c 28KB
stm32f10x_spi.c 25KB
stm32f10x_dma.c 23KB
stm32f10x_it.c 22KB
stm32f10x_it.c 22KB
stm32f10x_gpio.c 21KB
stm32f10x_rtc.c 13KB
stm32f10x_pwr.c 11KB
stm32f10x_bkp.c 10KB
stm32f10x_exti.c 8KB
main.c 8KB
stm32f10x_wwdg.c 8KB
stm32f10x_systick.c 7KB
stm32f10x_lib.c 7KB
stm32f10x_iwdg.c 6KB
stm32f10x_vector.c 3KB
stm32f10x_vector.c 3KB
main.c 3KB
stm32f10x_tim1.crf 67KB
stm32f10x_it.crf 56KB
main.crf 55KB
stm32f10x_lib.crf 54KB
stm32f10x_gpio.crf 33KB
stm32f10x_rcc.crf 32KB
stm32f10x_nvic.crf 28KB
stm32f10x_flash.crf 19KB
stm32f10x_it.d 658B
stm32f10x_lib.d 649B
main.d 523B
stm32f10x_tim1.d 417B
stm32f10x_gpio.d 417B
stm32f10x_flash.d 365B
stm32f10x_nvic.d 357B
stm32f10x_rcc.d 349B
TIM1_Target 1.dep 5KB
stm32f10x_tim1.h 34KB
stm32f10x_tim.h 28KB
stm32f10x_map.h 20KB
stm32f10x_adc.h 16KB
stm32f10x_nvic.h 16KB
stm32f10x_i2c.h 15KB
stm32f10x_rcc.h 14KB
stm32f10x_gpio.h 12KB
stm32f10x_dma.h 12KB
stm32f10x_can.h 12KB
stm32f10x_usart.h 12KB
stm32f10x_flash.h 10KB
stm32f10x_spi.h 9KB
stm32f10x_exti.h 6KB
stm32f10x_conf.h 6KB
stm32f10x_conf.h 5KB
stm32f10x_pwr.h 4KB
stm32f10x_rtc.h 4KB
stm32f10x_iwdg.h 3KB
stm32f10x_bkp.h 3KB
stm32f10x_it.h 3KB
stm32f10x_it.h 3KB
stm32f10x_systick.h 3KB
stm32f10x_type.h 3KB
stm32f10x_lib.h 3KB
stm32f10x_wwdg.h 3KB
cortexm3_macro.h 2KB
TIM1.htm 67KB
TIM1.lnp 496B
TIM1.map 57KB
stm32f10x_tim1.o 78KB
stm32f10x_it.o 69KB
main.o 62KB
stm32f10x_lib.o 58KB
stm32f10x_gpio.o 41KB
stm32f10x_rcc.o 40KB
stm32f10x_nvic.o 38KB
stm32f10x_flash.o 23KB
stm32f10x_vector.o 5KB
cortexm3_macro.o 2KB
TIM1.Opt 3KB
TIM1.plg 285B
TIM1.plg 182B
cortexm3_macro.s 9KB
stm32f10x_vector.s 8KB
cortexm3_macro.s 7KB
cortexm3_macro.s 7KB
stm32f10x_startup.s 7KB
scat_flash.scat 2KB
scat_ram.scat 2KB
TIM1.sct 479B
TIM1.tra 2KB
readme.txt 3KB
TIM1.Uv2 3KB
共 102 条
- 1
- 2
资源评论
lnasdxx
- 粉丝: 0
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功