|
楼主 |
发表于 2020-6-15 08:56:23
|
显示全部楼层
PWM也不得行
void main()
{
unsigned char i,temp[16];
system_set_CPU_frequency(CPU_FREQUENCY_8M);
soft_delay_ms(500);
asm("nop");
/**IO初始化**/
TRISC = 0x00;
TRISB = 0x00;
/**RF发送初始化**/
//RF_Init();
//RF_Set_TxMode();
/**RF接收初始化**/
//RF_Init();
//RF_Set_RxMode();
//WDT_enable(WDT_DIVIDE_RATIO_64);
//key_Init();
//i=0xff;
CCPX_Init(PWM_DIV_4,250); //初始化
CCP1_set_duty_cycle(200); //PWM1占空比 == 200/(250*4)
CCP2_set_duty_cycle(400); //PWM2占空比 == 400/(250*4)
while(1)
{
//PORTB=i;
//PORTC=i;
i=~i;
soft_delay_ms(500);
//RF_awaken();
/**RF发送测试**/
//RF_TxData(temp,PAYLOAD_WIDTH);
/**RF接收测试**/
/*
RF_Read_RxData(temp,PAYLOAD_WIDTH);
*/
//RF_Sleep();
//system_to_sleep();
}
} |
|