Part Number: TMS320F280039C
Dear Champs,
I am asking this for our customer.
Because the user's application is bootloder, they don't want to use interrupt. Instead, they want to use polling-based codes to check SCI SCIRXST.RXRDY.
When they used codes like below, they found they would miss data intermittently.
pseudo code:
int main()
{
while(1)
{
GetRxData();
}
}
void GetRxData()
{
if(SCIRXST.bit.RxRDY == 1)
{
Data = SCIRXBUF.bit.SAR;
}
}
but if the user changes to codes like below, there is no missing byte.
void GetRxData()
{
while (SCIRXST.bit.RxRDY == 0)
{
}
Data = SCIRXBUF.bit.SAR;
}
However, because the use does not use interrupt, the while (SCIRXST.bit.RxRDY == 0) loop will take too much time so that the background loop is stuck in GetRxData(), which is not desired.
The user wants to use if-based codes.
Therefore, we would like to check the behaviors in more detail.
1. From "Table 25-13. SCIRXST Register Field Descriptions" of TRM,
"...RXRDY is cleared by a reading of the SCIRXBUF register, by an active SW RESET, or by a system reset...."
Case 1:
There is an input byte and the input byte is copied into SCIRXBUF and there is no further input byte. If the user does not read SCIRXBUF, RXRDY is kept HIGH unless there is a reset. Is it right?
Case 2:
There is input bytes regularly. If the next byte (say "0x02") overwrites the previous byte (say "0x01") and there is not reading to SCIRXBUF, what is the behavior of RXRDY?
Will it be kept HIGH?
Or will it HIGH (means 0x01 byte is ready to be read) and then LOW (during overwriting), and then HIGH (the 0x02 byte is ready to be read)?
Or else behavior?
That is, we want to confirm if RXRDY will drop?
