本帖最后由 一只耳朵怪 于 2018-6-6 17:03 编辑
void
timer1_init(void)
[
// 1.
bitset(TIMIF,6);//溢出中断使能
// 2.timer1使能 Enable Timer 1 interrupts by setting [IEN1.T1IE=1]
T1IE = 1;
// 3.频率设置Set prescaler divider value to 128 to get a tickspeed of
// and set Timer 1 to free running mode 0000 1101 10us
T1CTL = (T1CTL & ~(T1CTL_MODE | T1CTL_DIV)) | T1CTL_MODE_MODULO
| T1CTL_DIV_128;
// 4.时间设置 Set compare register of channel 0 to 32767 ( 0xFFFF / 2 )
T1CC0L = 0xFF;
T1CC0H = 0xFF;
]
如果加中断,则rf根本接收不了数据。中断优先级也设置了。RF我设置了最高优先级3.