Hi all,
I am working with the CC2540 EM kit and I have programmed the chip to make it read data from the UART and transmit the data. However, I am having issues with the timeout of UART RX. For instance, if I expect 10 bytes of data and 9 bytes of data is received, the 1 byte of data missed during current iteration sits on the UART buffer and gets receievd at the next iteration and causes an offset in my packet (which causes many problems when trying to find the sync word and so on ).
My questions are:
1) Is there a way for me to flush what is on the UART buffer after I have grabbed the number of bytes that I want?
2) Is there a method to timeout the UART operation when no response is obtained on RX line?
If yes pls explain
Thanks in advance.