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.

gps interfcing 8051.................

Status
Not open for further replies.

amitpj

Member level 1
Joined
Aug 30, 2010
Messages
36
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,469
i am interfacing gps with 8051 i have tried lot but i am not able to get output at lcd 16x2 so plz help me
 

here is code
 

Attachments

  • main.rar
    1.4 KB · Views: 72

type of GPS module?
 

s it will work it is 4800 and it is GT-320r..
 

your program is more complex.. it can be written is a very simple way... just wait for $ symbol and when $ synbol is got then store the incoming data in a array.. and display it... count the number of characters you need to display and define the size of the array....
 

so what is your exact problem...?
you can't receive GPS data..?
or you can't see data on LCD
or both...?
 

i will get message but not what i want..

---------- Post added at 18:23 ---------- Previous post was at 18:17 ----------

your program is more complex.. it can be written is a very simple way... just wait for $ symbol and when $ synbol is got then store the incoming data in a array.. and display it... count the number of characters you need to display and define the size of the array....

sir i have done that only but here in between ascii and int i.e from SBUF to int or char i am not able to take the data ..
 

just print it or store it and print it ... do do any circus with the data.......

s i have done it


this is code now what u told



#include<reg51.h>
#include"lcd.h"
sbit inr=P3^3;
char comma_position[15];
char info[70];
char test[6]={"$GPGGA"};
unsigned int check=0;





void send_cha(unsigned char t)


{

SBUF=t;
while(TI==0);
TI=0;
}





void read_data()
{
unsigned int i;
while(RI==0);
i=SBUF; //read sbuf
lcd_writec( i);
RI=0;
}



void bau()
{
//PCON &= 0x7f;
TMOD = 0x20; /* 8bit auto reload(Tmod2 )*/
TH1 = 0xfd; /*baud rat = 9600*/
SCON = 0x50;
TR1 = 1 ; // start timer

}
here i am getting now what i should do..
 

forget the modem..... connect board to pc and from hyperterminal see if you get the data on LCD properly or not at 2400 or whatever baudrate you have set... if you get data properly on lcd use the same program to gps also........
 

so displaying data on LCD is not the problem...?
first you are reeving data in interrupt mode..?
your receive function doesn't seems to be an ISR...(may be i am wrong because it is more than 4 years i have not used 8051)
void receive_data()
{
info[check++]=SBUF; //Read SBUF
if(check<7) //Condition to check the required data
{
if(info[check-1]==test[check-1])
check=0;
}
RI=0;
}

also in receive you should start receiving if "$" is received other wise your comparing will not be correct...
because you never know when you start receiving what was GPS sending may be in middle of a packet...
 

forget the modem..... connect board to pc and from hyperterminal see if you get the data on LCD properly or not at 2400 or whatever baudrate you have set... if you get data properly on lcd use the same program to gps also........

yes i am what ever i type in hyperterminal it will display in lcd but when i will connect it to gps there is game ..
 

put a check in receive function and check the incoming character matches with $

if $ comes then only print the data or else dont print... do this exercise and let me know..

if it works fine then change the baud rate to gps and connect it... the same program should work there also....
 

put a check in receive function and check the incoming character matches with $

if $ comes then only print the data or else dont print... do this exercise and let me know..

if it works fine then change the baud rate to gps and connect it... the same program should work there also....



yes sir it is working my lcd is showing $$$$$$$$$$$$$$ then what i should do ...?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top