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.

CCS/TM4C1294NCPDT: UART writeCallback after transmission complete

Part Number: TM4C1294NCPDT

Tool/software: Code Composer Studio

Hi 

Is it possible to convert TI Rtos WriteCallBack to trigger after transmission is completed ?

The current default is called when it start transmission . 

UART_Params_init(&uartParams);

uartParams.writeMode = UART_MODE_CALLBACK;

uartParams.writeCallback = SerialWriteCallback;

  • Hi Ronnie,

    Which UART driver are you using (UARTTivaDMA or UARTTiva)? The callback is called when the driver has finished transmission from a software perspective.

    Todd

  • Hi Todd

    Thank you for replying. 

    The driver looks to be setup with UARTTivaDMA is it was declared with the type :  static const UARTTivaDMA_HWAttr

    I did an experimentation where I write a GPO to high before calling UART_write(). I will write it back to low in the writecallback function.

    As shown in my attached waveform, the Writecallback enters about the moment the transmission starts. 

    We will want the writecallback to enter after transmission instead. Don't know it is possible ? 

    regards, Ronnie

  • Perhaps your TX function can manipulate the TX BUSY flag and callback after last bit leaving transmitter? Otherwise add this busy to your caller so he knows the TX channel is SW clear to send (CTS). 

    if(!(HWREG(UART0_BASE + UART_O_FR) & UART_FR_BUSY))
    {
       TxComplete();
    }

  • I will prefer to leave the Tivaware library as it is.

    Pardon me if I seems quite amateurish as I am still quite new TI embedded .

  • Hello Ronnie,

    Agree with RTOS call backs who know what could happen if modified. I use the TX busy flag over many functions, it is fool proof! 

    Thanks for the reply and resolve :-)