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.

c6748 uart0 seems to be not receiving data while it is transfering

Hi

I have a mysterious problem regarding the use of UART on C6748. I have been using in my projects quite straightforwardly with no problem.

Now, I have a problematic case.

A large amount of data is fed to THR one by polling TEMT bit in LSR. During this operation, at some point, the receiving end sends 2 bytes to abort the data transfer. I enabled the receive interrupt for this. But, while the CPU is in Uart transmit loop performing transmit by feeding bytes to THR, no data seems to be received by the Uart. Because of this, I cannot detect the abort request.

I know that THR, RBR and DLL share one address. The access to these are contolled by DLAB bit in LCR register. During this, DLAB is set to 0 which means and write to the shared address modifies THR without affecting RBR. When DLAB is 0, any reads fetches data from RBR. So, there is no any possibility of using this shared address wrongly, as far as I see.

Other than this case, I can receive and transmit data with no problem. 

Any possible suggestions are welcomed.

Best regards

izzet

 

  • Hi

    I resolved this issue. Just in case anyone encounters a similar issue, I will drop a note of it. 

    The problem comes from the fact in the UART of C6748, receive and transmit registers are located at the same address.

    Any write modifies THR (transmitter hold register) and any read reads RBR (receive buffer register). But, both happens via the same register.

    The problem was coming from the fact that I was using CSL macros to do writes  as follows.

    CSL_FINS(CSL_UART_0_REGS->THR,   UART_THR_DATA, Value);

    This operation  first reads THR which is actually RBR then inserts Value into it with a mask value corresponding for the first byte. 

    So any write performs read as well. This was preventing  UART receive interrupt being registered since RBR  never got empty.

    Changing that write as CSL_UART_0_REGS->THR = Value; solves the issue.

    Regards

    Izzet

  • Thanks izzet ozcelik for the note, surely it would help other community members.