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.

question about 6678 uart

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

  • Li,

    Did you annotate out the delay in the UartWriteData function? Because that delay is not annotated in my pdk_C6678_1_0_0_17 evmc66x_uart.c file and I can write to the uart without adding any delay besides the platform_delaycycles(10000) that is in the UartWriteData function.

    Thanks,

    Jason Reeder

  • Jason,

    Yes,that is my fault.The ture reason affect that is i see the code selected odd bit,so i set my pc uart receiver odd option,but it is disable, right?

    if i selecte the parity is NONE in My PC receiver ,that is OK.

    Please tell why the data is right(i can get 100 data) when i add the delay,though i selected odd  parity is NONE in My PC receiver.

    And recently i try to change the demo use EDMA transfer.

    Thanks,

    LI