Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem with GPS+8051

Status
Not open for further replies.

fatima_just

Junior Member level 1
Joined
Sep 13, 2008
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,419
I use GPS reciever interface with 8051 but it is work out of door so I can not take
data from GPS so I can not see the formate of data (this GPS has NEMA sentence)

pleas help me
 

just attach the antenna of to a long stick and hold it outside ur window (well thats what i did the first time :D)
 

thanks for reply

Is your GPS work by NMEA-0183 ?

my boud rate is 9600 How I can set boud rate is it by coding ?

(I am use C language in Kiel software)
 

yes its NMEA-0183 protocol, and the baud rate according to NMEA-0183 protocol is 4800 not 9600
here is code for setting baudrate for controller

#define BAUDRATE 9600
#define XTAL 11059200
void CommInit(void)
{
TMOD = 0x20; // Timer1 Mode 2, 8-bit Reload.
SCON = 0x50; // 8-bit, 1 stop bit, REN enable.
TH1 = (256 - (XTAL /( 12l * 32L * BAUDRATE))); //12 clock periods per machine cycle

TR1 = 1; // Start Timer
TI = 0;
}

for 8051 codes check out:
https://www.dnatechindia.com/index.php/Code-Library/
 

Hey fatima,
GPS is set to default baud rate of 4800. You configure your code to 4800. then it should work.
Before interfacing connect GPS to serial port and check in the hyperterminal, if you get the output properly or not. That will reduce 60% of your problem.
 

thanks for reply I will see that but I need code to get output from GPS in C language
 

//********ALP PROGRAM FOR GPS*********************//
org 00h
ljmp main
org 0100h

main: mov p0,#00h

mov a,#30h
lcall cmdrt
lcall delay

mov a,#30h
lcall cmdrt
lcall delay

mov a,#38h
lcall cmdrt
lcall delay

mov a,#06h
lcall cmdrt
lcall delay

mov a,#0fh
lcall cmdrt
lcall delay

mov a,#80h
lcall cmdrt
lcall delay


main1: mov a,#01h
lcall cmdrt
lcall delay
mov a,#'W'
lcall dw1
lcall delay

mov a,#'E'
lcall dw1
lcall delay

mov a,#'L'
lcall dw1
lcall delay

mov a,#'C'
lcall dw1
lcall delay

mov a,#'O'
lcall dw1
lcall delay

mov a,#'M'
lcall dw1
lcall delay

mov a,#'E'
lcall dw1
lcall delay

mov a,#' '
lcall dw1
lcall delay

mov a,#'T'
lcall dw1
lcall delay

mov a,#'O'
lcall dw1
lcall delay

mov a,#' '
lcall dw1
lcall delay

mov a,#'G'
lcall dw1
lcall delay

mov a,#'P'
lcall dw1
lcall delay

mov a,#'S'
lcall dw1
lcall delay

mov a,#0c0h
lcall cmdrt
lcall delay

lcall delay1

lcall delay1
lcall delay1

lcall delay1

; GPS Routine

mov scon,#50h
mov tmod,#20h
mov th1,#0fah
mov tl1,#0fah
setb tr1
loop23: mov a,#01h
lcall cmdrt
lcall delay
he: clr ri
jnb ri,$
mov a,sbuf
cjne a,#'$',he

mov dptr,#write
hrs: clr a
movc a,@a+dptr
cjne a,#'$',hr
sjmp her

hr: lcall dw1
lcall delay
inc dptr
sjmp hrs

her: lcall delay1
lcall delay1
lcall delay1

mov a,#01h
lcall cmdrt
lcall delay

mov a,#80h
lcall cmdrt
lcall delay


here: clr ri
jnb ri,$
mov a,sbuf
cjne a,#'G',here
clr ri
jnb ri,$
mov a,sbuf
cjne a,#'G',here
clr ri
jnb ri,$
mov a,sbuf
cjne a,#'A',here
mov r7,#0bh
here2: clr ri
jnb ri,$
djnz r7,here2
mov r7,#0bh
here3: clr ri
jnb ri,$
mov a,sbuf
lcall dw1
djnz r7,here3
mov r0,#40h
mov r7,#0dh
here8: clr ri
jnb ri,$
mov a,sbuf
mov @r0,a
inc r0
djnz r7,here8

mov a,#'-'
lcall dw1
lcall delay



mov a,#'L'
lcall dw1
lcall delay

mov a,#'A'
lcall dw1
lcall delay

mov a,#'T'
lcall dw1
lcall delay
mov a,#'I'
lcall dw1
lcall delay

mov a,#0c0h
lcall cmdrt
lcall delay

mov r0,#41h
mov r7,#0bh
here7: inc r0
mov a,@r0
lcall dw1
lcall delay
djnz r7,here7
mov a,#'-'
lcall dw1
lcall delay

mov a,#'L'
lcall dw1
lcall delay

mov a,#'O'
lcall dw1
lcall delay

mov a,#'N'
lcall dw1
lcall delay

mov a,#'G'
lcall dw1
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay

ljmp loop23

dw1:
setb p2.0
lcall mdata

ret

cmdrt:
clr p2.0
lcall mdata
ret

mdata:mov p0,a
setb p2.1
nop
nop
nop
nop
nop
nop
nop
nop

clr p2.1
clr p2.0
ret

delay:mov r4,#70h
lpp2:mov r3,#0ffh

lpp1:djnz r3,lpp1
djnz r4,lpp2
ret


delay1:mov r4,#0ffh
lpp22:mov r3,#0ffh

lpp11:djnz r3,lpp11
djnz r4,lpp22
ret
write: db'RECEIVING$'

end


try this and convert this to C code, if you cannot understand i will send the C code
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top