分频到1Mhz ,UART波特率9600无法使用收到的和发送的数据不一致,4800收到的数据正常
官方例程代码如下:
CKDIV=0x0C; //分频到1Mhz
MFP_P31_UART0_TXD;
P31_QUASI_MODE;
UART_Open(1000000,UART0_Timer1,9600); /* Open UART0 use timer1 as baudrate generate and baud rate = 115200 */
MFP_P55_UART2_RXD;
P55_INPUT_MODE;
UART_Open(1000000,UART2,9600); /* Open UART2 use timer1 as baudrate generate and baud rate = 115200*/
UART_Interrupt_Enable(UART2,Enable);
ENABLE_GLOBAL_INTERRUPT;
/* Connect P5.5 and P3.1 to check loop from UART0 to UART2*/
UART_Send_Data(UART0,TXtemp);
while(1)
{
if (uart2rvflag)
{
TXtemp++;
uart2rvflag=0;
Timer3_Delay(1000000,4,300,1000);
UART_Send_Data(UART0,TXtemp);
}
} |