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.

UART Example located in CCS3.3

Other Parts Discussed in Thread: CCSTUDIO

I ran the example in 

C:\CCStudio_v3.3\boards\evmdm6437_v2\tests\uart

but  

 while( EVMDM6437_UART_xmtReady( uart0 ) )   // Wait for TX ready

 {

            if ( timeout-- < 0 )

                return -1;

 

}

 this line seems always not ready so it return -1. Why is that?

  • Int16 EVMDM6437_UART_xmtReady( UART_Handle uart_handle )

    {

        Uint8 iir_status = ( uart_handle->regs->IIR >> 1 ) & 0x0E;

     

        if ( iir_status == 0 )                  // Check for No Interrupts

            return 0;

        else if ( iir_status == 1 )             // Check for Current TX emptying

            return 1;

        else                                    // Everything else

            return 2;

    }

     

    iir_status != 0 always?

  • This is a loopback test. Either you can use an external serial loopback connector. Alternatively - you can put the UART in internal loopback mode and then check again.

    http://focus.ti.com/lit/ug/spru997c/spru997c.pdf

    Hope this helps.

  • In uart open function,

    UART_Handle EVMDM6437_UART_open( Uint16 id, Uint32 baudrate )

     

    uart_handle->regs->MCR = 0x0000;        // RTS & CTS disabled,

                                                // Loopback mode disabled,

                                                // Autoflow disabled

     

     

    loopback is disabled so I  connected the DSP to my PC with RS232.

    If not wait for EVMDM6437_UART_xmtReady, PC can receive data correctly,

    but with the function it will have the problem just I mention before.

     

     

  • I know how to work now!

    When PC put a char to DSP, DSP nust to receive it, otherwise DSP cannot send anything to PC.

    EVMDM6437_UART_xmtReady always not ready.

    That why my DSP cannot send anything.