標(biāo)題: 定時(shí)器1 CTC模式 [打印本頁]

作者: liuqq    時(shí)間: 2015-5-21 23:50
標(biāo)題: 定時(shí)器1 CTC模式

#include <iom128v.h>
#include <macros.h>
#define  uchar unsigned char
#define  uint  unsigned int


void main()
{
   DDRD|=0X30;//將PD4、PD5設(shè)置為輸出
   
   TCCR1A=0X50;//OC1A,OC1B輸出相同波形
   TCCR1B=0X09;//無預(yù)分頻
   OCR1A=1999;//2Khz
}







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1