Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top