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.

TMS320F280049C: Repeated function calls in SCI driverlib examples

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Hello,

I'm looking through the provided F28004x driverlib examples for SCI (e.g. sci_ex1_echoback.c) in C2000Ware 3.01.00.00.

It seems there are several repeated function calls and I'm trying to understand if they are necessary.

The code segment in sci_ex1_echoback.c that initializes the SCI is as follows:

    //
    // Initialize SCIA and its FIFO.
    //
    SCI_performSoftwareReset(SCIA_BASE);

    //
    // Configure SCIA for echoback.
    //
    SCI_setConfig(SCIA_BASE, DEVICE_LSPCLK_FREQ, 9600, (SCI_CONFIG_WLEN_8 |
                                                        SCI_CONFIG_STOP_ONE |
                                                        SCI_CONFIG_PAR_NONE));
    SCI_resetChannels(SCIA_BASE);
    SCI_resetRxFIFO(SCIA_BASE);
    SCI_resetTxFIFO(SCIA_BASE);
    SCI_clearInterruptStatus(SCIA_BASE, SCI_INT_TXFF | SCI_INT_RXFF);
    SCI_enableFIFO(SCIA_BASE);
    SCI_enableModule(SCIA_BASE);
    SCI_performSoftwareReset(SCIA_BASE);

Couple questions:

  1. Is there a need for SCI_performSoftwareReset() to be called at both the start and the end of SCI initialization?

  2. SCI_enableModule() is already called as part of of SCI_setConfig(), does it need to be called again separately?

  3. This is not in the above code segment, but earlier in the same example during GPIO initialization for the SCI TX pin, the qualification mode is set to async. Is this necessary? My understanding was that qualification is only necessary for inputs.

Thank you!

  • Hi,

    Hong En Chew said:
    Is there a need for SCI_performSoftwareReset() to be called at both the start and the end of SCI initialization?

    I just checked that it works without the SCI_performSoftwareReset() at the end. 

    Hong En Chew said:
    SCI_enableModule() is already called as part of of SCI_setConfig(), does it need to be called again separately?

    No it is not needed. It works without that second SCI_enableModule() call.

    Hong En Chew said:
    This is not in the above code segment, but earlier in the same example during GPIO initialization for the SCI TX pin, the qualification mode is set to async. Is this necessary? My understanding was that qualification is only necessary for inputs.

    Your understanding is correct, it matters only for input pins.

    With the above changes, the examples work at my end. I believe it should work for you too.

    Regards,

    Sudharsanan

  • Ok that's good to know, thanks Sudharsanan!