用applilet3实现定时器——超简单:16楼
以前的问题:
被 applilet3 搞晕了,到底怎么用?请求大虾指点!手册上有关IAR调试的一段英文:[YRPBRL78G13 Kit User Manual(P50-51)]
As can be seen from the debugger window, the user can now set Software breakpoints in the code or assembler windows. This can be done simply by double clicking on the C-Source code line or the in the assembler window (Other methods of setting software breakpoints by “right clicking” the mouse button or using the pull down menus are available).
One hardware (Event) breakpoint is available so that a break can be made on a data event (for example a write of a specific value from the ADC (Potentiometer)). The event can be set up as shown below, by clicking on the “Edit Events…” feature on the “Emulator” pull down menu.
定时器 超简单

关键词: 定时器 简单



这个我刚刚做完,,呼吸灯是PWM方式做的,但D2不是默认的PWM输出端口。只能通过配置好的PWM中,产生中断来进行,但这不是PWM正常的操作方式,中断会占用程序运行资源的,所以我试了试,还是没用这方法。
我看电路上的D1做电源指示太浪费了,所以把灯的一个引脚不接地,接到了P31口上,,配置了通信2和3为PWM输出,,在软件中定时改变PWM输出的占空比就行了。注意在配置的时候,如果不是必须的话,不要产生中断。
做呼吸灯时,灯的亮度在30%时就很亮了,,所以我的呼吸灯只加到20%的占空比。
我做的就是这样的了。。不知道能不能帮到你。
回复
打赏帖 | |
---|---|
分享一种检测按键状态的方法被打赏20分 | |
周末总结一下,STM32C0系列的开发经验被打赏50分 | |
【Cortex-M】Systick Timer使用被打赏10分 | |
分享汽车防盗系统的组成与分类(一)被打赏5分 | |
VOFA+波形显示+JYD-31蓝牙发送和解析不定长数据被打赏10分 | |
【换取手持数字示波器】-STM32F4PWM控制LED灯管亮度被打赏22分 | |
【换取手持数字示波器】STM32F4驱动RPR-0521RS照度、接近一体型传感器被打赏23分 | |
宏定义和const关键字定义被打赏5分 | |
【分享开发笔记,赚取电动螺丝刀】几个单片机I2S外设的BLCK时钟对比被打赏20分 | |
【功率监测与控制系统DIY活动成果贴】DIY功率计与LabVIEW数据采集被打赏100分 |