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.
Hi,
Would like to understand how SCI errors are flagged/cleared when in FIFO mode (SCIFFTX:SCIFFENA = 1) as the TRM is not clear on several points.
Error | Error flag(s) set when error occurs |
Break | SCIRXST:RXERROR and SCIRXST:BRKDT |
Framing | SCIRXBUF:SCIFFFE |
Parity | SCIRXBUF:SCIFFPE |
Overrun | SCIFFRX:RXFFOVF |
Thank you!
Regards,
Hong En
Hong,
1. Your table looks correct.
2. No, if RXERRINTENA is enabled the interrupt will automatically be triggered. Note for BRKDT to generate an interrupt, RXBKINTENA must be enabled.
3. Yes, these bits are independent of the FIFO being enabled. The RXERROR flag is set by the logical OR of BRKDT, FE, OE, and PE. Note that RXERROR would not be set unnecessarily, but if it did detect an error it would indicate that.
4. These bits are only applicable when the FIFO is enabled. Yes, both resets will clear these flags.
I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.
- Ken
Hi Ken,
Thanks for your reply, though I'm not clear on 2 & 4:
2. To detect BRKDT errors, I was trying to use RXERRINTENA to enable interrupts as per footnote (2) of Table 23-4 in the TRM. The issue as you noted in your reply to Q3 is that FE, PE and OE (even though not relevant when FIFO is enabled) will also set the same RXERR flag and trigger the interrupt.
The difficulty I'm facing is that upon a break error, FE is set first and BRKDT is only set 10 bit times after that. Is it correct to say that if I clear FE via a SCI software reset before BRKDT is set (i.e. before 10 bit times are up), BRKDT will never be set? Would like to know from TI what the expected behavior should be in order to write my error handling code.
4. I've been unable to clear SCIFFFE/SCIFFPE flags with either of those two resets. Is there any way to do so?
Regards,
Hong En
Hong,
I am in the process of investigating your questions and I will reply soon.
- Ken
Hong,
I consulted with the design team and below please find the reply to questions 2 and 4:
2. FE is cleared by SCI software reset SWRESET bit, which resets the SCI state machine. So if FE is cleared before BRKDT is set , BRKDT will not get set after the software reset. Also, BRKDT clear should always be a part of error handling ISR. There is a similar e2e query :
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/655383
4. As per the register description of the SCIRXBUF (bit 15 SCIFFFE and bit 14 SCIFFPE) will be cleared by a system reset.
I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.
- Ken