STM32入门篇之通用定时器彻底研究(新手教程,含11个例程,全面剖析TIMER,另外有个2.0库的
STM32的定时器着实强大,当然也很复杂,所以本人写了点总结,帮助新手快点入门。因为本人也是新手,接触STM32才几天而已,有错误请谅解。教程主要是对手册加了些个人理解,主要还请参考手册。同时给出11个例程,基本上都跟手册对应的例程。开发环境是MDK3.2Library 2.0 STM103V100的开发板。两个附件一个是教程,一个是11个例程,每个例程在教程里都有说明。教程里最后关于2.0库的两个勘误,请版主确认一下。花了1天时间整理的,希望能给你带来点帮助。例程列表:
TIMER-1 : 定时器上溢。
TIMER-2 : 强置输出模式。
TIMER-3 : 输出比较模式。
TIMER-4 : PWM1模式。
TIMER-5 : 输入捕获模式(结果硬件仿真观察)。
TIMER-6 : PWM输入模式。
TIMER-7 : 单脉冲模式。
TIMER-8 : TIMER2作为TIMER3的分频器,即TIMER3的时钟由TIMER2提供。
TIMER-9 : TIMER2使能TIMER3(时钟都用内部时钟,两个非同步)。
TIMER-10: TIMER2启动TIMER3(时钟都用内部时钟,两个非同步)。
TIMER-11: TIMER4的通道1同时出发TIMER4和TIMER3两个定时器。
点击此处下载 ourdev_544029.rar(文件大小:135K) (原文件名:STM32入门篇之通用定时器彻底研究.rar)
点击此处下载 ourdev_544030.rar(文件大小:8.15M) (原文件名:TIMER.rar) mark 辛苦,虽说暂时不用,但坚决顶! 顶 楼主辛苦了 楼主辛苦!!! thanks 务实~ 确实有心呀! 支持一个 mark 这个要顶! 顶起来 好资料 mark! mark! 呵呵,顶 mark MARK 楼主辛苦了,支持一下 顶 好资料 有心人 谢楼主 楼主辛苦!!! 不顶不合适 辛苦了,顶~~~ 正是当用时^_^ 为什么我不能下载呀? mark 不错,楼主辛苦了。。 mark 学习。。 mark bu cuo 用LZ例子得注意:
1、增加INC目录:Options->Options for Target xxxx->C/C++中,增加INC目录
2、assert_param(),有些地方用的是assert(),得改一下 谢谢LZ! 谢谢分享,赞~~ 刚注册顶一个 楼主好样的!!! 好野,记住先! 仔细的看了一下,但是个人认为这个定时器的从模式还是没有理解,自己需要好好努力 正在定时器这里迷茫,回去好好研究,谢谢楼主! 我是初学者,谢谢。 向楼主学习 学习。 感谢楼主啊,很好的资料啊 Cool! mark 顶 回复【楼主位】weiming 未名
-----------------------------------------------------------------------
楼主辛苦了 这个真是太好了啊!谢谢 mark 学习 LZ 好人,一定要顶~~ 谢谢分享! 楼主辛苦了!!! 好帖子,但是貌似楼主的例程编译有点问题,我是在MDK4.05版本下,没有通过,我用自己建的工程配上楼主的USER文件就可以了。
不知为什么。 mark 非常感谢楼主~~~~~ TKS 真是 不顶不合适哇哈哈顶顶顶顶 mark g 向楼主学习,彻底研究! 多谢~~~ 顶 MARK 记一下,有空来学习 谢谢LZ的资料。
TIMER-6和TIMER-7文件命名反了。
原TIMER-6中的50%分频数是1000.
请确认 谢谢楼主! 回复【楼主位】weiming 未名
-----------------------------------------------------------------------
Build target 'TIMER-2'
compiling main.c...
SourceGroup\main.c(112): error:#136: struct "<unnamed>" has no field "TIM_Channel"
SourceGroup\main.c(115): warning:#223-D: function "TIM_OCInit" declared implicitly
compiling stm32f10x_it.c...
compiling stm32f10x_adc.c...
..\library\src\stm32f10x_adc.c(167): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(255): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(281): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(315): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(423): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(481): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(508): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(568): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(666): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(719): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(747): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(792): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(818): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(846): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(935): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1003): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1035): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1058): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1093): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1120): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1162): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1185): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1218): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1252): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1276): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_adc.c(1315): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_bkp.c...
..\library\src\stm32f10x_bkp.c(101): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_bkp.c(117): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_bkp.c(133): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_bkp.c(149): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_bkp.c(167): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_bkp.c(193): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_bkp.c(209): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_can.c...
..\library\src\stm32f10x_can.c(117): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(234): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(247): error:#136: struct "<unnamed>" has no field "FA0R"
..\library\src\stm32f10x_can.c(253): error:#136: struct "<unnamed>" has no field "FS0R"
..\library\src\stm32f10x_can.c(257): error:#136: struct "<unnamed>" has no field "FR0"
..\library\src\stm32f10x_can.c(270): error:#136: struct "<unnamed>" has no field "FS0R"
..\library\src\stm32f10x_can.c(273): error:#136: struct "<unnamed>" has no field "FR0"
..\library\src\stm32f10x_can.c(288): error:#136: struct "<unnamed>" has no field "FM0R"
..\library\src\stm32f10x_can.c(293): error:#136: struct "<unnamed>" has no field "FM0R"
..\library\src\stm32f10x_can.c(300): error:#136: struct "<unnamed>" has no field "FFA0R"
..\library\src\stm32f10x_can.c(305): error:#136: struct "<unnamed>" has no field "FFA0R"
..\library\src\stm32f10x_can.c(311): error:#136: struct "<unnamed>" has no field "FA0R"
..\library\src\stm32f10x_can.c(352): error:#20: identifier "CAN_SJW_0tq" is undefined
..\library\src\stm32f10x_can.c(382): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(411): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(495): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(545): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(571): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(597): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(625): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(722): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(749): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(772): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_can.c(832): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_dma.c...
..\library\src\stm32f10x_dma.c(76): error:#20: identifier "DMA_Channel1_BASE" is undefined
..\library\src\stm32f10x_dma.c(78): error:#20: identifier "DMA" is undefined
..\library\src\stm32f10x_dma.c(81): error:#20: identifier "DMA_Channel2_BASE" is undefined
..\library\src\stm32f10x_dma.c(86): error:#20: identifier "DMA_Channel3_BASE" is undefined
..\library\src\stm32f10x_dma.c(91): error:#20: identifier "DMA_Channel4_BASE" is undefined
..\library\src\stm32f10x_dma.c(96): error:#20: identifier "DMA_Channel5_BASE" is undefined
..\library\src\stm32f10x_dma.c(101): error:#20: identifier "DMA_Channel6_BASE" is undefined
..\library\src\stm32f10x_dma.c(106): error:#20: identifier "DMA_Channel7_BASE" is undefined
..\library\src\stm32f10x_dma.c(133): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_dma.c(235): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_dma.c(266): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_dma.c(338): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_dma.c(341): error:#20: identifier "DMA" is undefined
..\library\src\stm32f10x_dma.c(394): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_dma.c(397): error:#20: identifier "DMA" is undefined
..\library\src\stm32f10x_dma.c(442): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_dma.c(445): error:#20: identifier "DMA" is undefined
..\library\src\stm32f10x_dma.c(498): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_dma.c(501): error:#20: identifier "DMA" is undefined
compiling stm32f10x_exti.c...
..\library\src\stm32f10x_exti.c(63): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_exti.c(124): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_exti.c(143): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_exti.c(168): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_exti.c(188): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_exti.c(215): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_flash.c...
..\library\src\stm32f10x_flash.c(91): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(111): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(131): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(180): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(317): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(376): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(416): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(463): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(537): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(618): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(736): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(769): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_flash.c(812): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_gpio.c...
..\library\src\stm32f10x_gpio.c(122): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(240): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(279): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(317): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(334): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(354): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(396): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(428): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(428): warning:#223-D: function "IS_GPIO_PORT_SOURCE" declared implicitly
..\library\src\stm32f10x_gpio.c(451): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(491): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(542): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_gpio.c(542): warning:#223-D: function "IS_GPIO_PORT_SOURCE" declared implicitly
compiling stm32f10x_i2c.c...
..\library\src\stm32f10x_i2c.c(156): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(292): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(318): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(344): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(370): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(396): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(422): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(470): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(496): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(528): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(586): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(623): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(641): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(669): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(695): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(725): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(752): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(795): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(821): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(849): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(915): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(978): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(1034): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(1105): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_i2c.c(1161): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_iwdg.c...
..\library\src\stm32f10x_iwdg.c(53): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_iwdg.c(76): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_iwdg.c(92): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_iwdg.c(138): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_lib.c...
compiling stm32f10x_nvic.c...
..\library\src\stm32f10x_nvic.c(45): error:#136: struct "<unnamed>" has no field "Disable"
..\library\src\stm32f10x_nvic.c(46): error:#136: struct "<unnamed>" has no field "Disable"
..\library\src\stm32f10x_nvic.c(47): error:#136: struct "<unnamed>" has no field "Clear"
..\library\src\stm32f10x_nvic.c(48): error:#136: struct "<unnamed>" has no field "Clear"
..\library\src\stm32f10x_nvic.c(52): error:#136: struct "<unnamed>" has no field "Priority"
..\library\src\stm32f10x_nvic.c(68): error:#136: struct "<unnamed>" has no field "IRQControlState"
..\library\src\stm32f10x_nvic.c(69): error:#136: struct "<unnamed>" has no field "ExceptionTableOffset"
..\library\src\stm32f10x_nvic.c(70): error:#136: struct "<unnamed>" has no field "AIRC"
..\library\src\stm32f10x_nvic.c(71): error:#136: struct "<unnamed>" has no field "SysCtrl"
..\library\src\stm32f10x_nvic.c(72): error:#136: struct "<unnamed>" has no field "ConfigCtrl"
..\library\src\stm32f10x_nvic.c(75): error:#136: struct "<unnamed>" has no field "SystemPriority"
..\library\src\stm32f10x_nvic.c(77): error:#136: struct "<unnamed>" has no field "SysHandlerCtrl"
..\library\src\stm32f10x_nvic.c(78): error:#136: struct "<unnamed>" has no field "ConfigFaultStatus"
..\library\src\stm32f10x_nvic.c(79): error:#136: struct "<unnamed>" has no field "HardFaultStatus"
..\library\src\stm32f10x_nvic.c(80): error:#136: struct "<unnamed>" has no field "DebugFaultStatus"
..\library\src\stm32f10x_nvic.c(105): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(108): error:#136: struct "<unnamed>" has no field "AIRC"
..\library\src\stm32f10x_nvic.c(127): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(135): error:#136: struct "<unnamed>" has no field "AIRC"
..\library\src\stm32f10x_nvic.c(145): error:#136: struct "<unnamed>" has no field "Priority"
..\library\src\stm32f10x_nvic.c(151): error:#136: struct "<unnamed>" has no field "Priority"
..\library\src\stm32f10x_nvic.c(154): error:#136: struct "<unnamed>" has no field "Enable"
..\library\src\stm32f10x_nvic.c(160): error:#136: struct "<unnamed>" has no field "Disable"
..\library\src\stm32f10x_nvic.c(241): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(267): error:#136: struct "<unnamed>" has no field "IRQControlState"
..\library\src\stm32f10x_nvic.c(284): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(288): error:#136: struct "<unnamed>" has no field "Set"
..\library\src\stm32f10x_nvic.c(309): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(324): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(326): error:#136: struct "<unnamed>" has no field "Clear"
..\library\src\stm32f10x_nvic.c(339): error:#136: struct "<unnamed>" has no field "IRQControlState"
..\library\src\stm32f10x_nvic.c(356): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(360): error:#136: struct "<unnamed>" has no field "Active"
..\library\src\stm32f10x_nvic.c(400): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(403): error:#136: struct "<unnamed>" has no field "ExceptionTableOffset"
..\library\src\stm32f10x_nvic.c(415): error:#136: struct "<unnamed>" has no field "AIRC"
..\library\src\stm32f10x_nvic.c(427): error:#136: struct "<unnamed>" has no field "AIRC"
..\library\src\stm32f10x_nvic.c(447): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_nvic.c(452): error:#136: struct "<unnamed>" has no field "SysCtrl"
compiling stm32f10x_pwr.c...
..\library\src\stm32f10x_pwr.c(89): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_pwr.c(105): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_pwr.c(132): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_pwr.c(157): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_pwr.c(183): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_pwr.c(252): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_pwr.c(280): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_rcc.c...
..\library\src\stm32f10x_rcc.c(177): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(249): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(276): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(303): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(330): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(351): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(404): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(437): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(470): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(503): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(534): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(557): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(583): error:#147-D: declaration is incompatible with "void RCC_LSEConfig(u8)" (declared at line 268 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_rcc.h")
..\library\src\stm32f10x_rcc.c(586): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(625): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(647): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(666): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(778): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(809): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(841): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(871): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(902): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(926): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(942): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(963): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(995): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(1064): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rcc.c(1097): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_rtc.c...
..\library\src\stm32f10x_rtc.c(54): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rtc.c(154): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rtc.c(257): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rtc.c(286): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rtc.c(308): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_rtc.c(337): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_spi.c...
..\library\src\stm32f10x_spi.c(97): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(183): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(217): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(218): warning:#223-D: function "IS_SPI_CONFIG_IT" declared implicitly
..\library\src\stm32f10x_spi.c(254): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(255): warning:#223-D: function "IS_SPI_DMA_REQ" declared implicitly
..\library\src\stm32f10x_spi.c(311): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(337): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(365): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(399): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(430): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(476): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(510): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(510): warning:#223-D: function "IS_SPI_GET_FLAG" declared implicitly
..\library\src\stm32f10x_spi.c(542): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(542): warning:#223-D: function "IS_SPI_CLEAR_FLAG" declared implicitly
..\library\src\stm32f10x_spi.c(553): error:#20: identifier "SPI_FLAG_OVR" is undefined
..\library\src\stm32f10x_spi.c(585): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(585): warning:#223-D: function "IS_SPI_GET_IT" declared implicitly
..\library\src\stm32f10x_spi.c(629): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_spi.c(629): warning:#223-D: function "IS_SPI_CLEAR_IT" declared implicitly
..\library\src\stm32f10x_spi.c(639): error:#20: identifier "SPI_IT_OVR" is undefined
compiling stm32f10x_systick.c...
..\library\src\stm32f10x_systick.c(54): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_systick.c(77): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_systick.c(96): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_systick.c(126): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_systick.c(168): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_tim1.c...
..\library\src\stm32f10x_tim1.c(22): error:#5: cannot open source input file "stm32f10x_tim1.h": No such file or directory
compiling stm32f10x_tim.c...
..\library\src\stm32f10x_tim.c(164): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(195): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(196): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(196): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(196): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(196): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(201): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(202): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(208): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(212): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(214): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(259): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(260): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(265): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(268): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(270): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(326): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(326): warning:#223-D: function "IS_TIM_IC_MODE" declared implicitly
..\library\src\stm32f10x_tim.c(326): error:#136: struct "<unnamed>" has no field "TIM_ICMode"
..\library\src\stm32f10x_tim.c(333): error:#136: struct "<unnamed>" has no field "TIM_ICMode"
..\library\src\stm32f10x_tim.c(333): error:#20: identifier "TIM_ICMode_ICAP" is undefined
..\library\src\stm32f10x_tim.c(412): error:#136: struct "<unnamed>" has no field "TIM_Channel"
..\library\src\stm32f10x_tim.c(428): error:#136: struct "<unnamed>" has no field "TIM_ICMode"
..\library\src\stm32f10x_tim.c(428): error:#20: identifier "TIM_ICMode_ICAP" is undefined
..\library\src\stm32f10x_tim.c(449): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(485): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(523): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(558): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(607): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(636): error:#147-D: declaration is incompatible with "void TIM_TIxExternalClockConfig(TIM_TypeDef *, u16, u16, u16)" (declared at line 696 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_tim.h")
..\library\src\stm32f10x_tim.c(640): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(640): warning:#223-D: function "IS_TIM_TIX_TRIGGER_SELECTION" declared implicitly
..\library\src\stm32f10x_tim.c(681): error:#147-D: declaration is incompatible with "void TIM_ETRClockMode1Config(TIM_TypeDef *, u16, u16, u16)" (declared at line 698 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_tim.h")
..\library\src\stm32f10x_tim.c(685): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(722): error:#147-D: declaration is incompatible with "void TIM_ETRClockMode2Config(TIM_TypeDef *, u16, u16, u16)" (declared at line 700 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_tim.h")
..\library\src\stm32f10x_tim.c(726): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(756): error:#147-D: declaration is incompatible with "void TIM_ETRConfig(TIM_TypeDef *, u16, u16, u16)" (declared at line 702 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_tim.h")
..\library\src\stm32f10x_tim.c(792): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(823): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(861): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(892): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(924): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(955): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(986): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1014): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1046): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1082): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1113): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1143): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1173): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1202): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1231): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1260): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1289): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1319): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1348): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1377): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1406): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1435): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1484): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1531): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1555): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1582): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1609): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1636): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1664): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1694): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1724): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1760): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1791): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1822): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1944): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(1976): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(2008): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(2040): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(2072): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(2190): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(2226): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_tim.c(2226): error:#54-D: too few arguments in macro invocation
..\library\src\stm32f10x_tim.c(2226): error:#29: expected an expression
..\library\src\stm32f10x_tim.c(2226): error:#29: expected an expression
..\library\src\stm32f10x_tim.c(2226): error:#29: expected an expression
..\library\src\stm32f10x_tim.c(2226): error:#29: expected an expression
..\library\src\stm32f10x_tim.c(2226): error:#29: expected an expression
compiling stm32f10x_usart.c...
..\library\src\stm32f10x_usart.c(135): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(141): error:#136: struct "<unnamed>" has no field "USART_Clock"
..\library\src\stm32f10x_usart.c(141): error:#136: struct "<unnamed>" has no field "USART_Clock"
..\library\src\stm32f10x_usart.c(142): error:#136: struct "<unnamed>" has no field "USART_CPOL"
..\library\src\stm32f10x_usart.c(142): error:#136: struct "<unnamed>" has no field "USART_CPOL"
..\library\src\stm32f10x_usart.c(143): error:#136: struct "<unnamed>" has no field "USART_CPHA"
..\library\src\stm32f10x_usart.c(143): error:#136: struct "<unnamed>" has no field "USART_CPHA"
..\library\src\stm32f10x_usart.c(144): error:#136: struct "<unnamed>" has no field "USART_LastBit"
..\library\src\stm32f10x_usart.c(144): error:#136: struct "<unnamed>" has no field "USART_LastBit"
..\library\src\stm32f10x_usart.c(156): error:#136: struct "<unnamed>" has no field "USART_Clock"
..\library\src\stm32f10x_usart.c(157): error:#136: struct "<unnamed>" has no field "USART_CPOL"
..\library\src\stm32f10x_usart.c(157): error:#136: struct "<unnamed>" has no field "USART_CPHA"
..\library\src\stm32f10x_usart.c(158): error:#136: struct "<unnamed>" has no field "USART_LastBit"
..\library\src\stm32f10x_usart.c(235): error:#136: struct "<unnamed>" has no field "USART_Clock"
..\library\src\stm32f10x_usart.c(236): error:#136: struct "<unnamed>" has no field "USART_CPOL"
..\library\src\stm32f10x_usart.c(237): error:#136: struct "<unnamed>" has no field "USART_CPHA"
..\library\src\stm32f10x_usart.c(238): error:#136: struct "<unnamed>" has no field "USART_LastBit"
..\library\src\stm32f10x_usart.c(254): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(295): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(346): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(375): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(398): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(417): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(447): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(466): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(492): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(573): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(600): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(628): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(657): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(676): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(715): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(751): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(782): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_usart.c(846): warning:#223-D: function "assert" declared implicitly
compiling stm32f10x_wwdg.c...
..\library\src\stm32f10x_wwdg.c(86): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_wwdg.c(112): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_wwdg.c(147): warning:#223-D: function "assert" declared implicitly
..\library\src\stm32f10x_wwdg.c(166): warning:#223-D: function "assert" declared implicitly
Target not created 3.90的编译环境,不能通过!我的芯片是STM32F103ZE的,上面的例程可以用到吗! 好东西! 回复【71楼】huguang0218
-----------------------------------------------------------------------
应该可以吧,看手册对比下就知道了呀,错误原因是库不同导致的。我用的2.0的库。把Option for Targetxxx->c/c++ Include Path
添加2.0库的包含路径就可以了,关键是stm32f10x_conf.h这个文件。 定时器正搞不明白呢 学习中! 感谢分享。。。 mark 楼主辛苦了。顶。。下来学习学习。 尊重劳动,顶楼主 记号 thanks 顶呱呱 很好啊,学习! mark mark ./emotion/em014.gif mark mark mark 感谢分享!好人一生平安! up andmark 收藏了。谢谢楼主分享。 mark 记号 mark mark 好帖 mark 我全部收下,谢谢楼主 难得 mark mark