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.

CC2530的串口初始化程序

Other Parts Discussed in Thread: CC2530

求问zigbee cc2530,位置2的初始化方法(P1.6和1.7当串口输入输出的使用方法)

void initUARTSEND(void)
{

    CLKCONCMD &= ~0x40;                          //设置系统时钟源为32MHZ晶振
    while(CLKCONSTA & 0x40);                     //等待晶振稳定
    CLKCONCMD &= ~0x47;                          //设置系统主时钟频率为32MHZ
  
 
   // PERCFG = 0x00;    //位置1 P0口
    PERCFG |= 0x01;//位置2 P1口
    P1SEL = 0xC0;    //P1.6、P1.7用作串口
 

    U1CSR |= 0x80;    //UART方式
    U1GCR |= 11;          
    U1BAUD |= 216;    //波特率设为19200
    UTX1IF = 0;                                 //UART1 TX中断标志初始置位0

 

没有数据接受到数据