filtering received messages via rs232

Status
Not open for further replies.

adnan_merter

Full Member level 3
Joined
Jan 23, 2008
Messages
160
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Location
The most beautiful city of the world
Activity points
2,526
hi,

i am working on a mcu circuit that can communicate another device, and it receives so many message lines. My mcu doesnt have enough ram to store all message lines. So, i tried the code below with my pic18f4550 and 48 mhz clock to filter the message lines and pick the required values from the streaming message.

Code:
static char message[25];
static char value_required[25]
staric char *ptr;
static int1 value_get = FALSE;

char filter[] = "filter_value";

void main (void)
{

puts("some_command");

while(value_get == FALSE)
{
gets(message);
ptr = strstr(message,filter);
if(ptr != NULL)
{
strcpy(value_required,message);
value_get = TRUE;
lcd_putc(value_required);
}
}
}
when i try to run this code , nothing happens. i know it gets values but never filters and sends to lcd.

i am a little concerned about the clock rate, 48 mhz is enough to run string functions while getting characters at 9600 baud ? or i am using the wrong function?
 
Last edited:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…