实例介绍
在STM8S003单片机上,用定时器2产生一个PWM波,用定时器输入捕获功能,测量该PWM波的周期,并通过串口将捕获的周期发送出来。
【实例截图】
【核心代码】
STM8S_Input_Capture
└── STM8S_Input_Capture
├── App
│ ├── main.c
│ ├── main.c.orig
│ ├── stm8s_conf.h
│ ├── stm8s_it.c
│ ├── stm8s_it.c.orig
│ └── stm8s_it.h
├── Bsp
│ ├── adc.c
│ ├── adc.c.orig
│ ├── adc.h
│ ├── adc.h.orig
│ ├── bsp.c
│ ├── bsp.c.orig
│ ├── bsp.h
│ ├── capture.c
│ ├── capture.c.orig
│ ├── capture.h
│ ├── capture.h.orig
│ ├── delay.c
│ ├── delay.h
│ ├── key.c
│ ├── key.h
│ ├── led.c
│ ├── led.h
│ ├── pwm_capture.c
│ ├── pwm_capture.h
│ ├── tim1_pwm.c
│ ├── tim1_pwm.h
│ ├── tim2_pwm.c
│ ├── tim2_pwm.c.orig
│ ├── tim2_pwm.h
│ ├── tim2_pwm.h.orig
│ ├── timer1_it.c
│ ├── timer1_it.h
│ ├── timer2_it.c
│ ├── timer2_it.h
│ ├── timer4.c
│ ├── timer4.h
│ ├── timer4_it.c
│ ├── timer4_it.h
│ ├── uart1.c
│ ├── uart1.c.orig
│ └── uart1.h
├── BuildLog.log
├── capture.dep
├── capture.ewd
├── capture.ewp
├── capture.ewt
├── capture.eww
├── Debug
│ ├── Exe
│ │ ├── ADC.hex
│ │ ├── ADC.out
│ │ ├── capture.out
│ │ ├── KEY.hex
│ │ ├── KEY.out
│ │ ├── tim1_pwm.hex
│ │ ├── tim1_pwm.out
│ │ ├── TIM.hex
│ │ ├── TIM.out
│ │ ├── UART.hex
│ │ └── UART.out
│ ├── List
│ │ ├── ADC.map
│ │ ├── capture.map
│ │ ├── KEY.map
│ │ ├── tim1_pwm.map
│ │ ├── TIM.map
│ │ └── UART.map
│ └── Obj
│ ├── adc.o
│ ├── ADC.pbd
│ ├── ADC.pbd.browse
│ ├── ADC.pbd.linf
│ ├── adc.pbi.xcl
│ ├── bsp.o
│ ├── bsp.pbi
│ ├── bsp.pbi.xcl
│ ├── capture.o
│ ├── capture.pbd.browse
│ ├── capture.pbd.linf
│ ├── capture.pbd.tmp
│ ├── capture.pbi
│ ├── capture.pbi.xcl
│ ├── delay.o
│ ├── delay.pbi.xcl
│ ├── key.o
│ ├── KEY.pbd
│ ├── KEY.pbd.browse
│ ├── KEY.pbd.linf
│ ├── key.pbi.xcl
│ ├── led.o
│ ├── led.pbi.xcl
│ ├── main.o
│ ├── main.pbi
│ ├── main.pbi.xcl
│ ├── pwm_capture.o
│ ├── pwm_capture.pbi.xcl
│ ├── stm8s_adc1.o
│ ├── stm8s_adc1.pbi
│ ├── stm8s_adc1.pbi.xcl
│ ├── stm8s_clk.o
│ ├── stm8s_clk.pbi
│ ├── stm8s_clk.pbi.xcl
│ ├── stm8s_gpio.o
│ ├── stm8s_gpio.pbi
│ ├── stm8s_gpio.pbi.xcl
│ ├── stm8s_it.o
│ ├── stm8s_it.pbi
│ ├── stm8s_it.pbi.xcl
│ ├── stm8s_tim1.o
│ ├── stm8s_tim1.pbi
│ ├── stm8s_tim1.pbi.xcl
│ ├── stm8s_tim2.o
│ ├── stm8s_tim2.pbi
│ ├── stm8s_tim2.pbi.xcl
│ ├── stm8s_tim3.pbi.xcl
│ ├── stm8s_tim4.o
│ ├── stm8s_tim4.pbi
│ ├── stm8s_tim4.pbi.xcl
│ ├── stm8s_uart1.o
│ ├── stm8s_uart1.pbi
│ ├── stm8s_uart1.pbi.xcl
│ ├── tim1_pwm.o
│ ├── tim1_pwm.pbd
│ ├── tim1_pwm.pbd.browse
│ ├── tim1_pwm.pbd.linf
│ ├── tim1_pwm.pbi.xcl
│ ├── tim2_pwm.o
│ ├── tim2_pwm.pbi
│ ├── tim2_pwm.pbi.xcl
│ ├── timer1_it.o
│ ├── timer1_it.pbi.xcl
│ ├── timer1.pbi.xcl
│ ├── timer2_it.o
│ ├── timer2_it.pbi.xcl
│ ├── timer3_it.pbi.xcl
│ ├── timer4_it.o
│ ├── timer4_it.pbi.xcl
│ ├── timer4.o
│ ├── timer4.pbi.xcl
│ ├── TIM.pbd
│ ├── TIM.pbd.browse
│ ├── TIM.pbd.linf
│ ├── uart1.o
│ ├── uart1.pbi
│ ├── uart1.pbi.xcl
│ ├── UART.pbd
│ └── UART.pbd.linf
├── Doc
│ ├── ReadMe.txt
│ └── stm8s-a_stdperiph_drivers_um.chm
├── Libraries
│ └── STM8S_StdPeriph_Driver
│ ├── inc
│ │ ├── stm8s_adc1.h
│ │ ├── stm8s_adc2.h
│ │ ├── stm8s_awu.h
│ │ ├── stm8s_beep.h
│ │ ├── stm8s_can.h
│ │ ├── stm8s_clk.h
│ │ ├── stm8s_exti.h
│ │ ├── stm8s_flash.h
│ │ ├── stm8s_gpio.h
│ │ ├── stm8s.h
│ │ ├── stm8s_i2c.h
│ │ ├── stm8s_itc.h
│ │ ├── stm8s_iwdg.h
│ │ ├── stm8s_rst.h
│ │ ├── stm8s_spi.h
│ │ ├── stm8s_tim1.h
│ │ ├── stm8s_tim2.h
│ │ ├── stm8s_tim3.h
│ │ ├── stm8s_tim4.h
│ │ ├── stm8s_tim5.h
│ │ ├── stm8s_tim6.h
│ │ ├── stm8s_uart1.h
│ │ ├── stm8s_uart2.h
│ │ ├── stm8s_uart3.h
│ │ ├── stm8s_uart4.h
│ │ └── stm8s_wwdg.h
│ └── src
│ ├── stm8s_adc1.c
│ ├── stm8s_adc2.c
│ ├── stm8s_awu.c
│ ├── stm8s_beep.c
│ ├── stm8s_can.c
│ ├── stm8s_clk.c
│ ├── stm8s_exti.c
│ ├── stm8s_flash.c
│ ├── stm8s_gpio.c
│ ├── stm8s_i2c.c
│ ├── stm8s_itc.c
│ ├── stm8s_iwdg.c
│ ├── stm8s_rst.c
│ ├── stm8s_spi.c
│ ├── stm8s_tim1.c
│ ├── stm8s_tim2.c
│ ├── stm8s_tim3.c
│ ├── stm8s_tim4.c
│ ├── stm8s_tim5.c
│ ├── stm8s_tim6.c
│ ├── stm8s_uart1.c
│ ├── stm8s_uart2.c
│ ├── stm8s_uart3.c
│ ├── stm8s_uart4.c
│ └── stm8s_wwdg.c
└── settings
├── ADC.dbgdt
├── ADC.Debug.cspy.bat
├── ADC.Debug.cspy.ps1
├── ADC.Debug.driver.xcl
├── ADC.Debug.general.xcl
├── ADC.dnx
├── ADC.wsdt
├── capture.dbgdt
├── capture.Debug.cspy.bat
├── capture.Debug.cspy.ps1
├── capture.Debug.driver.xcl
├── capture.Debug.general.xcl
├── capture.dnx
├── capture.reggroups
├── capture.wsdt
├── KEY.dbgdt
├── KEY.Debug.cspy.bat
├── KEY.Debug.cspy.ps1
├── KEY.Debug.driver.xcl
├── KEY.Debug.general.xcl
├── KEY.dnx
├── KEY.wsdt
├── tim1_pwm.dbgdt
├── tim1_pwm.Debug.cspy.bat
├── tim1_pwm.Debug.cspy.ps1
├── tim1_pwm.Debug.driver.xcl
├── tim1_pwm.Debug.general.xcl
├── tim1_pwm.dnx
├── tim1_pwm.wsdt
├── TIM.dbgdt
├── TIM.Debug.cspy.bat
├── TIM.Debug.cspy.ps1
├── TIM.Debug.driver.xcl
├── TIM.Debug.general.xcl
├── TIM.dnx
├── TIM.wsdt
├── UART.dbgdt
├── UART.Debug.cspy.bat
├── UART.Debug.cspy.ps1
├── UART.Debug.driver.xcl
├── UART.Debug.general.xcl
├── UART.dnx
└── UART.wsdt
13 directories, 240 files
标签:
相关软件
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论