Hi tumbleweed,
that was the typo mistake really. Now it works. thanks a lot.
I was stuck for a day! Now i can move forward to the next target.
Really appreciate your help.
Hi tumbleweed,
that was the typo mistake really. Now it works. thanks a lot.
I was stuck for a day! Now i can move forward to the next target.
Really appreciate your help.
Dear all,
as for the last step, changing the baudrate of the GPS on the fly, the same time as the PIC chip it self on PORT EUART 2, i've notice that not all the time the configuration work.
Sometimes the GPS doesn't get the command. I tried to see if i could get an ACK but couldn't see anything coming on RX.
Base on the manufacturer datasheet there should be a reply message for every command we send. But really didn't see any reply.
Is there anything i could do, to help the GPS to receive always the command and not "reject" it? Should i give more time at start up?
I have already place the following commands on the code in order to check if the GPS has successfully powered up.
Code:' -----------------------------------------------------------------------------| ' [ GPS Initialization ] | '------------------------------------------------------------------------------| ' When the GPS Module is POWERED ON, then the following sentenses are received. HSERIN2 [wait("PMTK011,MTKGPS*08")] HSERIN2 [wait("PMTK010,001*2E")] HSERIN2 [wait("PMTK010,002*2D")]
Last edited by astanapane; - 14th July 2018 at 23:00.
I agree with tumbleweeds thought, increasing baud rate to 38k cuts the time available to process that streamed data to one quarter of what was available at 9600 baud . its asking for trouble .I'd be amazed if those HSERIN2 commands in your main loop work reliably
what possible advantage are you seeking with the higher baud rate ?
there is great merit in sending data to the serial display as fast as possible but I have difficulty seeing any benefit in getting nmea data at higher speeds.
now that you have a chip with adequate memory and horsepower why not use a buffer to store and process the sentences?
Warning I'm not a teacher
Hi Richard, to be honest i dont know the way to store and process the sentences , but i will search for it and come back with some question. First i will try to understand the concept.
Now at the moment i need to speed up the serial communication because i need to use to fastest refresh rate of NMEA data from GPS at 10Hz.
As from the manufacturer and datasheet of the GPS, if you need to go at 5Hz or 10Hz then you need at least to speed up the GPS communication rate at 38400.
The SERIN command inside the main look, do not have any issue. Only at the beginning of the initialization and changing the baudrate and refresh rate.
Apart from that everything else works fine at that rate. At the end of the project which may not be able to complete, i will not use the GPS at 10Hz.
Now i do some fancy test to see how fast the Speed on the Display can be refreshed. As you better understand than me, in order to achieve that, the GPS data must be at a very high rate and the serial communication as well. Actually is a simple speedometer.
Thanks once again all of you for your time and effort to help me.
Do you control power to the GPS?
The sequence of what to do depends on who powers up first. You probably shouldn't assume that the mcu is powered up and initialized before the GPS. It would be good to know how long the GPS takes to powerup and start sending those initial strings.
The sequence might look something like:
- wait several seconds at powerup for the GPS to initialize
leave the uart set for 9600 baud
You'll likely miss any initial serial transmissions that the GPS sends you, but that's ok.
- send a string to the GPS that you know the response for, and wait for that response with a timeout.
The simpler the better... a single response that's easy to parse would work a lot better than a sequence of responses.
loop doing this until you have sync with the GPS.
- now you can switch to 38400
Hi tumbleweed,
i think i could control the GPS module via Enable pin.
The GPS based on the datasheet, powerup and start sending commands after the following PMTKs.
I guess that by using the above code, i wait for each of this commands, and the program only continues if those PMKT sentences from GPS has been received and read. Is that right?Code:' -----------------------------------------------------------------------------| ' [ GPS Initialization ] | '------------------------------------------------------------------------------| ' When the GPS Module is POWERED ON, then the following sentenses are received. HSERIN2 [wait("PMTK011,MTKGPS*08")] HSERIN2 [wait("PMTK010,001*2E")] HSERIN2 [wait("PMTK010,002*2D")]
May i use a timeout in there?
Does the Enable act like a reset? Do you have a link to the datasheet?i think i could control the GPS module via Enable pin.
Maybe you could keep the GPS disabled until the main uC powers up and is ready...
Bookmarks