EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Problem in program while interfacing with pic16f877a and gps (634r) skytraq

Problem in program while interfacing with pic16f877a and gps (634r) skytraq

|

Microcontroller › PIC › Problem in program while interfacing with pic16f877a and gps (634r) skytraq

  • This topic has 0 replies, 1 voice, and was last updated 11 years, 10 months ago by pradeep.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • March 21, 2014 at 2:13 pm #2965
    pradeep
    Participant

    our motive is to receive longitude and latitude from the gps ($GPGGA) and store them in an array of microcontroller 16f877a..

     

     

    I used LED in ports to find whether tthe data is received or not.

     

    because i do not have lcd to c the output of gps….. bt i c them in PUTTY software…

     

    i can see indication that i receive $ sign

     

    the program does not  work further r no other indication seen….

     

     

    Tell if any mistake is there in our program and try to correct it  and help me out..

     

    (our program is given below)::: [program written in HIGH TECH C COMPILER]…..

     

     

    #include<pic.h>
    #include<string.h>
    __CONFIG( HS & WDTDIS & BOREN & LVPDIS );
     
    static bit OO@((unsigned )&PORTB*8+1);
    static bit KK@((unsigned )&PORTB*8+2);
    static bit EE@((unsigned )&PORTB*8+3);
    static bit II@((unsigned )&PORTB*8+7);
    void delay(unsigned int y)//delay prg
    {
    while(y–);
    }
     
    unsigned char a=0,data;
     unsigned char lat[15],lon[15],i,j,ch,gps[10];
     
    unsigned char UART_Getc()
    {
        while(RCIF == 0);              
        return RCREG;
    }
     
     
     void interrupt ISR(void) 
     { 
          if(RCIF == 1) 
         { 
     
     
    data=UART_Getc();
    RCIF==0;
    }
         } 
     
    void GPS_Status()
    {
     // delay(100);
        
            do
            {
        }while(data != ‘$’);
    OO=1;     //this LED GLOWS WHEN I switch on GPS  i.e we receive $ sign
     
    i = 0;
     do
            {
                gps[i++] =data;
            }while(gps[i-1] != ‘,’);
                gps[i-1] = 0;
     
     
     if(strcmp(“GPGGA”,gps) == 0)
            {
     
    KK=1;
     
     
     
     do
                {
                    ch =data;
                }while(ch != ‘,’);
        
                i = 0;
    EE=1;
                for(j=0;j<2;j++)
                {
                    do
                    {
                        lat[i++] =data;
                    }while(lat[i-1] != ‘,’);
                }
                    lat[i-1] = 0;
     
                i = 0;
        
                for(j=0;j<2;j++)
                {
                    do
                    {
                        lon[i++] =data;
                    }while(lon[i-1] = ‘,’);
                }
     
                    lon[i-1] = 0;
     
     
    }
     
    }
    void main()
    {
    TRISC=0XFF;
    TRISB=0X00;
    TXSTA=0X24;
    RCSTA=0X90;
    PORTB=0X00;
     
    SPBRG=25;
    BRGH=1;
    GIE=1;
    PEIE=1;
    RCIE=1;
    TRISD=0X00;
     
    while(1)
    {
     
    GPS_Status();
     
    delay(10000);
     
    while(1);
    }
    }
     

     

     

     

     

     

     

     

     

     

     

     

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • ANOTHER OLD PROJECT REDO February 9, 2026
  • Buffer design? February 9, 2026
  • BPF February 9, 2026
  • To couple or decouple February 9, 2026
  • Op amp shock February 9, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise