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.

Does RECEIVE Interrupt also occurs for DATA Frame for which FRAME Error Occurred in SCILIN Module with SCI Mode?

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

Hello Support,

Does RECEIVE Interrupt also occurs for DATA Frame for which FRAME Error Occurred in SCILIN Module with SCI Mode?
In essence, suppose for a DATA Frame, SCI Module detected FRAME Error at the end.
Will it generate both FRAME ERROR as well as RDY bits within SCIFLR Register?
Assume SCILIN Module being used in SCI Mode. Assume FE and RX Interrupts are enabled.
FE Interrupt mapped to INT0 and RDY Interrupt mapped to INT1 Levels of SCILIN Module.
Do I expect to have both interrupts for the Received DATA Frame being received for which FRAME Error took place due to some condition?

Thank you.
Regards
Pashan

  • Pashan,

    If both Rx and FE interrupt are enable, that you will have 2 request.
    In general, it is recommended to map the error interrupt with a higher priority. In this case your application will service the error handler first.
    Within the error handler you will have to take care of clearing the error flag has well as the receive flag so you don't execute the receive handler on this bad data.

  • Hello Jean-Marc,

    In the FE Interrupt [INT0 -- Higher Priority],
    I read the SCIRD Register as well as CLEAR FLR Register for FE Bit by wrting 1.
    So it will clear the RDY Bit I assume and hence no RX Ineterrupt [INT1 -- Lower Priority] will not occur.
    But INTREQ Bit of VIM will not be cleared.
    Hence, I am getting SCI RX [INT1] Interrupt for the case where FE Interrupt [INT0] occurred.
    Is that correct or something I am missing within FE Interrupt handler?

    Thank you.
    Regards
    Pashan

  • Pashan,

    I did a quick test, and here is the result.

    If both FE and RX are interrupt enable in the SCI module as respectively High and Low request, and the VIM Mask is set to capture both interrupt than:

    In your FE_Error handler you will have to clear both flag (FE and RX from SCI module) as well as the VIM request corresponding to the RX flag. Otherwise, when you exit your FE_ERROR handler you will jump in the RX_HANDLER.

  • Hello jean-Marc,

    Can you please attach your complete PROJECT Source as ZIP so that I can also build here are understand?

    It will be of great help.

    Also, how did you generate ERROR that also please tell.
    Thank you.
    Regards
    Pashan

     

  • Pashan,

    At that point, I don't have a real project that I can share, but I can work on that Monday.

    To generate framing error, I'm using a window terminal set as 8bits 1 stop.
    In the SCI configuration I'm using 7bits 1 stop.
    Using this setup I'm able to generate FE error.

  • Pashan,

    Here is my Halcogen and CCS project for testing the SCI Framing error in TMS570LS3137.

    I'm using the SCI_USB from the HDK to receive data from PC. The USB port can also be used for debug.
    My window terminal is setup as:9600, 8bits, no parity, 1 stop, no flow control.

    On the device side, I have the same configuration.

    SCI_Low interrupt for SCI_RX
    SCI_High interrupt for SCI_FE.

    To generate the framing error, I change the data size from 8 to 7 on the device.
    The CPU will jump in void linHighLevelInterrupt(void)

    Please let me know if this clarify your question.

    2402.SCI_Frame_Error.zip

  • Hello Jean-Marc,

    Thank you for the DEMO.

    Following is my question :

    1> For usual case of clearing VIM INTREQ, we just clear the Peripheral Side Request either by writing specific Register Status or by reading the specific Peripheral Register VECTOR_OFFSET within Peripheral Register Address SPACE.
    But for this case of FRAME_ERROR, even though you are writing 0x200 to SCIFLR Register, why do you need to write to VIM INTREQ Register directly?
    I am asking this question, because we use external RTOS which manages all the VIM related Programming and hence we don't have any direct access to VIM INTREQ Bit Mapping related to Peripheral Interrupt Channels.
    Once you answer this question, I can ask my supplier for the exact solution.

    Regards
    Pashan

  • Pashan,

    In the case of FE_ERROR, the SCI module generates 2 requests. One for FE_ERROR and one for RX.
    That was your original question.
    I've setup the FE_ERROR as High Priority and RX as Low Priority.
    When the FE_ERROR occurs, the CPU will jump to the ISR and will deal with framing error, clearing the flag.
    The RX request is still pending and registered in the VIM. So before exiting the ISR, I'm clearing the RX flag in the SCI and clear in the VIM this pending request.
    This is an application dependent implementation. If you still want to service the RX request, it is up to you. In my case, this receive data is bogus (because of the framing error) and I want to discard it.
    Another way is to inform the application of the framing error, and still process the RX request. Later in the application the data will be discarded because of the framing error.
    The summary is, in case of framing error, both FE and RX flag are set in the SCI.
    You have to decide the way to take care of this situation. I'm assuming that framing error should not happen very often, so I don't want to penalize the RX handler by checking all the time if FE is set.
    Please let me know if this is clear now.

  • Pashan,

    The reason for the additional clearing of the flag inside the VIM is explained in an earlier post initiated by you: http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/204747/727113.aspx#727113

    Basically, the flag inside VIM stays set even if the flag in the interrupt source module is cleared. This is done because some modules generate pulse interrupts while others generate level interrupts. The flag inside VIM can be cleared in multiple ways as explained in the referenced thread.

    Regards, Sunil