GPS with AT89C51
Discussion in "Project Help" started by WWSIERT Apr 3, 2019.
Wed Apr 03 2019, 06:48 pm
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;
}
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;
}
Wed Apr 03 2019, 08:11 pm
Can you post your full code.
Do you have a serial to USB adapter ?
If not, get one, they are very useful for this sort of project.
If you have one, use it to connect your GPS to your PC to test its output.
You can then connect the PC to your 8051 to test its response to known characters.
Do you have a serial to USB adapter ?
If not, get one, they are very useful for this sort of project.
If you have one, use it to connect your GPS to your PC to test its output.
You can then connect the PC to your 8051 to test its response to known characters.
[ Edited Thu Apr 04 2019, 04:01 am ]
Powered by e107 Forum System