Parallax GPS Module?
Parallax GPS Module?
Has anyone successfully gotten a Parallax GPS module to work with a Zbasic chip? I'm specifically interested in seeing if I can get the "AppMod" serial interface working correctly. That strikes me as a serious challenge since it's effectively a totally proprietary protocol as far as I can tell.
I saw some code posted by Don on an LCD display and thought maybe someone has similar code for one of those GPS units. Thanks!
-Jeff
I saw some code posted by Don on an LCD display and thought maybe someone has similar code for one of those GPS units. Thanks!
-Jeff
Re: Parallax GPS Module?
The software serial channels support a bi-directional half-duplex mode that is compatible with the AppMod interface. This mode is described in the discussion of DefineCom.everest wrote:That strikes me as a serious challenge since it's effectively a totally proprietary protocol as far as I can tell.
- Don Kinzer
On a related note, I picked up one of these to play with. Although not the module you're working with, it's worth investigating if you're in the market for an inexpensive GPS module. As I type, the unit is sitting on my desk, a few feet away from the nearest window, with a solid 3D fix, talking TTL serial NMEA to a ZX24n. Setup was a no-brainer using any number of SiRF utilities available (and I'm not even using a windoze machine).
For $35, I don't think this thing can be beat. If my code worked as well as the GPS module, I'd be a happy camper.
-Don
For $35, I don't think this thing can be beat. If my code worked as well as the GPS module, I'd be a happy camper.
-Don
Yea, those look nice! They weren't available when I bought mine though. I'm really struggling with serial communications, ergh. I understand the basic concepts but I never seem to get anything in the input buffer from my unit....commands must not be going properly or something. I'll try just grabbing NMEA strings next....seems more straightforward!
-Jeff
-Jeff
In my experience, baud rate and/or protocol mismatch has been the biggest hurdle when it comes to getting serial port communications to work. Before you attempt to interface a serial anything with your micro, connect the device directly to your PC and try to get valid data that way, perhaps using Hyperterminal or something similar. If you can get it to work there, then at least you know the serial port settings to use when you start interfacing with your micro-controller.everest wrote:I'm really struggling with serial communications,...
-Don
Great idea!! Thanks!! I'm totally in love with the ZBasic platform, but I have to say, I miss the vast archives of read-to-run code that I could tap into with PBasic and even Arduino.
Someone should collect up all the samples that are known to run/work on given chips, sensors, etc. and make an archive. That would be crazy useful and much easier than searching the forums.
On the other hand I get to learn a lot more this way
-Jeff
Someone should collect up all the samples that are known to run/work on given chips, sensors, etc. and make an archive. That would be crazy useful and much easier than searching the forums.
On the other hand I get to learn a lot more this way
-Jeff
o I'm giving this another try, and I'm hoping for some supplemental help on the DefineCOM function. I need to set up a single duplex TTL serial I/O line with the following characteristics:
4800bps
8 data bits
no parity
1 stop bit
non-inverted
Those almost map against the system library documentation for DefineCOM, I'm sure I need:
8 data bit bussed mode - &H0c
No parity - &H00
Non-Inverted - &H00
I think that translates into &B00001100 according to the table in the system reference?
So I was thiking someting like this:
I'm still not talking to my module with my ZX24r. . .what's wrong with this set-up? Shouldn't that do what's indicated?
-Jeff
4800bps
8 data bits
no parity
1 stop bit
non-inverted
Those almost map against the system library documentation for DefineCOM, I'm sure I need:
8 data bit bussed mode - &H0c
No parity - &H00
Non-Inverted - &H00
I think that translates into &B00001100 according to the table in the system reference?
So I was thiking someting like this:
Code: Select all
Call DefineCom(3, 11, 11, &B00001100, 1)
Call OpenCom(3, 4800, inQueue, outQueue)
-Jeff
Hi Don,
I figured it out. . .I was doing something that's not legal I suppose:
That doesn't work at all. . .
This works just perfectly though:
-Jeff
I figured it out. . .I was doing something that's not legal I suppose:
Code: Select all
Call PutQueueStr (outQueue, "!GPS" & &H01)
That doesn't work at all. . .
This works just perfectly though:
Code: Select all
Call PutQueueStr (outQueue, "!GPS")
Call PutQueueByte (outQueue, &H01)
It's definitely legal; it just doesn't do what you want. The problem is that the concatenation operator performs automatic type conversion, if necessary, so that both operands are of String type. Consequently, what you wrote is equivalent to:everest wrote:I was doing something that's not legal I suppose:
Code: Select all
Call PutQueueStr (outQueue, "!GPS" & CStr(&H01))
Code: Select all
Call PutQueueStr (txQueue, "!GPS" & "1")
Code: Select all
Call PutQueueStr (outQueue, "!GPS" & Chr(&H01))
- Don Kinzer
The original releases of ZBasic would emit an error message if either of the operands to the concatenation operator were not strings. This was changed some time ago for improved compatibility with Visual Basic which supports automatic value-to-string conversion with the & concatenation operator. Note, however, that you can also use the + operator to concatenate strings and it will not perform automatic value-to-string conversion. Consequently, this code fragment will elicit an error message:everest wrote:so amazingly a command intended to deal with strings, tends to deal with all it's data options as. . . .well. . .strings.
Code: Select all
Call PutQueueStr (txQueue, "!GPS" + &H01)
- Don Kinzer