PDA

View Full Version : Trouble getting gy-neo6mv2 serial data with RS232



achilles03
- 22nd August 2015, 04:41
I have a gy-neo6mv2 (ublox NEO 6M GPS) that's regulated to 3.3v. I'm planning on parsing the NMEA sentences with code, but wanted to get a sample of the data before it was hooked up to a pic. After hooking it up to an RS232 port on an older computer, it's clearly exporting data, but it's gibberish. I checked several baud rates and other parameter variations in the serial communications format, but it's still gibberish. As a test, I've hooked up a 16F628A regulated to 5v that's exporting at the same baud rate some ascii data, and it imports fine. Regulated to 3.3v, it still appears to import fine.

My question is: could the ublox voltage levels be lower than 3.3v and not be adequate to trigger the threshold for an RS232 serial connection? If that's not the likely problem, and other suggestions?

Thanks,
Dave

aerostar
- 22nd August 2015, 10:23
Remember your older computer Serial port has up to + and - 15 volts on the transmit lines, so if you have connected that to your Ublox receive line, then Ublox is probably damaged.

The receive line on the PC may not accept your Hi (3v) and low (GND Lo as valid signals, so you will get rubbish.

The default speed on your Ublox default 9600 8 n 1

I had a very quick scan of the Ublox, and cannot see whether the serial out is serial TTL, (mark=HI, Space=Lo) or whether it is RS232 TTL, (Mark=Lo, Space=Hi)

If it is Serial TTL then you need a MAX2332 or similar circuit to connect to the PC.

Had another look around and I think the serial is TTL, so you would need a level converter to connect to PC.

If you are connecting to uart on pic, would suggest you run pic at 3V.

If your Pic that exports to the PC is not using the onboard uart and you are just using serout or serout2, are you setting it as inverted as that is what the PC needs?

Charlie
- 22nd August 2015, 13:30
I have not used this specific device, but if it's outputting true NEMA, then it should be 4800 (8 N 1).

achilles03
- 22nd August 2015, 14:09
Thanks for the responses...

I haven't connected the computer to the GPS rx pin, so that shouldn't be damaged. And I misspoke when I said I had connected the module to an RS-232 port... it's a serial port on a 10+ year old computer using windows 98 (I keep it around cause it works with the parallel port ePIC programmer I have and runs the 32bit PBP compiler I use... mainly cause I'm cheap and it ain't broke).

The terminal program I use has the option of inverting the data, which I've tried along with several other baud, parity, and stop bit permutations. The garble changes, and I can tell there's consistent exported data behind the garble (lots of repeating characters), but nothing that looks intelligible.

Do I need a pull-up resistor in the connection? Or could it be the logic levels obtained by the gy-new6mv2 module aren't quite high enough? Or could I use a pic as a middle-man between the module and the computer? The pic seems to communicate fine at 3.3v, so maybe importing the data to the pic then the computer would work?

Thanks for the help!
Dave

aerostar
- 22nd August 2015, 18:59
One of these would sort your connection to the PC serial

http://www.ebay.co.uk/itm/MAX3232-RS232-Serial-Port-To-TTL-Converter-Module-DB9-Connector-W-4-Cables-WK-/181566489586?hash=item2a4634c3f2

You should find same on US Ebay site.

I suspect it is just the voltage level that is causing a problem.

aerostar
- 23rd August 2015, 10:29
I think also that your terminal program that inverts the signal is not doing what you think.

Your serial port is hardware, that expects the data to arrive in the proper manner, but your data is we think inverted, so the uart will not take in the inverted data correctly, yes it will give you something but it will not be the correct character even if your terminal inverts what it has received.

The transmitting device when correct and in idlesits at the MARK (1) level and starts collecting the bits from there, if it is inverted, then the transmitting device is sitting at the SPACE (0)level

Have a read here

https://learn.sparkfun.com/tutorials/serial-communication/rules-of-serial

may help you understanding why the terminal inversion does not work.

Art
- 8th September 2015, 19:12
And I misspoke when I said I had connected the module to an RS-232 port... it's a serial port on a 10+ year old computer using windows 98
That’s almost certainly an RS232 serial port with typical 12 Volt signal, and 24 Volt swing,
and it occurs to me you misspoke when you say you connected the GPS rx pin to the computer, or you wouldn’t see anything if the ports were compatible!
So if you have only connected your GPS tx pin to the PC serial port rx pin, I don’t suppose there’s a problem in terms of damage, but surprising you see anything on the terminal.
So check the 628 data sheet for what voltage is a logic high for the pic input pin you use as GPS receive, and I think you’ll find it’s below 3V.
Fine if you only want to receive data from the GPS, but if you want to configure it with the pic it will be a different story,
and you will want to level shift the pic’s 5V serial transmit output to the 3.3/3.6 V or whatever it was for the Ublox.
The standard NMEA is present for default configuration, so you might not need to ever change the default configuration.

I haven't connected a Ublox to a PC, but the sentence format is exactly as specified in the data sheet.

If you can connect the 628A to the PC as in the manual, you might as well do that.
If using PBP software serial read the ublox data into a big array, then you have the rest of the second to spit the array to the PC.
If using hardware serial on the 628A, you should be able to read a byte and if a byte was received, transmit a byte (in a loop).

You want something like 100 byte array or a little less to receive everything the Ublox will spit out by default,
probably larger than the maximum array, but IIRC, all of the good stuff comes first.