通过串口接收一包数据(5字节),结果总出差,如果一个一个接收就正常,代码:1.485初始化void init485(void){ UCTL0 = CHAR; // 8-bit character UTCTL0 = SSEL0; // UCLK = ACLK UBR00 = 0x03; // 32k/9600 UBR10 = 0; UMCTL0 = 0x4a; ME2 |= URXE0; IE2 |= URXIE0; }2.485中断接收一包数据#pragma vector = UART0RX_VECTOR__interrupt void r485(void){ for(cycle = 0;cycle < 5;cycle ++) {rxbuf[cycle] = RXBUF0; } cycle = 0; }
此帖出自
小平头技术问答
一周热门 更多>