CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

problem with ublox gps
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



Joined: 01 Jul 2010
Posts: 9108
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jun 22, 2014 5:58 am     Reply with quote

step back a bit and confirm, using a simple test program that you CAN read and display the RAW GPS data WITHOUT ANY 'parsing'.

You have 2 sources for your problem.
1) you're NOT reading the GPS ...
or
2) your parsing routine is faulty

so

break it down and confirm the reading of GPS does work first, then debug the parser routine.

hth
jay
andys



Joined: 23 Oct 2006
Posts: 175

View user's profile Send private message

problem with ublox gps
PostPosted: Sun Jun 22, 2014 6:39 am     Reply with quote

I have already check this and the problem is comming from the parser.

BUT i don't understand why the parser is faulty.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Tue Jun 24, 2014 2:26 pm     Reply with quote

Hi andys,

As I mentioned, I've wanted to play around with the GPS GPRMC message parser in the Code Library for some time. I have my own generic NMEA message parser that I've used for some years, but I've wanted to try this other approach. In ten minutes, I copied the parser code from the library to a new module in my project directory, and modified my own main program to reference and use the new parser. It worked like a champ on the first try. Please see a snippet of the output below:

Quote:

Time: 20:20:7
Date: 24/6/14
Latitude: 4150.13 N
Longitude: 7214.92 W
Speed: 0.41 knots


Looking at your code, I've noticed that you've modified the library code in a number of key ways. I haven't tried your code yet, but before I dig into that exercise, can you tell me the reason for the modifications? Was there something that the library code wasn't doing that you needed? Did you ever get the unmodified version to work as posted in the Code Library?

You noted that your 'test' GPRMC sentence will work with eparser, but the actual GPRMC data received from the GPS does not. Have you done a careful comparison between the data that works, and the data that fails?

John
tatoo



Joined: 26 Aug 2014
Posts: 11

View user's profile Send private message

problem with ublox gps
PostPosted: Thu Aug 28, 2014 12:48 pm     Reply with quote

I used the code from here (for the GPS) without the parser code (for the same pic and gps module).

but instead of data, i receive only garbage. The code which i use is presenting below:

Code:

#include <33fj128GP802.h>
#include <string.h>
#include <stdlib.h>

#FUSES NOPROTECT     
#FUSES NOIESO       
#FUSES FRC             
#FUSES NOWDT           

#use delay(clock=7.37MHz)

#PIN_SELECT U1RX=PIN_B13
#PIN_SELECT U1TX=PIN_B12
#USE RS232(UART1,ERRORS,BAUD=9600,STREAM=PC)

#PIN_SELECT U2TX=PIN_B2
#PIN_SELECT U2RX=PIN_B3
#USE RS232(UART2,ERRORS,BAUD=9600,STREAM=GPS)

char GPSData[128];
int1 GPSDataReady = FALSE;


#INT_RDA2
void RDA_isr(void)
{
   static unsigned int8 GPSDataPtr=0;
   char c;
   c = fgetc(GPS); //must use streams
   switch (c)
   {
      case '$':
         GPSDataPtr = 1;
         GPSData[0] = '$';
      break;
     
      case '\n':
         GPSData[GPSDataPtr] = '\0';
         GPSDataPtr = 0;
         GPSDataReady = TRUE;
      break;
     
      default:
         GPSData[GPSDataPtr++ & 0x7F] = c;
      break;
   }
}
void main(void)
{
   GPRMCInfo MyGPRMCInfo;
   enable_interrupts(INTR_GLOBAL);
   enable_interrupts(INT_RDA2);

  while(TRUE)
   {

if (GPSDataReady)
      {
       
fprintf(PC,"RESULTS%s\n",GPSData);
         GPSDataReady = FALSE;
      }
 }
}
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu Aug 28, 2014 1:18 pm     Reply with quote

Hi,

Hmmm, so you just happen to have selected the exact same PIC, and the exact same GPS as the OP??? Quite a coincidence Very Happy

Well, I'm not sure how you can really say that you are using the 'same GPS', as the OP never *really* posted any data on the actual GPS board he was using. He told us the GPS module was a 'Ublox Neo 6', but that is just the naked GPS engine. Surely, the actual module he was using was a board that had this GPS engine on it, but other stuff as well?? We never got that information from the OP. Can you please post a link to the actual GPS module you are using???

John
tatoo



Joined: 26 Aug 2014
Posts: 11

View user's profile Send private message

problem with ublox gps
PostPosted: Thu Aug 28, 2014 2:40 pm     Reply with quote

Actually i asked him (via private message ) about few details. The gps is the same (ublox NEO-6M) at different PCB. (The PCB module which i use include also an sd card holder).

I chose the same pic and gps (with the thread) to save time.


Anyway can anyone explain why i can not receive any useful information ?
I would think that the problem is the baud rate but the same baud rate is used at this thread and is fine. Any suggestions?
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu Aug 28, 2014 3:02 pm     Reply with quote

Hi,

Yes, I do have a suggestion: do not ignore direct questions from people that are stepping forward to try to help you.... What I mean is I asked you to post a link to your GPS 'PCB module', but you ignored this question. If you don't cooperate with the troubleshooting process then the likelihood of solving your problem, and keeping the interest of the forum, is quite low.....

John
tatoo



Joined: 26 Aug 2014
Posts: 11

View user's profile Send private message

problem with ublox gps
PostPosted: Thu Aug 28, 2014 4:14 pm     Reply with quote

I bought something like this :

[url]
http://www.ebay.com/itm/GPS-Shield-with-SD-Slot-Antenna-for-Arduino-NEO-6M/131265955830?_trksid=p2045573.c100033.m2042&_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D20131017132637%26meid%3D6d90603b076e417694efe708eedad4b5%26pid%3D100033%26prg%3D20131017132637%26rk%3D1%26rkt%3D4%26sd%3D131265955830
[/url]
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Aug 28, 2014 7:24 pm     Reply with quote

The documentation on that Ebay website is ambiguous. Different
documents refer to different versions of the Neo GPS chip. It's hard
to know what are the true specifications. Also, it didn't help that you
didn't post the exact website where you bought it, but just said
Quote:
I bought something like this :


But anyway, the Neo-6 data sheet says the UART baud rate defaults
to 9600. You tried that and it didn't work. But the Arduino GPS Shield
brochure says to use 38400. You could try that.

Also, the schematic shows Neo-5Q. The schematic shows this chip is
powered at +3.3v. What is the Vdd voltage on your PIC ? If it's 5 volts,
then 3.3v UART logic levels won't work with the hardware UART in the PIC.

For a work-around, you could switch to a software UART for the GPS.
Example:
Code:
#USE RS232(baud=9600,  xmit=PIN_B2, rcv=PIN_B3, FORCE_SW, stream=GPS)

This is only needed if your PIC is running at +5v and the Neo GPS chip
is running at+3.3v. If your PIC is at +3.3v then this doesn't apply.
jeremiah



Joined: 20 Jul 2010
Posts: 1317

View user's profile Send private message

PostPosted: Thu Aug 28, 2014 8:20 pm     Reply with quote

The default VCC of the majority of PCD type chips is 3.3v. There are some 5v options, but they tend to have lettering like FV instead of F or FJ. I don't work with PIC18 parts much, but something in the back of my head makes me remember them being the opposite convention.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Fri Aug 29, 2014 7:18 am     Reply with quote

Hi,

Clearly, the need for accurate representative data on the peripherals that you wish to interface to a PIC is imperative. No serious embedded designer would ever consider embarking on a project without such data. I suspect that any poster that can't/won't post a link to a datasheet actually doesn't have one available because they've made their purchase from some cheap (probably Chinese) on-line retailer who isn't big on documentation. In the end, how 'cheap' was it if you have to spend untold hours fiddling to get it to work, or it it never works as intended?

John
tatoo



Joined: 26 Aug 2014
Posts: 11

View user's profile Send private message

problem with ublox gps
PostPosted: Fri Aug 29, 2014 4:52 pm     Reply with quote

I replace the baud rate from 9600 to 38400.
Now i can see results but not all the necessary results.



the problem is that i can not receive the :
DATA:$GPRMC,......

which i need it.

Is this mean that the gps module is faulty ???
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

Re: problem with ublox gps
PostPosted: Fri Aug 29, 2014 5:54 pm     Reply with quote

tatoo wrote:
I replace the baud rate from 9600 to 38400.
Now i can see results but not all the necessary results.


Hi,

If you continue to speak to us in vague riddles then how are we supposed to help you?

You need to tell us clearly what you are receiving correctly, and what you are not receiving correctly. We are not mind readers.....

Why not show us the actual output from your PC?

John
tatoo



Joined: 26 Aug 2014
Posts: 11

View user's profile Send private message

problem with ublox gps
PostPosted: Fri Aug 29, 2014 6:19 pm     Reply with quote

As i said before the $GPRMC is missing.

I receive the:

DATA:$GPGSV,...
DATA:$GPVTG,,...
DATA:$GPGSV,...
DATA:$GPVTG,,...
DATA:$GPGSV,...
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Fri Aug 29, 2014 6:34 pm     Reply with quote

Hi,

Most GPS modules can be configured to send only the desired NMEA messages. The GPRMC message may be turned off? Read the manual to find the command to turn it on.

Seriously, you are receiving all those other messages, but you question whether your module is faulty???

John
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group