Parallax GPS Module in SmartMode with the propstick
fish
Posts: 55
Greetings,
I have implemented Extended_FDSerial to read the gps module in Raw mode, but I would much rather take advantage of the smartmode to cut down on the parsing code and save some memory.
I can't find anywhere in this forum where someone has successfully gotten the propeller to talk to the gps module in Smart mode.
The module has a single·SIO pin and FullDuplexSerial does not seem to work when txpin and·rxpin are the same, but I don't know how else to get around it.
I have tried two fullduplexserial objects with one txing and one rxing but that didn't work.
Has anyone been able to get the gps mod to work in smart mode with the propeller?
Thank you for any help you can give me!
fish
I have implemented Extended_FDSerial to read the gps module in Raw mode, but I would much rather take advantage of the smartmode to cut down on the parsing code and save some memory.
I can't find anywhere in this forum where someone has successfully gotten the propeller to talk to the gps module in Smart mode.
The module has a single·SIO pin and FullDuplexSerial does not seem to work when txpin and·rxpin are the same, but I don't know how else to get around it.
I have tried two fullduplexserial objects with one txing and one rxing but that didn't work.
Has anyone been able to get the gps mod to work in smart mode with the propeller?
Thank you for any help you can give me!
fish
Comments
Like you, for me it works in raw mode but nothing in smart mode.
Seems like nobody can get it to work in smart mode with the prop (or at least nobody says they have), which is kind of strange I think. There must be a way.
Even with a level shifter, it still doesn't respond. I am not brainfull enough I guess.
dunno.
Have you tried two diodes in series with this circuit instead of the one? If that doesn't work let me know and I will look into it.
http://forums.parallax.com/attachment.php?attachmentid=45710
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Hope this helps,
Craig
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
fish
·I·get an echo of the transmission. e.g. !GPS. Maybe·I need larger resistors (used 1k).
Haven't tried Beau's suggestion yet.
Beau,·do you mean·put a diode·from·the GPS gnd pin --|>--· to gnd like in the·attached pic?
thanks
No, don't touch the ground going to the GPS.
What I meant was... where there is a diode already for the Propeller place two instead.
---->|
becomes ---->|
>|
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Guys, no luck i'm afraid.
Here is my latest circuit and my testing code (each had many permutations).
Any ideas?
Propstick···························································· ·GPS
[noparse][[/noparse]16]
R1_1k
[noparse][[/noparse]SIO]
R3_10k----+5v (pullup) (tried with/without)
[noparse][[/noparse]17]
R2_1k
[noparse][[/noparse]SIO same pin as above]
[noparse][[/noparse]Vin]----+6V (use onboard voltage reg)·········· [noparse][[/noparse]Vdd]----+5v
[noparse][[/noparse]Gnd]--->|--->|--gnd································· ···[noparse][[/noparse]Gnd]
gnd
·································································· [noparse][[/noparse]/Raw] open (also tried pulling high)
(edited: forgot to show Raw pin)
...
obj
· sio : "FullDuplexSerial"
· debug : "ezterm" ' my ezlcd terminal
pub main
· if(debug.start(EZPWR_PIN,EZRX_PIN,EZTX_PIN,EZBAUD))
· · debug.outStr(string("Ready"),true)
· · start(16,17)
PUB start(rxpin,txpin)·
· sio.start(rxpin,txpin ,0,4800)
· sio.rxflush
· testIt
pub testIt
· sendCommand($04) 'get date
pri sendCommand(command)
· debug.strcat(string("tx..."))
· sio.str(string("!GPS"))
· sio.tx(command)
· 'waitcnt(clkfreq / 4 + cnt) ' tried with/without a·delay
· readRx
pri readRx | rx ' tried different variations of this.
··debug.outStr(string("rx..."),true)
··rx := -1
··repeat while rx <> 0
·· ·rx :=sio.rx
·· ·debug.char(rx)
··· debug.newline
Post Edited (fish) : 3/7/2007 4:29:27 AM GMT
Silly question, but I'd better ask... is your GPS unit getting a "lock"... is the RED led flashing or is it steady? If it is flashing, this indicates that it has not acquired enough satellites, and
you will not be able to communicate in the Smart mode.
I'm trying to squash a big bug at the moment on another project, If I get some time while the extraction tool is running on that, I will setup my GPS unit to see what I can come up with.
P.S.
can you also post the header portion of your code?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Not a silly question,·and yes solid red.
Here's the header I left off:
CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000
Absolutely, do what you have to do first. I appreciate the help.
fish
Do you have a Logic Probe, Logic Analyzer or Scope you can use to watch the I/O pin on the GPS when powered up? What I am wondering is if the device may be somehow in RAW mode and sending that data out continuously. Let me know. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Yes, I see a constant stream (every second) of NMEA data when /Raw pin is pulled low and nothing when /Raw pin is left open or pulled high.
Raw mode seems to work fine and the data is complete and consistant with documentation.
However, the gps module acts like it is deaf when I switch to Smart mode; all output stops, save the false 'echo' I see because my prop tx(16) an rx(17) pins share the gps sio pin.
fish
I looked back up in the thread and see you’re using the Full Duplex Serial object. For the GPS I would actually have used the simple serial object on the same I/O line. You issue the command, change the pin to an input and receive the response. I will see if I can set up some code to do this if you continue to have problems. You don’t have a BASIC Stamp to test the example code on, do you?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I changed to Simple_Serial (have this tried before also)
Here is my code and circuit i just tested it on.
I will try to find an old project in my archives (aging bot in my cluttered garage) and dust off a BS2 to try.
thx
[noparse][[/noparse]edited: formatting]
Propstick GPS
[noparse][[/noparse]16]
R1_1k
[noparse][[/noparse]SIO]
R2_10k----+5v (pullup) (tried with/without)
[noparse][[/noparse]Vin]----+6V (use onboard voltage reg)···········[noparse][[/noparse]Vdd]----+5v
[noparse][[/noparse]Gnd]--->|--->|--gnd·····································[noparse][[/noparse]Gnd]
gnd
····································································[noparse][[/noparse]/Raw] open (also tried pulling high)
CON
·_clkmode = xtal1 + pll16x
·_xinfreq = 5_000_000
·EZRX_PIN = 5
·EZTX_PIN = 7
·EZPWR_PIN = 1
·EZBAUD = 38400
obj
·sio : "Simple_Serial"
·debug : "ezterm" ' my ezlcd terminal
pub main
·if(debug.start(EZPWR_PIN,EZRX_PIN,EZTX_PIN,EZBAUD))
· debug.outStr(string("Ready"),true)
· start(16,16)
PUB start(rxpin,txpin)
·sio.start(rxpin,txpin ,4800)
·testIt
pri testIt
·repeat
· ·sendCommand($03) 'get time
· ·'waitcnt(clkfreq / 4 + cnt) 'need delay?
· ·readRx
· ·waitcnt(clkfreq + cnt) ' delay to slow down lcd output (easier to read)
pri sendCommand(command)
·debug.strcat(string("tx[noparse][[/noparse]"))
·debug.dec(command)
·debug.char("]")
·sio.str(string("!GPS"))
·sio.tx(command)
pri readRx | rx ' tried different variations of this.
·debug.strcat(string("rx"))
·rx := 0
·repeat·6 'for testing just grab·6 bytes of anything (or nothing)
···rx :=sio.rxtime(100)
···debug.char("[noparse][[/noparse]")
···debug.char(rx)
···debug.char("]")
·debug.newline
Post Edited (fish) : 3/7/2007 10:47:33 PM GMT
In your connection diagram you’re using 6V P/S for PropSTICK and 5V P/S for GPS. Not sure where these are coming from, but do they have a common ground?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Yep common ground. 1 power supply running·prop and another power supply running gps module thru 5v regulator.
And yes this GPS module DOES work in smart mode·with my stamp, same power setup, also works with onboard 5v source from stamp.
thx fish
Interesting…So it’s probably just a code/interface issue. If you’re not in a hurry I can test it this coming weekend. Right now I am trying to get two other projects wrapped, but this is definitely something that needs to be looked at. I could probably test it Saturday around noon. If anything else comes up before then I will keep my eyes on it. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Very cool, thanks Chris.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"any small object, accidentally dropped, goes and hides behind a larger object."
·
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
http://ALIBE.crosscity.com/
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
·· I did not forget you…I actually lacked some hardware until today…In any event I got everything together today and although I did not use the PropSTICK (I used the Propeller Demo Board) it should work just the same. I connected the GPS VCC line to the 5V line on the Demo Board, GND to VSS, SIO to P0 (through a 1K resistor) and /RAW unconnected. The attached code works to read the hardware and firmware versions from the GPS and proves that only a single 1K resistor is required to interface to the Propeller. One thing to keep in mind is the high current requirement of the GPS Module. Depending on how you’re powering it the GPS may not be getting enough current.
·· The code uses the Full Duplex Serial Object as well as the TV Terminal Object. Thanks to David Carrier for refreshing my memory and helping me get everything running. I hadn’t written code in so long I felt like I’d forgotten more than I remembered. In any event please let us know if this works for you. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thank you for solving this problem, I have been using a stamp and a prop to accomplish this task.
Maybe you could help me with this problem: I am trying to plot my GPS data on a 20" LCD monitor,
resolution 800 X 600. I need a VGA graphics driver to plot each pixel. The best I can find on the
Form is a 512 X 384 bitmap. Does Chip have a pixel driver for 800 X 600.
Thanks, Jim
I am not aware of such an object/driver…As I mentioned above I haven’t been doing much Propeller Code since we have an abundant source of that. My focus recently has been on the BASIC Stamps and SX Microcontrollers. As I find more time to write Propeller Code I will get caught up but for now my only other object contribution is the PING))) object in the Library/Demos in the Propeller Tool. Paul Baker would know more about available graphics objects. Or you could check the Hydra Forum to see if Andre has tackled that resolution. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I really appreciate the effort you have put into this.
I have the gps mod hooked up to the propstick with a 1k resistor to p0 and your code but my results are not the same unfortunately. I get E0. (for every command)
I have made the circuit setup as simple and as clean as possible; complete continuity thoughout. I all looks good to me.
The only logical thing left that could be wrong like you said is my power source.
I have tried a 9v bat to my 7805A 5v regulator and tried two different 5v power supplies (200ma and 300ma) and get the same E0 results.
Yet the gps mod works fine in Smart mode with the stamp using Stamp's 5v regulated vout.
Which brings up another thought; if this gps module works in Raw mode with (with the Propstick, with same 5v regulated power source as above) then if the lack of current theory is true then the Smart mode must require more current.
Is this because the gps mod's on board propeller is doing the parsing whilst the Raw mode need less because it is straight off the receiver's feed? (total speculation)
Anyway, I think at this point I will have to just use it in Raw mode [noparse]:grumbles:[/noparse] and take the memory hit.
I still yet may try using the stamp's 5v out (since I know it works off of it) yet route the gps mod's SIO to the prop's p0 (with common gnds) in a final last ditch effort to eliminate the power source as the issue.
Thanks again
fish
Post Edited (fish) : 3/15/2007 5:54:18 PM GMT
The "Smart mode" requires that you send it information in order for the GPS to know what to send back to you.
In "RAW mode", the GPS simply streams the data as it receives it from the satellites.
It's purely the 3.3V logic HIGH that the Propeller is capable of generating competing against an expected 4V threshold level from the GPS.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I did the Chris GPS solution with my prop demo board, using PC_Debug and the Stamp V2.2
Debug terminal.......... it worked fine. Advice: replace the prop stick or the GPS module or both.
Jim
[noparse][[/noparse]Edit] - I wonder...Can you take a clear picture of your setup?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Tried all io pins, same result.
Here is a few pics of my testing circuit.
It really couldn't be much simpler.
I have a 7v power supply to the prop and a 9v bat to a 5v reg (new just replaced to be sure) to the gps mod.
Note the gps plug end near the 5v regulator is pulled out a tad just to show the pins more clearly.
The only ray of hope is see here is that Smart mode works great with my Stamp!
(raw mode works fine on both prop and stamp as stated earlier).
fish