Microcontroller › 8051 › problem interfacing gps with 8051 › In this site u can go to EG
In 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!=’