文件名称:PWM
-
所属分类:
- 标签属性:
- 上传时间:2012-12-31
-
文件大小:4.55kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
Atmega 16单片机,这里利用T/C1定时器中断来产生PWM波形。在ICC AVR编译环境下,利用tool 菜单中的application builder生成一个简单的PWM波程序。这段程序以PA0作为PWM波的输出端口。利用T/C1定时器比较匹配和溢出产生两次中断来改变PA0的输出电平。具体过程为:计数器TCNT1从初始值开始不断计数,当发生比较匹配时,把PA0置为低电平,计数器继续计数,当发生溢出中断时,计数器回到初始设定值,并把PA0置为高电平。从而在PA0端口获得一稳定持续的PWM波形,在主程序中改变比较值,即可改变波形占空比,而频率不变。-Atmega 16 microcontroller, T/C1 timer interrupt to generate a PWM waveform. ICC AVR compiler environment, the application builder tool menu to generate a simple PWM wave program. This program PA0 as PWM wave output ports. The use of T/C1 timer compare match and overflow twice interrupted PA0 to change the output level. Process: the counter TCNT1 from the initial value began to count, compare match occurs, the PA0 set low, the counter continues to count when an overflow interrupt occurs, the counter back to the initial setting, and PA0 is set to the high level. PA0 port access to a stable and sustainable PWM waveform, change the comparison value in the main program, you can change the waveform duty cycle, and the frequency is the same.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
PWM
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.