AVR单片机的CTC模式

2019-03-24 20:29发布

购买的单片机附赠资料上提到了CTC模式,但是没有具体的教程,可以分享一下经验吗? 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
5条回答
农逸
1楼-- · 2019-03-25 01:34
这个网上很多程序的啊,懂得使用定时器就会用CTC模式了,好好看看芯片资料就行了。
gh131413
2楼-- · 2019-03-25 03:43
没错
hnjylijunz
3楼-- · 2019-03-25 08:46
# include <iom16v.h>
# define uint unsigned int
# define uchar unsigned char

void time0_ctc_init(void)
{
         /*8分频  CTC模式   比较匹配时取反*/
         TCCR0|=(1<<CS01)|(1<<WGM01)|(1<<COM00);
         OCR0=250;
         
}
void main(void)
{

         time0_ctc_init();
         DDRB|=(1<<PB3);
         PORTB|=(1<<PB3);
         while(1)
         {
       
         }
}
/*
ATME16我写的定时器0 CTC模式,你参考一下啊
*/
lgy934883865
4楼-- · 2019-03-25 09:34
hnjylijunz 发表于 2014-4-21 00:04
# include
# define uint unsigned int
# define uchar unsigned char

多谢了
qq1760699161
5楼-- · 2019-03-25 09:48
 精彩回答 2  元偷偷看……

一周热门 更多>