文件名称:example1_TIM
介绍说明--下载内容来自于网络,使用问题请自行百度
本例展示了如何利用外设TIM2来产生四路频率不同的信号。
TIM2时钟设置为36MHz,预分频设置为2,使用输出比较-翻转模式(Output Compare Toggle Mode)。
TIM2计数器时钟可表达为:TIM2 counter clock = TIMxCLK / (Prescaler +1) = 12 MHz
设置TIM2_CCR1寄存器值为32768,则CC1更新频率为TIM2计数器时钟频率除以CCR1寄存器值,为366.2 Hz。因此,TIM2通道1可产生一个频率为183.1 Hz的周期信号。
同理,根据寄存器TIM2_CCR2 、TIM2_CCR3和 TIM2_CCR4的值,TIM2通道2可产生一个频率为366.3 Hz的周期信号;TIM2通道3可产生一个频率为732.4 Hz的周期信号;TIM2通道4可产生一个频率为1464.8 Hz的周期信号。
可以通过示波器观察各路输出。-This example shows how to use peripherals the TIM2 to produce four different frequencies of the signal. The TIM2 clock is set to 36 MHz, the prescaler is set to 2, use the output- flip mode (Output Compare Toggle Mode). TIM2 counter clock can be expressed as: TIM2 is counter clock = TIMxCLK/(prescaler. Ppls1) to 12 MHz 32768 set TIM2_CCR1 register, the CC1 update frequency of the TIM2 the counter clock frequency divided by the CCR1 register value, 366.2 Hz,. Therefore, TIM2 channel 1 can produce a periodic signal with a frequency of 183.1 Hz. The same token, value register TIM2_CCR2, TIM2_CCR3 and TIM2_CCR4, TIM2 is channel 2 can produce a frequency of 366.3 Hz periodic signal TIM2 is channel 3 can produce a frequency of 732.4 Hz periodic signal TIM2 is channel 4 can produce a frequency of 1464.8 Hz periodic signal. Each output can be observed through the oscilloscope.
TIM2时钟设置为36MHz,预分频设置为2,使用输出比较-翻转模式(Output Compare Toggle Mode)。
TIM2计数器时钟可表达为:TIM2 counter clock = TIMxCLK / (Prescaler +1) = 12 MHz
设置TIM2_CCR1寄存器值为32768,则CC1更新频率为TIM2计数器时钟频率除以CCR1寄存器值,为366.2 Hz。因此,TIM2通道1可产生一个频率为183.1 Hz的周期信号。
同理,根据寄存器TIM2_CCR2 、TIM2_CCR3和 TIM2_CCR4的值,TIM2通道2可产生一个频率为366.3 Hz的周期信号;TIM2通道3可产生一个频率为732.4 Hz的周期信号;TIM2通道4可产生一个频率为1464.8 Hz的周期信号。
可以通过示波器观察各路输出。-This example shows how to use peripherals the TIM2 to produce four different frequencies of the signal. The TIM2 clock is set to 36 MHz, the prescaler is set to 2, use the output- flip mode (Output Compare Toggle Mode). TIM2 counter clock can be expressed as: TIM2 is counter clock = TIMxCLK/(prescaler. Ppls1) to 12 MHz 32768 set TIM2_CCR1 register, the CC1 update frequency of the TIM2 the counter clock frequency divided by the CCR1 register value, 366.2 Hz,. Therefore, TIM2 channel 1 can produce a periodic signal with a frequency of 183.1 Hz. The same token, value register TIM2_CCR2, TIM2_CCR3 and TIM2_CCR4, TIM2 is channel 2 can produce a frequency of 366.3 Hz periodic signal TIM2 is channel 3 can produce a frequency of 732.4 Hz periodic signal TIM2 is channel 4 can produce a frequency of 1464.8 Hz periodic signal. Each output can be observed through the oscilloscope.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
example1_TIM/App/bsp.c
example1_TIM/App/bsp.h
example1_TIM/App/main.c
example1_TIM/App/stm32f10x_conf.h
example1_TIM/App/stm32f10x_it.c
example1_TIM/App/stm32f10x_it.h
example1_TIM/FWLib/inc/cortexm3_macro.h
example1_TIM/FWLib/inc/stm32f10x_adc.h
example1_TIM/FWLib/inc/stm32f10x_bkp.h
example1_TIM/FWLib/inc/stm32f10x_can.h
example1_TIM/FWLib/inc/stm32f10x_crc.h
example1_TIM/FWLib/inc/stm32f10x_dac.h
example1_TIM/FWLib/inc/stm32f10x_dbgmcu.h
example1_TIM/FWLib/inc/stm32f10x_dma.h
example1_TIM/FWLib/inc/stm32f10x_exti.h
example1_TIM/FWLib/inc/stm32f10x_flash.h
example1_TIM/FWLib/inc/stm32f10x_fsmc.h
example1_TIM/FWLib/inc/stm32f10x_gpio.h
example1_TIM/FWLib/inc/stm32f10x_i2c.h
example1_TIM/FWLib/inc/stm32f10x_iwdg.h
example1_TIM/FWLib/inc/stm32f10x_lib.h
example1_TIM/FWLib/inc/stm32f10x_map.h
example1_TIM/FWLib/inc/stm32f10x_nvic.h
example1_TIM/FWLib/inc/stm32f10x_pwr.h
example1_TIM/FWLib/inc/stm32f10x_rcc.h
example1_TIM/FWLib/inc/stm32f10x_rtc.h
example1_TIM/FWLib/inc/stm32f10x_sdio.h
example1_TIM/FWLib/inc/stm32f10x_spi.h
example1_TIM/FWLib/inc/stm32f10x_systick.h
example1_TIM/FWLib/inc/stm32f10x_tim.h
example1_TIM/FWLib/inc/stm32f10x_tim1.h
example1_TIM/FWLib/inc/stm32f10x_type.h
example1_TIM/FWLib/inc/stm32f10x_usart.h
example1_TIM/FWLib/inc/stm32f10x_wwdg.h
example1_TIM/FWLib/src/stm32f10x_adc.c
example1_TIM/FWLib/src/stm32f10x_bkp.c
example1_TIM/FWLib/src/stm32f10x_can.c
example1_TIM/FWLib/src/stm32f10x_crc.c
example1_TIM/FWLib/src/stm32f10x_dac.c
example1_TIM/FWLib/src/stm32f10x_dbgmcu.c
example1_TIM/FWLib/src/stm32f10x_dma.c
example1_TIM/FWLib/src/stm32f10x_exti.c
example1_TIM/FWLib/src/stm32f10x_flash.c
example1_TIM/FWLib/src/stm32f10x_fsmc.c
example1_TIM/FWLib/src/stm32f10x_gpio.c
example1_TIM/FWLib/src/stm32f10x_i2c.c
example1_TIM/FWLib/src/stm32f10x_iwdg.c
example1_TIM/FWLib/src/stm32f10x_lib.c
example1_TIM/FWLib/src/stm32f10x_nvic.c
example1_TIM/FWLib/src/stm32f10x_pwr.c
example1_TIM/FWLib/src/stm32f10x_rcc.c
example1_TIM/FWLib/src/stm32f10x_rtc.c
example1_TIM/FWLib/src/stm32f10x_sdio.c
example1_TIM/FWLib/src/stm32f10x_spi.c
example1_TIM/FWLib/src/stm32f10x_systick.c
example1_TIM/FWLib/src/stm32f10x_tim.c
example1_TIM/FWLib/src/stm32f10x_tim1.c
example1_TIM/FWLib/src/stm32f10x_usart.c
example1_TIM/FWLib/src/stm32f10x_wwdg.c
example1_TIM/project/cortexm3_macro.s
example1_TIM/project/Debug/Exe/example1_TIM.out
example1_TIM/project/Debug/Obj/bsp.o
example1_TIM/project/Debug/Obj/bsp.pbi
example1_TIM/project/Debug/Obj/cortexm3_macro.o
example1_TIM/project/Debug/Obj/example1_TIM.pbd
example1_TIM/project/Debug/Obj/main.o
example1_TIM/project/Debug/Obj/main.pbi
example1_TIM/project/Debug/Obj/stm32f10x_flash.o
example1_TIM/project/Debug/Obj/stm32f10x_flash.pbi
example1_TIM/project/Debug/Obj/stm32f10x_gpio.o
example1_TIM/project/Debug/Obj/stm32f10x_gpio.pbi
example1_TIM/project/Debug/Obj/stm32f10x_it.o
example1_TIM/project/Debug/Obj/stm32f10x_it.pbi
example1_TIM/project/Debug/Obj/stm32f10x_lib.o
example1_TIM/project/Debug/Obj/stm32f10x_lib.pbi
example1_TIM/project/Debug/Obj/stm32f10x_nvic.o
example1_TIM/project/Debug/Obj/stm32f10x_nvic.pbi
example1_TIM/project/Debug/Obj/stm32f10x_rcc.o
example1_TIM/project/Debug/Obj/stm32f10x_rcc.pbi
example1_TIM/project/Debug/Obj/stm32f10x_tim.o
example1_TIM/project/Debug/Obj/stm32f10x_tim.pbi
example1_TIM/project/Debug/Obj/stm32f10x_vector.o
example1_TIM/project/Debug/Obj/stm32f10x_vector.pbi
example1_TIM/project/example1_TIM.dep
example1_TIM/project/example1_TIM.ewd
example1_TIM/project/example1_TIM.ewp
example1_TIM/project/example1_TIM.eww
example1_TIM/project/lnkarm_flash.xcl
example1_TIM/project/lnkarm_ram.xcl
example1_TIM/project/settings/example1_TIM.cspy.bat
example1_TIM/project/settings/example1_TIM.dbgdt
example1_TIM/project/settings/example1_TIM.dni
example1_TIM/project/settings/example1_TIM.wsdt
example1_TIM/project/settings/example1_TIM_Debug.jlink
example1_TIM/project/stm32f10x_flash.icf
example1_TIM/project/stm32f10x_ram.icf
example1_TIM/project/stm32f10x_vector.c
example1_TIM/project/Debug/Exe
example1_TIM/project/Debug/List
example1_TIM/project/Debug/Obj
example1_TIM/FWLib/inc
example1_TIM/FWLib/src
example1_TIM/project/Debug
example1_TIM/project/settings
example1_TIM/App
example1_TIM/FWLib
example1_TIM/project
example1_TIM
example1_TIM/App/bsp.h
example1_TIM/App/main.c
example1_TIM/App/stm32f10x_conf.h
example1_TIM/App/stm32f10x_it.c
example1_TIM/App/stm32f10x_it.h
example1_TIM/FWLib/inc/cortexm3_macro.h
example1_TIM/FWLib/inc/stm32f10x_adc.h
example1_TIM/FWLib/inc/stm32f10x_bkp.h
example1_TIM/FWLib/inc/stm32f10x_can.h
example1_TIM/FWLib/inc/stm32f10x_crc.h
example1_TIM/FWLib/inc/stm32f10x_dac.h
example1_TIM/FWLib/inc/stm32f10x_dbgmcu.h
example1_TIM/FWLib/inc/stm32f10x_dma.h
example1_TIM/FWLib/inc/stm32f10x_exti.h
example1_TIM/FWLib/inc/stm32f10x_flash.h
example1_TIM/FWLib/inc/stm32f10x_fsmc.h
example1_TIM/FWLib/inc/stm32f10x_gpio.h
example1_TIM/FWLib/inc/stm32f10x_i2c.h
example1_TIM/FWLib/inc/stm32f10x_iwdg.h
example1_TIM/FWLib/inc/stm32f10x_lib.h
example1_TIM/FWLib/inc/stm32f10x_map.h
example1_TIM/FWLib/inc/stm32f10x_nvic.h
example1_TIM/FWLib/inc/stm32f10x_pwr.h
example1_TIM/FWLib/inc/stm32f10x_rcc.h
example1_TIM/FWLib/inc/stm32f10x_rtc.h
example1_TIM/FWLib/inc/stm32f10x_sdio.h
example1_TIM/FWLib/inc/stm32f10x_spi.h
example1_TIM/FWLib/inc/stm32f10x_systick.h
example1_TIM/FWLib/inc/stm32f10x_tim.h
example1_TIM/FWLib/inc/stm32f10x_tim1.h
example1_TIM/FWLib/inc/stm32f10x_type.h
example1_TIM/FWLib/inc/stm32f10x_usart.h
example1_TIM/FWLib/inc/stm32f10x_wwdg.h
example1_TIM/FWLib/src/stm32f10x_adc.c
example1_TIM/FWLib/src/stm32f10x_bkp.c
example1_TIM/FWLib/src/stm32f10x_can.c
example1_TIM/FWLib/src/stm32f10x_crc.c
example1_TIM/FWLib/src/stm32f10x_dac.c
example1_TIM/FWLib/src/stm32f10x_dbgmcu.c
example1_TIM/FWLib/src/stm32f10x_dma.c
example1_TIM/FWLib/src/stm32f10x_exti.c
example1_TIM/FWLib/src/stm32f10x_flash.c
example1_TIM/FWLib/src/stm32f10x_fsmc.c
example1_TIM/FWLib/src/stm32f10x_gpio.c
example1_TIM/FWLib/src/stm32f10x_i2c.c
example1_TIM/FWLib/src/stm32f10x_iwdg.c
example1_TIM/FWLib/src/stm32f10x_lib.c
example1_TIM/FWLib/src/stm32f10x_nvic.c
example1_TIM/FWLib/src/stm32f10x_pwr.c
example1_TIM/FWLib/src/stm32f10x_rcc.c
example1_TIM/FWLib/src/stm32f10x_rtc.c
example1_TIM/FWLib/src/stm32f10x_sdio.c
example1_TIM/FWLib/src/stm32f10x_spi.c
example1_TIM/FWLib/src/stm32f10x_systick.c
example1_TIM/FWLib/src/stm32f10x_tim.c
example1_TIM/FWLib/src/stm32f10x_tim1.c
example1_TIM/FWLib/src/stm32f10x_usart.c
example1_TIM/FWLib/src/stm32f10x_wwdg.c
example1_TIM/project/cortexm3_macro.s
example1_TIM/project/Debug/Exe/example1_TIM.out
example1_TIM/project/Debug/Obj/bsp.o
example1_TIM/project/Debug/Obj/bsp.pbi
example1_TIM/project/Debug/Obj/cortexm3_macro.o
example1_TIM/project/Debug/Obj/example1_TIM.pbd
example1_TIM/project/Debug/Obj/main.o
example1_TIM/project/Debug/Obj/main.pbi
example1_TIM/project/Debug/Obj/stm32f10x_flash.o
example1_TIM/project/Debug/Obj/stm32f10x_flash.pbi
example1_TIM/project/Debug/Obj/stm32f10x_gpio.o
example1_TIM/project/Debug/Obj/stm32f10x_gpio.pbi
example1_TIM/project/Debug/Obj/stm32f10x_it.o
example1_TIM/project/Debug/Obj/stm32f10x_it.pbi
example1_TIM/project/Debug/Obj/stm32f10x_lib.o
example1_TIM/project/Debug/Obj/stm32f10x_lib.pbi
example1_TIM/project/Debug/Obj/stm32f10x_nvic.o
example1_TIM/project/Debug/Obj/stm32f10x_nvic.pbi
example1_TIM/project/Debug/Obj/stm32f10x_rcc.o
example1_TIM/project/Debug/Obj/stm32f10x_rcc.pbi
example1_TIM/project/Debug/Obj/stm32f10x_tim.o
example1_TIM/project/Debug/Obj/stm32f10x_tim.pbi
example1_TIM/project/Debug/Obj/stm32f10x_vector.o
example1_TIM/project/Debug/Obj/stm32f10x_vector.pbi
example1_TIM/project/example1_TIM.dep
example1_TIM/project/example1_TIM.ewd
example1_TIM/project/example1_TIM.ewp
example1_TIM/project/example1_TIM.eww
example1_TIM/project/lnkarm_flash.xcl
example1_TIM/project/lnkarm_ram.xcl
example1_TIM/project/settings/example1_TIM.cspy.bat
example1_TIM/project/settings/example1_TIM.dbgdt
example1_TIM/project/settings/example1_TIM.dni
example1_TIM/project/settings/example1_TIM.wsdt
example1_TIM/project/settings/example1_TIM_Debug.jlink
example1_TIM/project/stm32f10x_flash.icf
example1_TIM/project/stm32f10x_ram.icf
example1_TIM/project/stm32f10x_vector.c
example1_TIM/project/Debug/Exe
example1_TIM/project/Debug/List
example1_TIM/project/Debug/Obj
example1_TIM/FWLib/inc
example1_TIM/FWLib/src
example1_TIM/project/Debug
example1_TIM/project/settings
example1_TIM/App
example1_TIM/FWLib
example1_TIM/project
example1_TIM
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.