2
\$\begingroup\$

I've bought an USB to UART CP2102 and I want to connect it to a router to see the booting process. However, although I can see five pins in the router, I don't know which one is TX, RX, and GND.

Could I test each router's pin one by one to find out which one is TX, RX, and GND? If I do this could I break the router?

This is the router -> ONT I-240G-T. It works like this:

Annotated photo of the router circuit board

\$\endgroup\$
4
  • \$\begingroup\$ If there are 5 pins, why do you think a) that they are a UART, and b) only three need to be connected? A UART might also have hardware control signals. Have you access to any equipment, e.g. a multimeter or oscilloscope, or have you only got the USB-to-UART? Do you have any resistors? A few hundred ohms in series would make it less likely that you could damage anything while probing around, though the signal might not work, so you will need to remove them eventually. \$\endgroup\$
    – gbulmer
    Commented Sep 17, 2016 at 16:44
  • \$\begingroup\$ Hi gulmer, thanks!! It's a UART because I know another device, but different version, which has UART. Yes, I think only three need to be connected. I don't have access to an oscilloscope but I'm going to try to access to a multimeter. This is the device but different version: entrechips.blogspot.com.es/2013/03/… \$\endgroup\$
    – DavidR
    Commented Sep 17, 2016 at 17:00
  • \$\begingroup\$ @gbulmer Console UARTs essentially never use flow control. It doesn't really make sense for one way output to a receiver that is usually not there. \$\endgroup\$ Commented Sep 17, 2016 at 17:05
  • \$\begingroup\$ @ChrisStratton - 99.5% agree. However, IMHO, better to aim for clarity than "make an AssUme". OP's posted a link, so should be easier. \$\endgroup\$
    – gbulmer
    Commented Sep 17, 2016 at 17:11

3 Answers 3

4
\$\begingroup\$

Here is an example of 5 pin serial console port connections on a router board:-

enter image description here

If you just want to see the booting process then you only need two connections, GND and TX.

You can determine which pin is Ground using a multimeter's continuity test function. Find another point somewhere in the router which is known to be Ground, then meter (with router power off!) between it and each pin of the serial port until you get 0 Ohms.

Once you have identified the GND pin you can connect the USB/serial adapter's Ground to it. Then connect the adapter's RXD line to each of the other pins in turn and boot the router, until you find the one that sends the bootup message.

\$\endgroup\$
10
  • \$\begingroup\$ Thanks Bruce for your answer. I've got a multimeter, I'll meter tomorrow. One question. Once I find out GND and RX, can I also try to find out RX connecting the adapter's TXD line to each of the other pins in turn? Or I have to be careful with Vcc? Thanks for your help! \$\endgroup\$
    – DavidR
    Commented Sep 18, 2016 at 19:29
  • 1
    \$\begingroup\$ Put a 1k resistor in series with the USB/TTL adapter's TXD line. This should limit current to a safe amount if you connect it to the wrong port pin. \$\endgroup\$ Commented Sep 18, 2016 at 22:36
  • \$\begingroup\$ Hi Bruce, I've metered today and I think I've found out the GND pin because the meter, with the device turned off, has been the next: PIN1: 232, PIN2: 1200, PIN3: 008 (GND??), PIN4: 1100, PIN5: 233. In addition, I've metered with the device turned on (PIN1: -1, PIN2: 850, PIN3: 008 (GND??), PIN4: -1200, PIN5: -1). However, I've connected GND and after that I 've connected USB/serial adapter's RXD line to each of the other pins in turn but I don't see anything. I think it is because it's inverted and I have to use an 74HC04, do this make sense? Thanks. \$\endgroup\$
    – DavidR
    Commented Sep 21, 2016 at 10:49
  • \$\begingroup\$ "In addition, I've metered with the device turned on..." - don't do that! With power on, measure the voltage between each pin and ground. What do you get? If the data is inverted then it is probably RS232 (+-5~12V). Any pin measuring significantly greater than +5V or negative (eg. -3V) indicates RS232 voltage levels. Or it might be a proprietary interface, perhaps not even a serial port! Please tell us the exact model of your router and/or post a photo of the innards, and we might be able to figure out what interface it uses. \$\endgroup\$ Commented Sep 21, 2016 at 16:56
  • \$\begingroup\$ Hi Bruce, thanks again for your reply! I've edited the question with images. With power on, the voltage between each pin and ground is 3.3V except ground. This is the datasheet of the inverter st.com/resource/en/datasheet/m74hc04.pdf. Something I'm doing wrong, I'm sure. I keep studing. :-( Thanks \$\endgroup\$
    – DavidR
    Commented Sep 23, 2016 at 16:40
3
\$\begingroup\$

Do you have a meter (like even a cheap DMM)? With that, you could work out which is the ground pin. From that you could possibly work out which is the TX pin (as the RX pin will probably show no voltage). If you are careful, it seems unlikely that you can break the router if you use only GND and TX. Strongly recommend carefully staying away from any of the other pins.

\$\endgroup\$
6
  • \$\begingroup\$ Thanks Richard!! I'm going to try to have a DMM. However, I'm wondering how can I measure the values? I mean, if I don't know which one is GND; one stick (red one) to the pin I want to know (measure) and the other stick (black one) to where? some GND place that I know? I'm newbie with this stuff. Thanks!! \$\endgroup\$
    – DavidR
    Commented Sep 17, 2016 at 17:10
  • \$\begingroup\$ Use the resistance/continuity ("Ohms") function of your meter. It should read "0 Ohms" when you touch the two probes together. Pick a place on the router board where you can identify the "ground plane" (it should be the largest traces/area on the board). It also helps to look for the larger tubular electrolytic capacitors. They are virtually guaranteed to have their minus side connected to GND. You should get near-zero ohms between the circuit ground and the GND pin, and quite high resistance (perhaps even infinite ohms) to all the other pins. \$\endgroup\$ Commented Sep 17, 2016 at 22:12
  • \$\begingroup\$ Thanks Richard!! I've got a multimeter and I see the minus side of a capacitor, I'll use this to find out the GND pin tomorrow. One question. Once I find out GND and RX, can I also try to find out RX connecting the adapter's TXD line to each of the other pins in turn? Or I have to be careful with Vcc? Thanks for your help! \$\endgroup\$
    – DavidR
    Commented Sep 18, 2016 at 19:29
  • \$\begingroup\$ Repeating: Strongly recommend carefully staying away from any of the other pins. Judging by your apparent beginner knowledge it is quite dangerous to mess with trying to inject data INTO the device (router or WHATEVER it is!) You need a lot more experience and understanding before you try anything but passive monitoring. \$\endgroup\$ Commented Sep 19, 2016 at 3:11
  • \$\begingroup\$ Hi Richard, I know I need more experience. I've metered today and I think I've found out the GND pin because the meter, with the device turned off, has been the next: PIN1: 232, PIN2: 1200, PIN3: 008 (GND??), PIN4: 1100, PIN5: 233. In addition, I've metered with the device turned on (PIN1: -1, PIN2: 850, PIN3: 008 (GND??), PIN4: -1200, PIN5: -1). However, I've connected GND and after that I 've connected USB/serial adapter's RXD line to each of the other pins in turn but I don't see anything. I think it is because it's inverted and I have to use an 74HC04, do this make sense? Thanks. \$\endgroup\$
    – DavidR
    Commented Sep 21, 2016 at 10:52
1
\$\begingroup\$

I am guessing that you have found what appears to be a serial port on a router and you are assuming that the router is running Linux and that the serial port is the console to the Linux OS? And the fact that this is a router has nothing to do with listening in on the console serial port. That this could be a Linux media box for the purposes of this question.

What might be done is to probe each pin with a scope. The Ground pin will be 0 volts and the TX (with respect to the "router") will likely have activity on it each time you apply power to the "router". The RX (with respect to the "router") may also appear to have 0 volts. To differentiate between RX and Ground you can use a large resistor (perhaps 1Kohms) connected to the positive voltage rail. When this and the scope is applied to the ground pin you should see nothing but 0 volts. But when this and the scope is applied to the RX pin you should see the voltage of the positive rail.

Take care not to short any pins directly to ground or the positive rail when testing.


(Added later after being asked if a multimeter instead of a scope could be used:)

If you do not have an scope you can do these tests using a multimeter.

Consider that both he multimeter's input and likely the RX input are both high impedance. So can be influenced easily by a week current. As is the case with an approximately 1000ohm resistor connected to the positive rail.

However, the ground pin, being directly connected to ground is low impedance. And can not be influenced by the resistor.

Both these cases can be detected by the multimeter. When the multimeter and resistor are connected at the RX pin, the multimeter will read a continuous positive voltage. When the multimeter and resistor are connected to the ground pin, the multimeter will read 0 volts.

The TX pin is a bit tricky if only using a multimeter. It is being driven and should not be influenced by the resistor. However we do not know if it is being driven high or low at any given moment. The best we can do here is assume it is changing. So we will look for a difference in average voltage. We expect the TX pin to be active on power up. So we center or testing on this pin after applying power to the board.

We can use the multimeter to perform and additional test to verify our findings. By measuring the impedance to ground and the positive rail when the power if off, we can make further inferences as to the function of the pins.

The easiest pin to identify using impedance testing is ground. It should have dozens to thousands of ohms resistance to the positive rail. But no resistance to ground.

The RX pin should have dozen to thousands of ohms resistance to both the positive rail and ground. But we are already fairly sure about this pin from the above multimeter resistor test.

The TX pin will again be difficult. It will likely have resistance like the RX pin.

Now consider both multimeter tests. It as easy to find the RX pin because we could influence it with a week current. But it may or may not have been easy to tell the difference between the ground and TX pins. Especially if the TX pin was actively low most of the time. However, it was easy to find the ground pin by measuring it had zero impedance to ground. That leaves the last pin which we can assume is the TX pin.

\$\endgroup\$
4
  • \$\begingroup\$ Hi st200, thanks for your reply! I don't have access to a scope but maybe to a multimeter. How can I differentiate between GND and RX in a multimeter? Thanks and sorry because I'm newbie in this kind of stuff! \$\endgroup\$
    – DavidR
    Commented Sep 17, 2016 at 17:14
  • \$\begingroup\$ No problem. You can do the same with the multimeter. Look at it this way: Both he multimeter's in put and likely the RX input are both high impedance. So can be influenced easily by a week current. As is the case with an approximately 1000ohm resistor connected to the positive rail. However, the ground pin, being directly connected to ground is low impedance. And can not be influenced by the resistor. Both these cases can be detected by the multimeter which will read a positive voltage at the RX pin and 0 volts at the ground pin. I'll add this to my answer as well. \$\endgroup\$
    – st2000
    Commented Sep 18, 2016 at 7:04
  • \$\begingroup\$ Also: If this is Linux, consider the author may not run the "getty" program on this port. The Unix / Linux "getty" program is a login program which drops you in a shell after a login process. I have connected to ports which were clearly serial "debug" ports only to find no activity as the production version of code, for obvious security reasons, turns off this feature. Of course, if the port is only being used to "dump" data out, then you don't need to (likely can't) login. \$\endgroup\$
    – st2000
    Commented Sep 18, 2016 at 7:35
  • \$\begingroup\$ Thanks st2000, I've got a multimeter and I'm going to meter tomorrow. Once I find out GND and RX, can I also try to find out RX connecting the adapter's TXD line to each of the other pins in turn? Or I have to be careful with Vcc? Thanks for your help! \$\endgroup\$
    – DavidR
    Commented Sep 18, 2016 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.