+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Newbie level 3
    Points: 523, Level: 4

    Join Date
    May 2010
    Posts
    3
    Helped
    0 / 0
    Points
    523
    Level
    4

    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)

    •   Alt9th May 2010, 17:28

      advertising

        
       

  2. #2
    Junior Member level 3
    Points: 1,847, Level: 9
    Achievements:
    7 years registered

    Join Date
    Jun 2006
    Posts
    25
    Helped
    0 / 0
    Points
    1,847
    Level
    9

    Re: RCB-4H GPS module interface with PIC 16F877A

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



    •   Alt11th May 2010, 20:15

      advertising

        
       

  3. #3
    Newbie level 3
    Points: 523, Level: 4

    Join Date
    May 2010
    Posts
    3
    Helped
    0 / 0
    Points
    523
    Level
    4

    RCB-4H GPS module interface with PIC 16F877A

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



    •   Alt11th May 2010, 23:30

      advertising

        
       

  4. #4
    Newbie level 3
    Points: 523, Level: 4

    Join Date
    May 2010
    Posts
    3
    Helped
    0 / 0
    Points
    523
    Level
    4

    Re: RCB-4H GPS module interface with PIC 16F877A

    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,NO DEBUG,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[i] == ',')
    comma++;
    if (comma == 7)
    {
    i++;
    start = i;
    while (buffer[i] != ',')
    {
    speedLen++;
    i++;
    }
    end = i-1;
    break;
    }
    }

    for (i=start; i<=end; i++)
    {
    speed[i-start] = buffer[i];
    }
    speed[i] = '\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();

    }

    }
    }



  5. #5
    Newbie level 3
    Points: 532, Level: 4

    Join Date
    Jan 2010
    Location
    jordan
    Posts
    4
    Helped
    1 / 1
    Points
    532
    Level
    4

    Re: RCB-4H GPS module interface with PIC 16F877A

    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


    1 members found this post helpful.

--[[ ]]--