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.

connection between 16F877A with GPS sensor module EB-85A

Status
Not open for further replies.

cokicoki

Newbie level 4
Joined
Feb 24, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
malaysia
Activity points
1,336
please...is there anybody have experience in this project...help me
 

hello...is there anybody experience in this...
i've try with this...but still nothing happen...:(...can somebody check it for me please

@ DEVICE HS_OSC,LVP_OFF,WDT_OFF,PROTECT_OFF
DEFINE OSC 20
DEFINE HSER_RCSTA 90H
DEFINE HSER_TXSTA 24H 'HIGH SPEED MODE BAUD RATE GENERATOR
DEFINE HSER_BAUD 38400
DEFINE HSER_SPBRG 38H '38400 BAUD *** THIS WORKS! ***
DEFINE HSER_SPBRGH 01H
'BAUDCON.3 = 1 'SETUP FOR HIGH SPEED.


include"modedefs.bas"

pcout var portc.6 'Output to pc
pcin var portc.7 'Input from pc
gpsin var portb.2 'gps input
gpsout var portb.1 'gps output

gps_dat var byte
a var byte
gps var byte

for a = 0 to 41
lookup a,["$PMTK314,1,1,1,1,1,5,1,1,1,1,1,1,0,1,1,1,1"],gps_dat


hSEROUT [hex gps_dat] 'send pmtk to gps"

next a


main:
serin gpsout,38400,10,cont,[gps]
cont:

SEROUT pcout,38400,[#gps] 'send nmea to pc
serout pcout,38400,["+",13]
goto main
end
 

hmm.
seems u also do the similar project with me...
why don't you buy the gps evaluation board...that one u can cnnect either with rs232 or USB as well..
 

ouh...is it right?...have u done your project?...can u share with me your coding...
i've already done it as well...
here my code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 32 ' 38400 Baud @ -1.36%
define HSER_BAUD 38400
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
define OSC 20

gpsin var portc.7 'rx
gpsout var portc.6 'tx


HH VAR byte
MM VAR BYTE
SS VAR BYTE
ND VAR BYTE
NM VAR BYTE
NMD VAR WORD
WD VAR BYTE
WM VAR BYTE
WMD VAR WORD
AR VAR BYTE[20]

START:
SERIN2 gpsin,16572,[WAIT("$GPGGA"),WAIT(","),DEC2 hH,DEC2 mM,DEC2 sS,_
WAIT(","),DEC2 ND,DEC2 NM,WAIT("."),DEC3 NMD,WAIT(",N,"),_
DEC3 WD,DEC2 WM,WAIT("."),DEC3 WMD]

PAUSE 1000

SEROUT2 gpsin,16572,[DEC2 HH,DEC2 MM,DEC2 SS,_
DEC2 ND,DEC2 NM,DEC3 NMD,DEC3 WD,DEC2 WM,DEC3 WMD,13,10]


goto START
end

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
how about u?...can u share it with me yours...thanks
 

hmm...
i haven't finish yet this project...seems i also have problem display the data in lcd....but i can share with you the source code...
about ur program..what language you used to compile...because i'm not familiar with your program..

>>>> my program >>>>


#include <16f877a.h>
#include <stdlib.h>
#include <math.h>
#use delay(clock=20000000)
#define use_portb_lcd TRUE
#include <lcd.c>
#fuses hs,noprotect,nowdt,nolvp
#use rs232(baud=38400,rcv=pin_c7, xmit=pin_c6,parity=n)//gps only needs the rx and gnd pin
#define round(x,n) (floor(x*(10.0^n)+0.49)/(10.0^n)))

#byte porta=5
#byte portb=6

void get_fix();
void store_waypoint(long position);
void load_waypoint (long position);
void write_float (long location, float store_float);
float read_float (long location);
float round_float (float temp_float, int8 n);

int8 good_fix;
char gps_str[53],temp_str[8];
int8 count=0;
long gps_count=0;
int8 rcv_chr;
float alt_float;
float lat_float;
float log_float;
float init_alt_float;
float init_lat_float;
float init_log_float;
float d_alt;
float d_lat;
float d_log;
float distance;
long temp_long=0;
float temp_float=0;
//int pb_1;


void main(){

lcd_init();
printf (lcd_putc,"\f perghh bapak lame");
//output_high (pin_a3);
while (true){
good_fix=false;
gps_count++;
get_fix();
//if (!input(pb_1)){
printf (lcd_putc,"\fwaypoint");
printf (lcd_putc,"\nstored");
store_waypoint(1);
load_waypoint (1);
// }


d_alt = alt_float - init_alt_float;
d_lat = (lat_float - init_lat_float)*1849.679;
d_log = (log_float - init_log_float)*1480.284;

distance= sqrt ( (d_lat*d_lat) +(d_log*d_log));
printf(lcd_putc,"\fD=%4.2f",distance);
printf(lcd_putc,"\nA=%4.2f",d_alt);
temp_long=0;
temp_long = (lat_float*1000);
lat_float = temp_long;
lat_float /=1000;
printf(lcd_putc,"\f%f",lat_float);
printf(lcd_putc,"\n%lu",temp_long);

if (distance>5){
//output_high (pin_a3);
printf("Moving");
}
else{
//output_low (pin_a3);
printf("Stop");
}

}
}

void get_fix(){
while (!good_fix){
rcv_chr=getc();
if (rcv_chr=='$'){
rcv_chr=getc();
if (rcv_chr=='G'){
rcv_chr=getc();
if (rcv_chr=='P'){
rcv_chr=getc();
if (rcv_chr=='G'){
rcv_chr=getc();
if (rcv_chr=='G'){
rcv_chr=getc();
if (rcv_chr=='A'){
rcv_chr=getc();
if (rcv_chr==','){
for (count=0;count<53;count++){
gps_str[count]=getc();
}
for (count=0;count<7;count++){
temp_str[count]=gps_str[13+count];
}
lat_float=atof(temp_str);

for (count=0;count<7;count++){
temp_str[count]=gps_str[26+count];
}
log_float=atof(temp_str);

for (count=0;count<7;count++){
temp_str[count]=gps_str[45+count];
}
alt_float=atof(temp_str);
good_fix=true;
}
}
}
}
}
}
}
}
}



float read_float (long location){
float store_float;
int8 *pointer;
int8 position;
pointer=&store_float;
for (position =0; position<4; position++){
*(pointer+position)=read_eeprom((4*location)+position);
}
return store_float;
}


void write_float (long location, float store_float){
int8 position;
int8 *pointer;
pointer=&store_float;
for (position =0; position<4; position++){
write_eeprom ((4*location)+position, *(pointer+position));
}
}


void store_waypoint(long int position){
write_float (4*position, alt_float);
write_float ((4*position)+4, lat_float);
write_float ((4*position)+8, log_float);
}


void load_waypoint (long int position){
init_alt_float = read_float (4*position);
init_lat_float = read_float ((4*position)+4);
init_log_float = read_float ((4*position)+8);
}
 

ouh...seem like i also not familiar with yours too...:|
i'm using microcode studio to compile it..using c language..
and used pickit to load it to pic16f877a...
 

hmm...
i'm using pcw c as my compiler to compile that program..
u are from malaysia right??..
which state are u??
 

yes i'm...
i'm from selangor...but i'm study at penang...:)
 

Hey u two, i am doing the same project as well, I am using EB-85A connecting it with the GPS Eval board to the PIC 16F877A. Well i am receiving the NMEA data but i am having a pinch in starting the coding to decipher the Code into readable data.

I am from penang. Can i add u two as well?
 

hmm.
seems we do the same project with same device..haha.
yup sure you can add me as well swe can discuss together and share source code..what compiler u used to debug the program..
do you refer any other source code???..
if yes..can you share with us...
 

Syamia, nice to meet u. I am using MBlab ide to do the software. Well i dont have any source code with me right now. I can get the nmea data from the gps and now i have figure out how to get decipher her lat long from the code. Yea i will be sure to add u xD
 

i already attach my source code in this topic..
but still can't get any data from gps..
i use pcw-c compiler..means that i'm using c program instead of assembly program...but i salute you coz u use assembly language as your program..hahaha..
so how's your projecit going on??....
have you solve anything ???
 

Insane if i am using assembly language.

Well i am now, gonna try to display the nmea code on my lcd first through the usart. After thats done, then i am gonna work on the code, using C language.

Added after 2 minutes:

I am thinking of using the switch case function for the nmea code. But i need to figure out how to make the ',' as the stop to recognise the GP*** .
 

haha..yup..
do yo have email.
so we can discuss this together..
derisghafar@yahoo.co.uk..
i use that code..
but still can't figure it how to get the gp***...
have you done anything with that??
 

Tell u wat, tonight get ready i am gonna create a yahoo acc and meet u there. Aight?
 

could any body tell me how to interface pic16f877a with lm35 and 3 seven segment to display
my problem is in the source code in mikroc

plz help
 

ok.
already received your email account in my ym...
so usually what time ae you free to discuss this??..

dahroug : u have to check every connection in seven segment...have you done tht??
 

it isn't the connections but the source code
how to make the read out in three digits from portB only??
i may upload the deign by proteus if u have time
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top