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.

RCB-4H GPS module interface with PIC 16F877A

Status
Not open for further replies.

soneal

Newbie level 3
Joined
May 9, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
GPS and PIC 16F877A

Hi everyone.
I need some help.my final year project is about a velocity meter with GPS module.
I have GPS module (u-blox RCB-4H) ,PIC 16F877A and LCD display.
Firstly how can i interface the PIC and GPS module? Should i put something between them while interfacing?
Then, any code example do you have?.
I am new about this equipment and please help me or any adveice as soon as possible. because my time is restricted :S
Thank you.
(I add the datasheet of RCB-4H GPS module)
 

Just Simply connect TX of GPS RCVR to RX of Microcontroller. And for time Tick accuracy connect GPS TP to interrupt pin of Microcontroller
 

thank you so much noorpuri
then i have interface the PIC with LCD display.do i need any circuit connection between PIC and LCD?
 

Hi again :))
I had quited to work on this project but i am trying to do again now. I have made progress about circuit and code. However i need your help about with my code. I wrote this code in CCS C software. here it is:



#include <16F877A.h>
#fuses HS,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD
#device *=16 // This enables use of all RAM.
#use delay (clock=20000000)
#use fast_io(b)
#define use_portb_lcd TRUE
#include<lcd.c>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#use rs232(baud=9600, xmit=PIN_c6, rcv=PIN_c7, parity=N, bits=8, ERRORS)
#define BUFFER_SIZE 96

BYTE buffer[BUFFER_SIZE]; // implemented as a circular buffer

int comma = 0;
int dataLen;
int start, end, speedLen=0;
int i;
char speed[10];
char c;

short ReadSerial = 0;
short startok = 0;
int8 index,x;


double parseData() // this function parses the $GPVTG data strings to find the speed information
{
dataLen = strlen(buffer);
for (i=0; i<dataLen; i++)
{
if (buffer == ',')
comma++;
if (comma == 7)
{
i++;
start = i;
while (buffer != ',')
{
speedLen++;
i++;
}
end = i-1;
break;
}
}

for (i=start; i<=end; i++)
{
speed[i-start] = buffer;
}
speed = '\0';
return atof(speed);
}


#int_rda
void gps_isr()
{/// note this routine needs to as short as possible since it is called
/// for each char received from GPS

c=getc() ;

putc(c);
if (c=='$')
{
index = 0;
startok = 1;
}
buffer[index] = c;
index++;
if (index>BUFFER_SIZE)
{
index = 0;
}
if ((index>62) && (startok==1) && (buffer[3]=='V') && (buffer[4]=='T') && (buffer[5]=='G'))
{
startok=0;
disable_interrupts(int_rda);
readserial = 1;
}
}

#separate
void reset_serial()
{
ReadSerial = 0;
index = 0;
for(x=0;x<BUFFER_SIZE;x++) buffer[x]=' '; // reset input buffer
enable_interrupts(int_rda);
}


int main(){

setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED, 0, 1);
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_CCP1(CCP_OFF);
setup_CCP2(CCP_OFF);

enable_interrupts(GLOBAL);

reset_serial();

set_tris_b(0x00); // set the b port to the output



while(1)
{

if ( readserial == 1 )

{

lcd_init(); // initialize the lcd
lcd_send_byte(0,0x0d);
lcd_gotoxy(1,2);
printf(lcd_putc,"\f SPEED = %f",parseData());
delay_ms(1000);

reset_serial();

}

}
}
 

good evening everyone.
I need some help in my final year project GPS module.
I have GPS module (gps-310fs) ,PIC 16F877A and LCD display.
Firstly how can i interface the PIC and GPS module?
i need schematic design to connect gps with pic 16f877a
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top