Microcontroller › 8051 › problem interfacing gps with 8051
- This topic has 3 replies, 3 voices, and was last updated 11 years, 5 months ago by Jason Jordon.
-
AuthorPosts
-
April 2, 2013 at 11:24 am #2223saraParticipant
Hi,
I have been interfacing gps modem with 8051 with correct connection as per your circuit diagram and followed the code given under EG labs.
The program is given with comments which is very helpful but I am having difficulty in decoding the line in the given program , i.e
if(check==69)… the program is not satisfying this condition and hence not going into the compare loop and not reading the latiitude and longitude values from the GPS receiver.
Please clarify and help me out. Or provide me with an alternate program at the earliest possible..
Thanks in advance.
April 2, 2013 at 4:28 pm #9415AJISH ALFREDParticipantHi Sara,
It would have been more easier for us to help you if you share the location of the code in this site.
April 3, 2013 at 12:42 pm #9425saraParticipantIn this site u can go to EG labs >> MICROCONTROLLER >> 8051 >> How to interface gps with microcontroller 8051 >> code and you can find the code there..
for convenience the program is as follows..
/* Basic program to show latitude and longitude on LCD extracted from GPGGA statement */
#include<reg51.h>
#define port2 P2
sbit rs = P1^0;
sbit rw = P1^1;
sbit e = P1^2;
char info[70];
char test[6]={“$GPGGA”};
char comma_position[15];
unsigned int check=0,i;
unsigned char a;
void receive_data();
void lcd_latitude();
void lcd_longitude();
//DELAY FUNCTION
void delay(unsigned int msec)
{
int i,j ;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
// LCD COMMAND SENDING FUNCTION
void lcd_cmd(unsigned char item)
{
port2 = item;
rs= 0;
rw=0;
e=1;
delay(1);
e=0;
return;
}
// LCD DATA SENDING FUNCTION
void lcd_data(unsigned char item)
{
port2 = item;
rs= 1;
rw=0;
e=1;
delay(1);
e=0;
return;
}
// LCD STRING SENDING FUNCTION
void lcd_string(unsigned char *str)
{
int i=0;
while(str!=’