What is the convention on data polarity of NMEA tx /rx?

ProDave

Well-known member
Joined
5 Sep 2010
Messages
15,559
Location
Alness / Black Isle Northern Scottish Highlands.
Visit site
Doesn't NMEA0183 only have two baud rates in the Spec - 4800 and 38400?

Are you sure you can't send an instruction to the GPS mouse to change baud rate?
Yes no doubt you can, but that is a whole new set of problems to rig something up to get it to send the required command, I doubt the chart plotter would do that. And assuming i had the same data polarity issue on both the tx and the rx I probably would not have solved that. And then how long will it remember your settings? forever, or until the backup battery dies?

As the plotter will do 9600 baud from the comms port, it was simpler just to select that option.
 

rogerthebodger

Well-known member
Joined
3 Nov 2001
Messages
13,635
Visit site
My understanding is the NMEA has a spec of RS 422 differential current but could run on RS 232 and as the most common serial comms was RS232 differential voltage up to + and + 15 volts normally +/-12 v.

I used current looron telex machines which used Baudot code not ASCII coding.

Now we have USB serial coding using ASCII but I still have a GPS mouse with a RS232 plus 12 dc power supply pins as the RS232 do not have a power supply pins defined
 

ProDave

Well-known member
Joined
5 Sep 2010
Messages
15,559
Location
Alness / Black Isle Northern Scottish Highlands.
Visit site

chriscallender

Active member
Joined
30 May 2001
Messages
613
Visit site
Current project, I am trying to get a cheap fix for a dead GPS antenna by buying a very cheap GPS receiver module from china.

I am connecting to the data port on the plotter as the default baud rate of the Chinese GPS receiver is 9600 baud. I can configure the baud rate of the comms port but not the dedicated GPS port.

So I have baud rate set to 9600, my Chinese GPS receiver is sending data measured on my oscilliscope but the plotter is not receiving it.

Time for some head scratching and testing.

The data I am seeing from the GPS receiver measured on my oscilliscope is logic high, pulsing to logic low as it sends each NMEA sentence.

If I then turn on the data output pin of the comms port on the plotter, and look at that with my oscilloscope, I see that is logic low, pulsing to logic high as it sends each NMEA sentence.

So my guess is this Chinese GPS receiver in spite of saying it sends NMEA data, is doing so inverted.

Can anyone confirm my suspicions or tell me what the logic polarity should be?
I've spent many happy (???) years debugging these kind of things (not just UART). Since it works, you are probably at the end of the project already... but I reckon that *any* GPS module that outputs TTL (aka CMOS) serial data would do exactly the same.

There is nothing wrong with what the module is doing - if it outputs so called TTL serial rather than RS232 serial (which they all do). The convention for TTL serial is that the TX line sits high (+3.3/+5v) when it is idle and the start bit is indicated by it going low (0v) followed by the data then the stop bit(s) (which are high - a guaranteed back to idle before the next start) . More dirty details here

RS-232 vs. TTL Serial Communication - SparkFun Electronics

I reckon the old GPS receiver that broke had a line driver on the output and the plotter is expecting "proper" RS-232. Any GPS module would do the same unless it has something like a MAX-232 sitting on the output inverting/shifting the level. The modules you buy don't usually include that because they are expecting them to be hooked directly to embedded microcontrollers that use the TTL polarity/levels - the only things that do output proper(ish) RS232 are end products like Garmin etc....with their own internal line drivers. If you are connecting directly to a microcontroller without long cables etc, no point in having 2x Max-232 back to back.

Maybe the more important thing, don't ever connect the output from the plotter to the receive data input on the GPS module, because it might well be going between +/-12v and kill the GPS module. Or at least check the logic levels on a scope before you risk connecting them (otherwise it could be a whole extra £3.24 for you!)
 

ProDave

Well-known member
Joined
5 Sep 2010
Messages
15,559
Location
Alness / Black Isle Northern Scottish Highlands.
Visit site
There is nothing wrong with what the module is doing - if it outputs so called TTL serial rather than RS232 serial (which they all do). The convention for TTL serial is that the TX line sits high (+3.3/+5v) when it is idle and the start bit is indicated by it going low (0v) followed by the data then the stop bit(s) (which are high - a guaranteed back to idle before the next start) . More dirty details here

RS-232 vs. TTL Serial Communication - SparkFun Electronics
Thanks, excellent description of what I had concluded.

And the single transitor level shifter / inverter I used is very similar to one half of their level shifter in that linked article.
 
Top