Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing parallax Gps Receiver — Parallax Forums

Interfacing parallax Gps Receiver

GtsTsgyGtsTsgy Posts: 3
edited 2009-06-22 02:29 in Accessories
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);
}
}
}
/*************************************************************/

Comments

  • hover1hover1 Posts: 1,929
    edited 2009-06-21 12:45
    Are you running the GPS in RAW mode? (Pin 4 low)
  • FranklinFranklin Posts: 4,747
    edited 2009-06-21 13:26
    First make sure you can display text on the LCD. You will have to find code elsewhere. Then make sure you are getting data from the GPS, hook it up to your computer and see if it is sending data. Now you can connect the two in your code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • GtsTsgyGtsTsgy Posts: 3
    edited 2009-06-21 13:45
    Thanking Stephen and ---- for your help.

    Yes, I am running in RAW mode. And I do not have problems in displaying data on the 4x20 LCD
  • GtsTsgyGtsTsgy Posts: 3
    edited 2009-06-21 16:08
    TH1 = (unsigned char)(256-((12000000/192)/ 4800));
  • FranklinFranklin Posts: 4,747
    edited 2009-06-22 02:29
    I would do the math on a calculator and plug that number into the equation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.