Beruflich Dokumente
Kultur Dokumente
Contents at a Glance
8051 Primer Board ...........................................................3
GPS (Global Positioning Systems) .....................................3
Interfacing GPS ................................................................4
Interfacing GPS with 8051 ................................................5
Pin Assignment with 8051 ................................................5
Circuit Diagram to Interface GPS with 8051 ......................6
Source Code ....................................................................6
C Program to receives data from satellite to 8051 ............7
Testing the GPS with 8051 ...............................................9
General Information ...................................................... 10
Interfacing GPS
Fig. 1 shows how to interface the GPS with
microcontroller. The GPS module continuously transmits
serial data (RS232 protocol) in the form of sentences
according to NMEA standards. The latitude and longitude
values of the location are contained in the GPGGA sentence
(refer NMEA format).To communicate over UART or USART,
we just need three basic signals which are namely, RXD
(receive), TXD (transmit), GND (common ground). So to
interface UART with 8051, we just need the basic signals.
ISP PGM
UART0(P1)
8051
Lines
TXD-0
P3.0
RXD-0
P3.1
TXD-1
P1.2
(P2)
UART1
8051
MAX
3232
RXD-1
P01.3
Source Code
The first six bytes of the data received are compared
with the pre-stored string and if matched then only data is
further accounted for; otherwise the process is repeated
again. From the comma delimited GPGGA sentence, latitude
and longitude positions are extracted by finding the
respective comma positions and extracting the data.
//---------------------------------------------------------//
Serial Communication Register Initialisation
//---------------------------------------------------------void serial(void)
{
TMOD=0X20;
//Timer1, Mode2
SCON=0X50;
//Serial Mode1, Receive Enable
TH1=0XFD;
//Baud Rate 9600bps
TR1=1;
//Timer1 ON
}
//----------------------------------------//
Serial Interrupt Function
//----------------------------------------void serin (void) interrupt 4
//Serial Port Interrupt
{
if(RI==1)
//Receive Interrupt Gets Enabled
{
//after Stop Bit get Received
d=SBUF;
//Serial Buffer value moved to a variable
b[j]=d;
SBUF=b[j];
DelayMs(20);
j++;
}
SCON=0X50;
//Delay Function
}
//--------------------------------//
Delay Function
//--------------------------------void DelayMs(unsigned int k)
{
unsigned int i;
for(i=0;i<=k;i++);
}
What do we sell?
Our products range from Various Microcontroller
development boards, DSP Boards, FPGA/CPLD boards,
Communication Kits, Power electronics, Basic electronics,
Robotics, Sensors, Electronic components and much more . Our
goal is to make finding the parts and information you need
easier and affordable so you can create awesome projects and
training from Basic to Cutting edge technology.