用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%的占空比。
我做的就是这样的了。。不知道能不能帮到你。
回复
打赏帖 | |
---|---|
rtthread硬件加密--2crc加密分析被打赏10分 | |
【分享开发笔记,赚取电动螺丝刀】mcxa156使用低功耗定时器适配硬件RTC框架被打赏26分 | |
【STM32F769】AI之与本地deepseek对接被打赏50分 | |
Buck电路工作在CCM模式下电感电流的计算公式是什么?被打赏5分 | |
buck电路工作原理被打赏5分 | |
基于MSPM0L1306的MODBUS-RTU协议通讯实验被打赏100分 | |
我想要一部加热台+多合一调试工具被打赏18分 | |
每周了解几个硬件知识+485硬件知识分享被打赏10分 | |
【换取手持示波器】TouchGFX应用移植自定义屏幕被打赏34分 | |
【换取手持数字示波器】树莓派PICO调试器官方固件本地化部署实践被打赏24分 |