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.

TMS320F28069M: 28069M HAL SCI FIFO Implementation Failure

Part Number: TMS320F28069M

I tried enabling SCI FIFO using HAL on a 28069M launchpad, but I can't get it to work.

This is the code sitting in hal.c as of now.

void HAL_setupSciB(HAL_Handle handle) {
HAL_Obj *obj = (HAL_Obj *)handle;
SCI_reset(obj->sciBHandle);
SCI_enableTx(obj->sciBHandle);
SCI_enableRx(obj->sciBHandle);
SCI_disableParity(obj->sciBHandle);
SCI_setNumStopBits(obj->sciBHandle,SCI_NumStopBits_One);
SCI_setCharLength(obj->sciBHandle,SCI_CharLength_8_Bits);

/////////////////// START: This is the part I added from the HAL tutorial to enable FIFO
SCI_enableTxFifoEnh(obj->sciBHandle);
SCI_setRxFifoIntLevel(obj->sciBHandle, SCI_FifoLevel_1_Word);
SCI_setTxFifoIntLevel(obj->sciBHandle, SCI_FifoLevel_1_Word);
SCI_enableRx(obj->sciBHandle);
SCI_enableTx(obj->sciBHandle);

/////////////////// END


// set baud rate to 115200
SCI_setBaudRate(obj->sciBHandle,(SCI_BaudRate_e)(0x0061));
SCI_setPriority(obj->sciBHandle,SCI_Priority_FreeRun);
SCI_enable(obj->sciBHandle);

The part of the code not in the within the comments are from the HAL tutorial. I tested the non-FIFO part, and it works as the SCI ISR is called, but once I added the indicated FIFO code it doesn't call the ISR any more. I programmed the 28069M using the peripheral header files before and it worked the way it should, but it just doesn't work the HAL.

Is there some ordering of function called that I am overlooking or is there something else?

  • What kind of interrupt are you trying to generate? I don't see any interrupt enable code in what you've shared. I see where you set the FIFO interrupt level, but have you enabled the FIFO interrupts (SCI_enableTxFifoInt or SCI_enableRxFifoInt)?

    Whitney

  • Ok. The SCI_enableRxFifoInt() was something I overlooked, but after adding that, the FIFO still didn't seem to work until I did a few more tweaks.

    This is what I have in the init method to get it working for anyone who is also struggling:

    void HAL_setupSciB(HAL_Handle handle) {
    HAL_Obj *obj = (HAL_Obj *)handle;

    SCI_reset(obj->sciBHandle);
    SCI_enableTx(obj->sciBHandle);
    SCI_enableRx(obj->sciBHandle);
    SCI_disableParity(obj->sciBHandle);
    SCI_setNumStopBits(obj->sciBHandle,SCI_NumStopBits_One);
    SCI_setCharLength(obj->sciBHandle,SCI_CharLength_8_Bits);

    SCI_enableTxFifoEnh(obj->sciBHandle);
    SCI_setRxFifoIntLevel(obj->sciBHandle, SCI_FifoLevel_4_Words); // Tune accordingly
    SCI_setTxFifoIntLevel(obj->sciBHandle, SCI_FifoLevel_1_Word);
    SCI_resetChannels(obj->sciBHandle);                            // This line seems neccessary


    // set baud rate to 115200
    SCI_setBaudRate(obj->sciBHandle,(SCI_BaudRate_e)(0x0061));     // Tune accordingly
    SCI_setPriority(obj->sciBHandle,SCI_Priority_FreeRun);
    SCI_enable(obj->sciBHandle);
    return;
    }