我在用CC2540PWM控制灯时发现打开低功耗PWM输出很不稳定,关闭时正常,但如果不打开低功耗模式时广播时的电流太大,这个怎么解决?
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.
我在用CC2540PWM控制灯时发现打开低功耗PWM输出很不稳定,关闭时正常,但如果不打开低功耗模式时广播时的电流太大,这个怎么解决?
void PWM_init()
{
// PERCFG = PERCFG | 0x03; // Select Timer 1 Alternative 0 location, set U1CFG and U0CFG to Alternative 1
PERCFG = (PERCFG & ~0x40) | 0x03; // Select Timer 1 Alternative 0 location, set U1CFG and U0CFG to Alternative 1
// PERCFG = PERCFG | 0x40;
P2DIR |= 0xc0; // Give priority to Timer 1
P0SEL |= 0x18; // Set P0.4, P0.5 and P0.6 to peripheral
T1CNTH = 0xff;
T1CNTL = 0xff;
T1CTL = 0x02;
T1CCTL1 = 0x1c;
T1CCTL2 = 0x1c;
T1CC0L = 0x00;
T1CC0H = 0x01;
T1CC1L = 0x00;
T1CC1H = 0x00;
T1CC2L = 0x00;
T1CC2H = 0x00;
}