Hi all,
I have some problems with the UART of 6678.I used pdk_C6678_1_0_0_17\packages\ti\platform\evmc6678l\platform_test for testing. PC received data is wrong, the testing code following:
uint8_t buf = 0x55;
for(i = 0; i< 100 ; i++)
{
platform_uart_write(buf);
}
PC received 83 right data.The Eighty-fourth was FD.From Eighty-fourth to 100th were NULL.
The PDK sample is like this:
uint8_t message[] = "\r\nThis is a Platform UART API unit test ...\r\n";
for (i = 0; i < length; i++) {
platform_uart_write(message[i]);
}
I also received wrong data.
I try to solve the problem.so i add delay like this:
uint8_t buf = 0x55;
for(i = 0; i< 100 ; i++)
{
platform_uart_write(buf);
for(j = 0; j < 100000; j++)
{}
}
Everything is OK.
I think the delay is not nessary.
I find the write code is like this:
/******************************************************************************
*
* Function: UartWriteData
*
* Description: This function writes a byte of data to UART device
*
* Parameters: uint8_t uchAddress - Address of 8-bit register
* uint8_t uchByte - 8-bit data to write to THR
*
* Return Value: none
******************************************************************************/
void UartWriteData(uint8_t uchByte)
{
while (!(CSL_FEXT(hUartRegs->LSR, UART_LSR_THRE))) {
//platform_delaycycles(10000);
}
CSL_FINS(hUartRegs->THR, UART_THR_DATA, uchByte);
return;
}
It means you also add delay,but it was annotated.
Thank you
Best regards,
Li