Interfacing parallax Gps Receiver
GtsTsgy
Posts: 3
Hi everybody, I bought parallax Gps Receiver Rev 2.3 last month. I want to interface it with 80c51 Phillips microcontroller read standard NMEA0183 data and display it in 4x20 lcd. but nothing is displayed in the lcd.
the type of gps i used is
http://www.grandideastudio.com/portfolio/gps-receiver/
and its datasheet is
http://www.parallax.com/dl/docs/prod/acc/GPSManualV1.1.pdf
my code is
#include "lcd.h" //lcd header file
bit datareceived = 0;
unsigned char Data;
/******************************************************************************/
void serial_init() //setting baudrate at 4800
{
PCON= 0x80;
TMOD = 0x20;
SCON = 0x50;
TH1 = (unsigned char)(256-(12000000/(12 * 16 * 4800)));
TR1 = 1;
}
/******************************************************************************/
void serial_read() interrupt 4 using 2
{
if (RI)
{
Data = SBUF;
RI = 0;
datareceived = 1;
}
}
/*************************************************************/
void main()
{
char ch,x=0;
lcdInit();
serial_init();
EA = 1;
ES = 1;
lcdClear();
lcdGotoXY(1,0);
lcdPrint("Communication");
RAM = 0;
while(1)
{
if(datareceived)
{
datareceived=0;
lcdGotoXY(x++,1);
sprintf(ch,"%c", Data);
lcdPrint(ch);
}
}
}
/*************************************************************/
the type of gps i used is
http://www.grandideastudio.com/portfolio/gps-receiver/
and its datasheet is
http://www.parallax.com/dl/docs/prod/acc/GPSManualV1.1.pdf
my code is
#include "lcd.h" //lcd header file
bit datareceived = 0;
unsigned char Data;
/******************************************************************************/
void serial_init() //setting baudrate at 4800
{
PCON= 0x80;
TMOD = 0x20;
SCON = 0x50;
TH1 = (unsigned char)(256-(12000000/(12 * 16 * 4800)));
TR1 = 1;
}
/******************************************************************************/
void serial_read() interrupt 4 using 2
{
if (RI)
{
Data = SBUF;
RI = 0;
datareceived = 1;
}
}
/*************************************************************/
void main()
{
char ch,x=0;
lcdInit();
serial_init();
EA = 1;
ES = 1;
lcdClear();
lcdGotoXY(1,0);
lcdPrint("Communication");
RAM = 0;
while(1)
{
if(datareceived)
{
datareceived=0;
lcdGotoXY(x++,1);
sprintf(ch,"%c", Data);
lcdPrint(ch);
}
}
}
/*************************************************************/
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Yes, I am running in RAW mode. And I do not have problems in displaying data on the 4x20 LCD
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen