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.
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?
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.
Rich (BB 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);
}
}
}
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?
Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):