Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/09/10 11:56
Read: times


 
#177176 - Problems with GPS Receiver and the 8051
I am planning to interface the EM406A GPS receiver with the 8051, parse the NMEA data sentences and display the Latitude and Longitude on a 16 x 2 LCD module..

So far, I have managed to interface the EM406A module to the serial port of my PC and display the NMEA sentences on the hyperterminal(with is mostly just plug and play)
The module works at 4800 baud and follows the 8n1 format.
I next interfaced the module to my P89V51RD2 controller,in the following manner
GPS TX ==> 8051 RX
GPS RX ==> 8051 TX
(COMMON GND)

Next, I burnt the following code into my controller(this code is mainly to check the customary dollar "$" sign that initiates every NMEA sentence)

sbit check=P3^7;                //making P3.7 a flag

void serial_init();
char serial_rec();

void serial_init()              // initializing the controller for 4800 baud
{RI=0;
TMOD=0x20;
TH1=0xFA;                       // 4800 baud rate
SCON=0x50;
TR1=1;
return;
}
char serial_rec()               //receiving data into SBUF by polling
{
while(RI==0);
RI=0;
return(SBUF);
}

void main()
{
unsigned char ch;
check=0;                        // making "check" flag zero
serial_init();                   
while(1)
{
ch=serial_rec();
if(ch==0x24)                    //HEX equivalent of ASCII'$' sign is 0x24
{check=1;                       //if '$' sign , make "check" HIGH
for(;;);                        // and infinite loop
 }
 else
 check=0;                       // else, "check" stays LOW.
}
}

 


No errors,no warnings,but the check flag never goes high when I test pin 3^7 with a voltmeter(although RI does go to a HIGH indicating that data is coming into the SBUF)
I tried a lot of other things( like displaying the incoming data on the LCD) , but no results.
I'm sure there's some problem with my code that I've overlooked , or my interfacing might be faulty.

What could be the problem here?

Thanks!


List of 41 messages in thread
TopicAuthorDate
Problems with GPS Receiver and the 8051            01/01/70 00:00      
   Take a step back.            01/01/70 00:00      
      Always very baudrate by measuring it            01/01/70 00:00      
      Roger that..            01/01/70 00:00      
         Noise ?            01/01/70 00:00      
         RE: Random data            01/01/70 00:00      
            Working on the hyperterminal...            01/01/70 00:00      
               Tx Rx pins            01/01/70 00:00      
                  The connections seem to be fine...            01/01/70 00:00      
                     GPS emulator            01/01/70 00:00      
                        Keil Simulator            01/01/70 00:00      
                           Great idea...            01/01/70 00:00      
                              Simulating GPS seems to work...            01/01/70 00:00      
                                 scope time            01/01/70 00:00      
                     LCD display delay problem?            01/01/70 00:00      
   Sio_poll_0.6.zip            01/01/70 00:00      
      comp.xx not nicest            01/01/70 00:00      
         Thanks Per.            01/01/70 00:00      
            Ask for suggestions how to improve the code            01/01/70 00:00      
               Good advice...            01/01/70 00:00      
      Hyperterminal works            01/01/70 00:00      
         A doubt in the datasheet...            01/01/70 00:00      
            it means that they do not know            01/01/70 00:00      
            Correct            01/01/70 00:00      
            why            01/01/70 00:00      
   Let's Do a Sanity Check            01/01/70 00:00      
      EM406            01/01/70 00:00      
      It is very weird, but...            01/01/70 00:00      
         Then is is time for....            01/01/70 00:00      
            Oscilloscpe.            01/01/70 00:00      
               Verify voltages with scope            01/01/70 00:00      
         re inversion (not) needed)            01/01/70 00:00      
      Use the simulator!            01/01/70 00:00      
         Don't really know...            01/01/70 00:00      
            Using the Keil Debugger/Simulator            01/01/70 00:00      
               Working! Now...            01/01/70 00:00      
                  Expensive solution            01/01/70 00:00      
                     True...            01/01/70 00:00      
                        SD_Card_and_DCFS16.zip            01/01/70 00:00      
                           broken link            01/01/70 00:00      
                     not all "level-converter chips" are special            01/01/70 00:00      

Back to Subject List