This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] 编译器:如何为IR设置计时器。

Guru**** 2526700 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/568233/compiler-how-to-set-timer-for-ir

工具/软件:TI C/C++编译器

这是我的设定,但不起作用。

void inittimerIR (void)

 // CLKCONCMD &=~0x38;
 // CLKCONCMD |= 0x18;
 
 //Inittimer1();
 //Inittimer3();
 T1CTL = 0x00;
 T1CCTL0 = 0x10 | 0x04;
 T1CCTL1 = 0x18 | 0x04;
 
 //T1CNTL = 0;
 // T1CC0 = 85;
 // T1CC1=21;
 T1CC0L = 2;
 T1CC0H = 0;
 T1CC1L = 1;
 T1CC1H = 0;
 
 T1CNTL = 0;
 T1CTL = 0x00 | 0x02;
 
 //等待单位被清除
 同时(T1CNTL ==0);
 
 //停止计时器1
 //T1CTL = 0x00;
 
 //timer3.
 //T3CTL = 0x04;
 T3CTL = 0x40 | 0x02;  // 4.
 T3CCTL0 = 0x10 | 0x04;
 T3CCTL1 = 0x18 | 0x04;
 
 // T3CC0 = 0xD2;   //211
 // T3CC1 = 0x46;   //105
 T3CC0 = 0xD2;   //  
 T3CC1 = 0x46;   //  
  
 //IRCTL |=1;
}

void SendIRsignal (void)(作废SendIRsign

 IRCTL |=1;
 writeI2C (IRdata,IRdataLen);
 IRCTL |=0;
}