GPS with AT89C51

General discussion on mikroC PRO for 8051.
Post Reply
Author
Message
WWSIERT
Posts: 1
Joined: 03 Apr 2019 13:42

GPS with AT89C51

#1 Post by WWSIERT » 03 Apr 2019 13:56

I am feeding the GPS signal into a 8051 microcontroller via GT-7U GPS.
My code does not detect the header $GPRMC, the image below shows some
of the characters I m receiving. The received chars don't seem valid
and I don't know what I should change to correct this......


void receive_data() interrupt 4
{
info[check++]=SBUF; //Read SBUF
lcd_data(info[check-1]);
if(check<7) //Condition to check the required data
{
if(info[check-1]!=test[check-1])
check=0;
}

RI=0;
}

void serial()
{
EA=1;
ES=1;
SCON=0x50 ; // SERIAL MODE 1 ,8- BIT DATA ,1 STOP BIT ,1 START BIT
, RECEIVING ON
TMOD=0x20; //MODE=2
TH1=0xFD; // 9600 BAUD

TR1=1; //TIMER START

//IE=0x90; // enable interrupts...
}
void lcd_data(unsigned char item)
{
port2 = item;
rs= 1;
rw=0;
e=1;
delay(50);
e=0;
return;
}
Attachments
121c2c2facbf23b07fcf1ca13a81172fuben12.jpg
121c2c2facbf23b07fcf1ca13a81172fuben12.jpg (65.79 KiB) Viewed 1631 times

User avatar
jovana.medakovic
mikroElektronika team
Posts: 986
Joined: 18 Dec 2018 10:36

Re: GPS with AT89C51

#2 Post by jovana.medakovic » 04 Apr 2019 15:27

Hello,

The GPS module returns data in the form of NMEA responses.

On our GitHub, you can find some of our GPS examples, so there you can see on which way you can get a message.
https://github.com/MikroElektronika/GPS_click/
If you open driver.c, you can find function gps_parser, so maybe it will help you.

Unfortunately, we don't have GT-7U GPS, so I cannot test it.

Kind regards,
Jovana

Post Reply

Return to “mikroC PRO for 8051 General”