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.

[参考译文] MSP430F1611:Timer_B计数器问题。

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/653152/msp430f1611-timer_b-counter-issue

部件号:MSP430F1611

尊敬的各位:

我目前正在尝试建立一个计数器,每7.25毫秒递增一次。

我的设备是TelosB,它是具有3.2768万Hz晶体奥斯卡的MSP430F1611。

我使用ACLK设置Timer_B,ACLK是晶体,AS TIME =计数/频率数。

要每7.25毫秒递增一次,需要328个计数。  请参阅随附的代码。

我遇到了一个问题,因为两个捕获/比较遥控器被占用,用于无线电捕获和间隔。

我在这里宣布

void sctimer_asncounter(void){
TBCCTL3 = CCIE;
TBCCR3 = 328;
TBCCTL3 |= CCIFG;
}


触发相应的中断处理程序。

案例0x0006:// CCR3触发
如果(TBCCTL3和CCI){
if(sctimer_vars.asnreadcb !=NULL){
sctimer_vars.asnreadcb();
//启动操作系统
返回kick调度程序;
}
}


位置  

void CB_asnread (void){
app_vars.num_asn++;
UART_writeByte (app_vars.num_ASN);

sctimer_asncounter();
sctimer_setCompare(sctimer_readCounter()+SCTIMER_period);

}


因此,它应该每7.25毫秒不断增加app_vars.numb_asn++,但对于某些人,我甚至无法编译代码。

任何帮助都将得到极大的支持。

谢谢你。

e2e.ti.com/.../sctimer.he2e.ti.com/.../01bsp_5F00_sctimer.c

e2e.ti.com/.../sctimer.c