
Originally Posted by
tumbleweed
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.
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")]
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?
May i use a timeout in there?
Bookmarks