Daljeet12
Member level 4
I am trying to understand basic logic of GPS program. how the microcontroller read and Parse the GPS data
I have created following pseudocode. I am having difficulty in interrupt service routine. I am looking help to develop interrupt service route
I have created following pseudocode. I am having difficulty in interrupt service routine. I am looking help to develop interrupt service route
C:
#define MAX_SENTENCE_LENGTH 20
void main(void)
{
init();
while(1)
{
if((strncmp("GPGSV",GPSmsg,5)==0)
{ // if found GPGSV
extract lat and lon etc.
}
if((strncmp("GGA",GPSmsg,3)==0)
{ // if found GGA
// extract data.
}
}
}
void interrupt(void)
{
if(RI==1)
{ // if character is received..
temp = SBUF; // read and save it
RI=0; // and clear interrupt flag
if(temp == '$')
{ // look for '$' to start the sentence,
GPSmsg[ix++]= temp; // save character in buf
}
}
}