Nmea0183 devices, from the electrical point of view, follow the RS-422 protocol and, in many cases, just follow the RS-232 protocol. I briefly describe here the basic characteristics of the 2 protocols. First of all it is important to notice that there are talkers (that output data) and listeners (that receive data) and that connections can be "one to many" but, in no case, "many to one". In other words one talker can be connected to, say, two listeners, but two talkers can not be connected to the same listener.
In the case of RS-232, talkers have a TX (transmitting) line and listeners have a RX (receiving) line. In addition they share a common GND (ground). When a talker is not talking (not sending data out) the TX line is said to be in its idle state with a negative voltage to GND between -3V to -15V (or zero in the "simplified RS-232"). When the talker transmits, its TX line pulsates, going positive to send a "0" bit or returning to the negative or zero voltage to send a "1" bit. The positive voltage of the TX line (for bit "0") can vary between +3 to +15 volts. Following is a diagram of RS-232 serial communication. In the top is the case of the RS-232 standard. In the middle is the case of the "simplified RS-232". And in the bottom is the case of the what is called "Serial TTL".
Looking to the 2nd and 3rd waveforms, we note how similar they are with regard to the voltage values but, at the same time, how different they are with regard to their logic values. Actually one is the logical inverse of the other. We can use an inverter IC or a simple transistor to perform the inversion. Another point to note which we explore later in this post is that each of these waveforms can be obtained by subtraction from 5V. We have:
- (+5V) - (Simple RS_232) = (Serial TTL) and also
- (+5V) - (Serial TTL) = (Simple RS-232)
Now I turn my attention to the title of this post. Today computers have USB ports and we can find adapters from USB to RS-232 or USB to Serial TTL. We can buy these adapters from China for a little more than 1 euro. With the USB to RS-232 adapter we can "transform" a USB port on a Nmea 0183 talker and listener. In the case of the USB to Serial TTL adapter we need an inverter or use a trick explained below.
I have in my lab some USB to Serial TTL adapters. The reason I chose these adapters is that they have the cable terminals ready to use. All the electronics is inside the box on the USB end. On the contrary, the adapters on the right side of the picture have the electronics on the box on the RS-232 end and it is not possible to cut the cable just before the DB9 socket. Here is the meaning of the colors:
- black color = GND
- red color = +5V
- green color = TX
- white color = RX
1 - when you insert the adapter in a USB socket, W10 will try to find the best drivers and installs them. The yellow "!" that appears in the Device Manager goes away and you get this:
It looks fine but the serial port does not work. So you go to the next step.
2 - In the Device Manager right click the Prolific driver and choose "Update Driver". You can have a message saying that the best drivers are already installed but you need to install the old W7 drivers. If you find the option to tell Windows the location of the drivers that you want to install just point to the temp folder where you unzipped the old W7 drivers. If Windows insists that you already have better drivers you can follow another route. When right clicking the Prolific driver you choose "Uninstall Device". In the dialogue form that opens check the box that says "Delete the driver Software for this Device" and then press Uninstall. Unplug the device and plug again. Windows may install another driver that still resides in the computer. Repeat the "Uninstall Device" as before. You reach a point where Windows does not have more drivers. In that occasion it will ask you to point to a location or a disk where to get the drivers. Pointing to the the above referred to folder you get the old W7 drivers and they work great. The Device Manager will show you this:
3 - Now the problem is Windows Update. The only solution that I found was to disable the automatic update of drivers. To do that you open the "Control Panel" and then you press "System". Press "Advanced system settings" on the left menu. In the "Systems Properties" form that opens, press the tab that says "Hardware". Press the "Device Installation Settings". Choose the option "No" and ignore the Windows recommendation. Save the changes and that is all!
To end this post I refer to the trick to use the USB to Serial TTL with the Nmea2Wifi or Nmea4Wifi multiplexers. When the adapter is used as a talker you need to invert TX (to get a RS-232 type waveform) and connect NOT_TX to the RX pin of the listener. With our multiplexers as listeners you do not need the inverter. Considering the input P2, for example, you can connect +5V (red cable) to A2 and TX (green cable) to B2. In this way the optocoupler receives a waveform (or a voltage between A2 and B2) which is equal to (5V - TX). The following picture shows all the waveforms that we are referring to.
We see that there is a problem with the TX waveform. The waveform is 0V in the idle state as it should be but the positive going pulses will just go to 3.3V. Therefore the difference 5V - TX will not be 0 in the idle state but 1.7V. Since the optocoupler diode conducts when the voltage is 1.2V it will not stop conducting in the idle state. A trick is to connect a small diode in series with the +5V. That diode will have a voltage drop of 0.7V so that the voltage that you apply to A2 is 4.3V instead of +5V. In this way the (4.3 - TX) waveform will be about 1V in the idle state. The optocoupler will not conduct and that is OK.
When the adapter is used as a listener you use B3 or B5 (Nmea2Wifi or Nmea4Wifi) to connect to RX (white cable) and GND to GND (black cable). You simply use the fact that A3 and B3 (or A5 and B5) are the inverse of each other! All of these connections are shown in the following picture. You can see the diode in series with the red cable. This is a solution to get USB connectivity in the case of the Nmea2Wifi multiplexer.