rimip
Newbie level 6
Hello guys.
I am working on a project using the PIC16F690 that will capture/receive the NMEA strings coming out the GPS receiver and display it on the screen.
To test if my c program structure works, I am simply sending a string from another microcontroller and I am displaying it on the screen. So this part of my software WORKS. When I plug in my GPS, I see nothing on the screen.
I plugged my GPS to the computer and I see the NMEA data perfectly.
These are some important parts of my software, I don't know if I should post all, it's kinda long.
My interrupt routine is this:
The data I am sending: $GPSDATA
On the receiving end, if I find a $, I start collecting the characters. When I have all the characters I want, I display on the screen, and start looking for the next $ for the next set of data.
When I plug in my GPS, I should see something on the screen, because the GPS does send out "$".
I am working on a project using the PIC16F690 that will capture/receive the NMEA strings coming out the GPS receiver and display it on the screen.
To test if my c program structure works, I am simply sending a string from another microcontroller and I am displaying it on the screen. So this part of my software WORKS. When I plug in my GPS, I see nothing on the screen.
I plugged my GPS to the computer and I see the NMEA data perfectly.
These are some important parts of my software, I don't know if I should post all, it's kinda long.
Code:
startLCD(); // Delay / Init. LCD / clear
i = 0;
rcflag = 0;
printflag=1;
ei(); //Enable Interrupts
while (1)
{
ReturnHome(); // return screen to home position.
if ((recdata == '$')&(printflag==1)) // LOOK for the $ sign ("$")
{
rcflag = 1;
printflag=0;
i=0;
}
if ((rcflag == 1)&(newdataflag==0)) //store data
{
newdataflag = 1;
rcnum[i] = recdata;// STORE rx/ed data in rcnum array
i++;
printflag = 0;
}
if (i>7) // DO THE FOLLOWING IF I HAVE ALL the characters wanted
{
RCIE = 0; //DISABLE INTERRUPTS
rcflag = 0;
i=0; //RESET BUFFER
// SEND THE CHARCTERS COLLECTED TO THE SCREEN
SendInfo(rcnum[0]);
SendInfo(rcnum[1]);
SendInfo(rcnum[2]);
SendInfo(rcnum[3]);
SendInfo(rcnum[4]);
SendInfo(rcnum[5]);
SendInfo(rcnum[6]);
SendInfo(rcnum[7]);
i=0;
printflag = 1;
RCIE = 1; //ENABLE INTERUPTS
}
}//END WHILE
}//END MAIN PROGRAM
My interrupt routine is this:
Code:
void interrupt Usart_isr(void)
{
di();
newdataflag = 0;
recdata = RCREG;
RCIF = 0;
ei();
}
The data I am sending: $GPSDATA
On the receiving end, if I find a $, I start collecting the characters. When I have all the characters I want, I display on the screen, and start looking for the next $ for the next set of data.
When I plug in my GPS, I should see something on the screen, because the GPS does send out "$".
Last edited: