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.

TMS320F28379D: SCI Rx error in case of continuous data

Part Number: TMS320F28379D
Other Parts Discussed in Thread: LAUNCHXL-F28379D

Dear TI Experts,

I'm working on Launchxl-F28379D board.

What I want is to get continuous data and sent ACK or NAK with SCIB.

I tested this in polling mode, Non FIFO interrupt and FIFO interrupt.

But in all cases, I failed to receive the whole data.

In case of using Non FIFO interrupt, I can receive all data only if my PC application sends data with over 200ms wait in between.

But data with no wait or 100ms wait can't be received on SCIB.

This symptom is the same in the different operation mode.

With FIFO interrupt mode, I set FIFO Level to two and I can receive two continuous bytes successfully, but next two bytes are broken in case of insufficient wait between first two bytes and the next two bytes.

Below is my code for Non FIFI Interrupt mode.

Please anybody advice me about what I did mistake.

In main function

    Device_init();

    Device_initGPIO();


    //
    // GPIO19 is the SCI Rx pin.
    //
    GPIO_setMasterCore(19, GPIO_CORE_CPU1);
    GPIO_setPinConfig(GPIO_19_SCIRXDB);
    GPIO_setDirectionMode(19, GPIO_DIR_MODE_IN);
    GPIO_setPadConfig(19, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(19, GPIO_QUAL_ASYNC);

    //
    // GPIO18 is the SCI Tx pin.
    //
    GPIO_setMasterCore(18, GPIO_CORE_CPU1);
    GPIO_setPinConfig(GPIO_18_SCITXDB);
    GPIO_setDirectionMode(18, GPIO_DIR_MODE_OUT);
    GPIO_setPadConfig(18, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(18, GPIO_QUAL_ASYNC);


    Interrupt_initModule();

    Interrupt_initVectorTable();


    Interrupt_register(INT_SCIB_RX, scibRXFIFOISR);
    setSCIB();

    Interrupt_enable(INT_SCIB_RX);

    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);

    EINT;
    ERTM;

    for(;;)
    {
    }

In setSCIB()

void setSCIB(void)
{

    SCI_performSoftwareReset(SCIB_BASE);

    //
    // Configure SCIA for echoback.
    //
    SCI_setConfig(SCIB_BASE, DEVICE_LSPCLK_FREQ, 9600, (SCI_CONFIG_WLEN_8 |
                                                        SCI_CONFIG_STOP_TWO |
                                                        SCI_CONFIG_PAR_NONE));
    SCI_resetChannels(SCIB_BASE);
    SCI_clearInterruptStatus(SCIB_BASE, SCI_INT_RXRDY_BRKDT);
    SCI_enableModule(SCIB_BASE);
    SCI_performSoftwareReset(SCIB_BASE);

    SCI_enableInterrupt(SCIB_BASE, (SCI_INT_RXRDY_BRKDT));
}

In scibRXFIFOISR()

__interrupt void scibRXFIFOISR(void)
{
    uint16_t i;
    uint16_t rcvChar[2];
    uint16_t fifoLevel;

    rcvdData = SCI_readCharBlockingNonFIFO(SCIB_BASE);

    SCI_clearOverflowStatus(SCIB_BASE);

    SCI_clearInterruptStatus(SCIB_BASE, SCI_INT_RXRDY_BRKDT);

    //
    // Issue PIE ack
    //
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);

}

Thank you in advance.

Best regards,

James.

  • Hi James,

    Can you please confirm whether the format of the data in which it is being sent is matching with what you've configured in the example code?

    Baud Rate: 9600

    Word Length: 8

    Stop bits: 2

    Parity: None

  • Hi Aditya,

    Yes, I've already confirmed the format of data is matching with what I configured.

    I'm using Putty and my own application. Both set 9600-8-2-None.

    As I mentioned above, my code can get data correctly but continuous data is broken in case of insufficient wait between data frame.

    Is there something wrong or what I missed?

    Thank you in advance,

    James

  • James,

    I do not see any issue with the code configuration primarily, let me pull in hardware expert here as well. 

  • Hi James,

    Can you confirm that the PC is not "clobbering" the transmissions when you send with less than 100ms delay? Essentially, can you take a scope capture of the C2000-RX pin for us to review? It's hard to tell what's going on without seeing the pins directly.

    I have seen similar situations before, where the transmitting device does not have a "queue" and essentially just starts transmitting all the data on top of each other.

    The other potential issue is if you aren't using 2 stop bits. Every time an interrupt fires on the SCI, the interrupt won't start until 1 stop bit plus another 7/8th of a stop bit of detection time. This is an issue in the SCI itself. So a total of 1+7/8 stop bits is needed between interrupts.

    Regards,

    Vince