You need an inverter chip or circuit . (MAX232)
You need an inverter chip or circuit . (MAX232)
Dave
Always wear safety glasses while programming.
Thanks Dave,
The MAX232 in my drawer did the trick
Any idea about the checksum calculation?
This is what I did up to now in EXCEL but trying to convert HEX to BIN will rise an error.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4178&stc=1&d=127089284 5">
Roger
10001000000
is the number excel failed on but other than that I do not know. I will have to look into it.
Dave
Always wear safety glasses while programming.
Here is one check sum solution for gps:
Code:gpsdata var byte[82] ' Max length of a GPS sentence is 82 bytes. DoCS: i = 0 ' Initialize the position counter WHILE gpsdata[i] != "*" ' Count everthing until the * cs = cs ^gpsdata[i] ' XOR for checksum i = i + 1 ' Increment position counter WEND ' A quick and easy atoh function ' Make it a seperate label if we add more atoh conversions in the future LOOKDOWN gpsdata[i+1],["0123456789ABCDEF"],tempbyte gpscs = tempbyte * 16 LOOKDOWN gpsdata[i+2],["0123456789ABCDEF"],tempbyte gpscs = gpscs + tempbyte ' Flag bad data "V" if checksum doesn't add up. ' Or if the sentence is less then 20 chars long ' Which means there is no active waypoint to go to. ' Should be "A" otherwise. IF (cs != gpscs) OR (i < 20 )THEN gpsvalid = 0 ELSE gpsvalid = 1 ENDIF RETURN
Last edited by ScaleRobotics; - 10th April 2010 at 14:26.
- Reading & parsing NMEA sentences is ok;
- Calculating checksum is ok;
- Sending data to GPS module is not ok.
I have connected the GPS module via the MAX232 chip to my serial PC port both ways so I should be able to "talk" to my module.
Unfortunately, only reading out (receiving) the GPS module is working.
I checked the MAX chip with my oscillo and the signals are okay (TX & RX) on both levels (RS232 and TTL).
I'm sending an example from the module's datasheet to enable a VTG sentence but it won't work.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4205&stc=1&d=127141338 1">
I just never see this VTG data appear.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4207&stc=1&d=127141381 2">
Any idea?
Roger
Strange....
I just restarted the terminal and... it works now - I can sent messages to the module.
Must be a kind of magic (?)
Roger
Bookmarks