GPS SIM33EAU PN 28504
pilot0315
Posts: 910
in Propeller 1
Help please.
I have the new gps module and want to bump the baudrate. I need to send this string preferably in PropC.
Page 12 of the manual:
Example: $PMTK250,1,3,9600*14<CR><LF>
Appears that fdserial does not allow me to send the string:
// fdserial_txChar(str("$PMTK250,1,3,115200*14,13,10"));
I have the new gps module and want to bump the baudrate. I need to send this string preferably in PropC.
Page 12 of the manual:
Example: $PMTK250,1,3,9600*14<CR><LF>
Appears that fdserial does not allow me to send the string:
// fdserial_txChar(str("$PMTK250,1,3,115200*14,13,10"));
Comments
BTW... the baud rate is 9600 by default. As your example included that baud, I figure that's worth a mention in-case you thought the module was 4800 or something, and were trying to send your command at the wrong baud.
// fdserial_txChar(str("$PMTK250,1,3,115200*14,13,10"));
the 115200 is supposed to change the rate permanently to 115200.
Martin
Please see above post.
Thanks
might not keep the baud change after a powercycle... I don't think that option was enabled by the module supplier.
Either way, no harm to send the baud command at 9600 during your code init, then switch to 115200.
As for the txChar method, I'm not familiar with that. I only ever used dprint, and stuck with it as it worked first time. Does txChar accept a string ?
Mike
also one char at a time and see what happens.
Thanks to both
@iseries
@VonSzarvas
From the pdf, "The checksum is computed as the exclusive OR of all characters between the $ and * characters."
It looks to me like it should be $1C, which should be sent as the two values 31 43.
Also, the 13,10 are not part of the comma-separated string, but should follow the checksum as $0D$0A.
So your data to send would look like $PMTK250,1,3,115200*1C<CR><LF>
24 50 4D 54 4B 32 35 30 2C 31 2C 33 2C 31 31 35 32 30 30 2A 31 43 0D 0A
David
I need to send a string like in fullduplexserial but to the device.
PUB Str(stringPtr)
{{
Transmit a string of bytes
Parameters: stringPtr = the pointer address of the null-terminated string to be sent
return: none
example usage: serial.Str(@test_string)
expected outcome of example usage call: Transmits each byte of a string at the address some_string.
}}
repeat strsize(stringPtr)
Tx(byte[stringPtr++])
but to the device not the screen. Any ideas??
I'm not David Betz; I'm a different David B.
In spin, I've used FullDuplexSerial4port to talk with GPS, something like this:
VAR
p : "FullDuplexSerial4port"
p.init
p.AddPort(0, RXPIN, TXPIN, -1,-1,0,0,115200)
p.AddPort(1, SIRF_TX_OUT_PIN, SIRF_RX_IN_PIN, -1,-1,0,0,4800)
p.Start
sending to the terminal:
p.s(0, String("Hello world! "))
sending to GPS:
repeat strsize(stringPtr)
p.tx(1, byte[stringPtr++])
Don't forget that if your reconfiguration takes then you'll have to restart the GPS comms also as 115200.
David
Thanks I will try that.
@david b
Thanks for the help. This is the first time for me to work with fullduplexserial4port.
Please see attached and tell me did I get it correct. I am playing with fds4p right now and am a little confused.
The question is, since I have not sent strings like this, is how to setup the string. Plus I am learning fds4p.
Thanks
@"David B"
I ran the code and got these errors.
What am I missing?
Thanks
Peter,
Would you please take a look at this. I am attempting to change the baud rate so I can use this with the P2.
Thanks
In you constant part, you try to put a string.
You have to use data and build a byte array
You forgot to declare CR an LF
Zero @end is for terminating the string block
And I think use
Also tried to do it one at a time and got this error. See second code.
Thanks for the assist.
Martin
I mean ;
This build, but I can' test it
Will do the trick
On the first post you print
You have put the LF an CR inside the string part, so it sent asci 13 and 10.
=> On the end, you send $31; $33;$31;$30 and not $0D;$0A
And you can do the same with other serial.spin tools
and then you have to send carriage return and linefeed to tell the GPS "this is the end of the message!".
Those are asci code 13 and 10 or hex 0D and 0A
You have to learn Asci, HEX string Binary to understand wat you try to do.
Here's a sample program that works for me; it repeatedly switches my SIRF GPS receiver between 4800 and 9600 baud.
This code is not necessarily the best programming style, but it does work with my GPS receiver. You'll have to change the GPS port pins and change the configuration strings to what your receiver needs, but with that done, this code should calculate the checksum, send the data, reset the serial port to the changed rate, then display a few lines of the GPS messages to demonstrate correct operation.
There's a few seconds of my results in a comment at the end of the file.
David
I ran the code and it is asking for a subroutine.
I looked in fullduplexserial4port and do not see "r".
Which one is it looking for?
Thanks.
I generally only do code on the weekends. Studying your code now.
Tried it alas nojoy.
I will keep working on it.
PUB r(port)
tx(port,13)
Don't you need to send the configuration string PMTK250 that's specific to your device? PSRF100 is probably only used for my SIRF GPS receiver.
Tried it again with and without cr/lf in the string. Still not working.
I will keep trying.
You also mentioned that the code would display a couple of the strings. I don't see that in the code.
This is the first time for me to use fullduplexserial4port.
On line 68: repeat i from 1 to msgsize-2 ' checksum from after the "$" to before the "*"
referring to this:
sirf4800 byte "$PSRF100,1,4800,8,1,0*",0
Since my device is different:
sirf115200 byte "$PMTK250,1,3,115200,*14 " ,0
' sirf115200 byte "$PMTK250,1,3,115200,*14,13,10 " ,0
would I have to change that?
If you're not seeing messages when you first connect then that's the first thing to fix. Check your serial input pin, baud rate, whether the data should be inverted by the serial receiver library, there are many things that can go wrong.
You really should get the receiving working before trying to reset the sending baud rate because until you're receiving properly you won't know if you've reset the baud rate properly.
My GPS receiver doesn't need to have the input data inverted, but some might, so I've shown where that option would be set.
I've included some example input in the file, both before the receiver locked onto the satellites and afterwards.
I'm guessing that something like this should display messages from your receiver, if the input pin and the serial parameters are set properly. If your input pin is set properly and your receiver is powered, you'll likely see some characters on the terminal, even if the baud or invert state isn't right.
BTW I have been using GPS modules for a while. This snag is bugging me because I am using the P2 now and the serial program will not work at
9600 baud. My Prop C code works great at 9600. I purchased two of these so I can bump up the baud rate to use with the P2. BTW the P2 is great but
a big learning curve.
I don't understand why this device does not respond. I will try the next code, Thanks.
I used your first code and tested it with my PropC code. Great stuff at 9600, oh well.
Again thanks
Martin