How to process the data from UART?

Hi all .
In one way ,all the messages is following a standard format ,like:"SOH,MSG ID, CMPL ID,MSG DATA LENGTH, MSG DATA ,CHECKSUM",so this format can be embed in UART_ISR to receive the message wanted.But,if have some different kinds of message which following different formats ,or baudrate is too high to process in the UART_ISR,how can the firmware process these message?Where have any referenced source code ?
Thanks for help.

Parents
  • It's quite certainly not a good idea to do any processing like the one you're talking about inside the ISR. Let the main code deal with it. All the ISR can usefully do is receive the data, a byte at a time, and push it into a circular buffer of adequate size. The main code will pull it out of that, and do whatever needs being done.

Reply
  • It's quite certainly not a good idea to do any processing like the one you're talking about inside the ISR. Let the main code deal with it. All the ISR can usefully do is receive the data, a byte at a time, and push it into a circular buffer of adequate size. The main code will pull it out of that, and do whatever needs being done.

Children
More questions in this forum