cancel
Showing results for 
Search instead for 
Did you mean: 

best way of monitoring & capturing usart protocol for finding & storing of a desire characters

mhdizgah
Associate II
Posted on December 31, 2014 at 16:02

hi every one

is there any special function for this purpose ? i am currently read characters byte by byte and compare them with desire character but i dont know why it does not work some time my way :

do
R_Buffer=usart_reci(1);//function of receiving characters from usart 1 its work correctly
while( R_Buffer=='o'| R_Buffer=='O');

best regards
1 REPLY 1
Posted on December 31, 2014 at 18:34

Well C has a number of string and tokenizing functions.

The kind of stuff you're taking about at a character level really requires you to do the work, perhaps with a state machine implementation, with the ability to resynchronize at a line or character level if the expected sequencing fails.

Note also that you want the '||' form of OR not the ''|' form for the loop test you are using.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..