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.

CC2540 协议栈T3定时器输出PWM不稳定 是何原因?



在程序初始化的时候

T3CTL = 0xB2;
T3CC0 =5;
T3CCTL0 =0X64;// 0x64;
T3IE = 1;
EA=1;

中断服务函数

#pragma vector = T3_VECTOR
__interrupt void Timer3_ISR(void){

P1_4=~P1_4;
num++;
if(num==1)
{
T3CC0 =60;
}
else if(num==2)
{
T3CC0 =5;
num = 0;
}
}

跑协议栈时,根据算出来的正频宽和负频宽在示波器里显示的差不多,但是极不稳定,跳的厉害。 正频宽5-6us波动  负频宽60-65us波动

裸跑时,一样的配置数据 正频宽和负频宽在示波器里显示都翻了一倍 无波动 正频宽12.50us  负频宽126.7us