0
tbsky

TTL to RS232 possible?

Recommended Posts

hi:

   I want to use my orange pi to control some network devices which has rs232 console port. so I enable uart1 as 2 pin mode, and buy some rs232-ttl converter board.

then I found these rs232-ttl converters is not working under my situation. 

they do work when I use my PC to control orange pi (so this is RS232 -> TTL).

they don't work when I use my orange pi to control rs232 device (so this is TTL-> RS232, not working).

 

it seems there is something difference between RS232->TTL and TTL->RS232.

now I wonder if TTL->RS232 possible? or I need enable 4 pin mode and find another kind of converter for the work?

thanks a lot for your help!

 

 

 

Share this post


Link to post
Share on other sites
1 hour ago, Gavinb said:

You probably need to level shift your voltages.

The orange pi has 3.3v signals, and your rs232 converter is most probably a 5v device.

 

Try looking here http://www.hobbytronics.co.uk/mosfet-voltage-level-converter for a simple level shift circuit.

 

 

Hi:

    I can use the rs232-ttl converter to control orange pi via PC, so I think the voltages is ok?

I just don't know why ttl can not control rs232, it seems related to rs232 initialization or something?

 

 

Share this post


Link to post
Share on other sites

How is your converter powered ? (The converter need to provide positive/négative tensions - theorically 15V for the PC). And check you really provide 3.3V for the sake of your SBC !

 

"RS232" has no "initialisation" phase but some circuit (DTR, DSR, RTS, CTS, DCD ...) to coordinate the transmission on Tx, Rx circuit. You need to program drivers at both end to ignore the flow control circuits or have them shunt (RTS with CTS for the flow control, DTR and DSR with DCD for the peer detection)

Share this post


Link to post
Share on other sites
54 minutes ago, arox said:

How is your converter powered ? (The converter need to provide positive/négative tensions - theorically 15V for the PC). And check you really provide 3.3V for the sake of your SBC !

 

"RS232" has no "initialisation" phase but some circuit (DTR, DSR, RTS, CTS, DCD ...) to coordinate the transmission on Tx, Rx circuit. You need to program drivers at both end to ignore the flow control circuits or have them shunt (RTS with CTS for the flow control, DTR and DSR with DCD for the peer detection)

 

hi:

    the converter is powered by orange pi pin. the strange part confused me : it is working if I use PC minicom program to control orange pi uart0, but it is not working when I use orange pi uart1 to control other network device via minicom. (flow control all disabled)

 

   I have tried to use orange pi uart1 to connect uart0 directly  and it is working fine, so I think uart1 configuration is ok.

 

Share this post


Link to post
Share on other sites

I bought the FriendlyArm converter to get access to my "legacy" PC on console port ... but I never bothered to use it !

 

If you can use minicom on the PC to send and receive characters from the SBC, then your links and the converter is working. If you intend to get a login prompt from the PC using minicom on the SBC, then you may have a problem with DCD, DTR/DSR.

 

Because of security, a login should be permitted and a session maintained on serial line (by default) only if the Carier Detect (DCD) is asserted and maintained - and Data Set (=modem) Ready (DSR) received (the session is closed if the modem hangup)

Share this post


Link to post
Share on other sites
38 minutes ago, arox said:

I bought the FriendlyArm converter to get access to my "legacy" PC on console port ... but I never bothered to use it !

 

If you can use minicom on the PC to send and receive characters from the SBC, then your links and the converter is working. If you intend to get a login prompt from the PC using minicom on the SBC, then you may have a problem with DCD, DTR/DSR.

 

Because of security, a login should be permitted and a session maintained on serial line (by default) only if the Carier Detect (DCD) is asserted and maintained - and Data Set (=modem) Ready (DSR) received (the session is closed if the modem hangup)

Hi:

    I don't want to use SBC to login PC. but I do want to use the SBC as PC, so I can minicom to other network device like routers,switches..etc. 

 

   to clarify the problem, I try to test PC RS232 connection to a MicroTik router. and I found the rs232 pin need to use TX/RX/GND. only TX/RX is not enough. in contrast when I use SBC uart1 to connect uart2 directly via minicom,  two wires TX/RX are enough to get login screen.  I don't really understand the technical details, just confused about the situation.

 

 

 

Share this post


Link to post
Share on other sites
47 minutes ago, tbsky said:

I try to test PC RS232 connection to a MicroTik router. and I found the rs232 pin need to use TX/RX/GND.

Only TX/RX is not enough. in contrast when I use SBC uart1 to connect uart2 directly via minicom, 

two wires TX/RX are enough to get login screen. 

I don't really understand the technical details, just confused about the situation.

Maybe you have only to disable handshake in you terminal programm (RTS/CTS, DSR/DTR/DCD,XON/OFF) for 3 wire (RX,TX,GND) connection or do build a non-handshake-cable.

 

 

No_Handshake.jpg

Share this post


Link to post
Share on other sites
2 minutes ago, guidol said:

Maybe you have only to disable handshake (RTS/CTS, XONN/OFF) or do build a non-handshake-cable.

 

 

No_Handshake.jpg

hi:

   thanks for the hint. I will try to build a no handshake cable for testing.

 

 

 

Share this post


Link to post
Share on other sites

 

Yes, my FriendlyArm converter is cabled as DTE (without DTR/DSR/DCD). So I would use a "Full hanshake" or "No handshake" "null modem" cable to connect to a PC or a router.

 

Share this post


Link to post
Share on other sites
2 hours ago, tbsky said:

 the converter is powered by orange pi pin.

Do you power via the VCC Pin (only RX,TX,GND isnt powered) - and with how much Volt?
 

Specifications

Operating voltage: 3.3V-5V DC

Operating current: 6mA

Power supply: external

 

Which RS232 cable/adapters do you use? maybe if more than 1 nullmodem will switch back to RX/RX and TX/TX.

Or did you use gender changers or 9->24pin adapters?

 

SeedStudio_RS232.jpg

Share this post


Link to post
Share on other sites
9 hours ago, guidol said:

Do you power via the VCC Pin (only RX,TX,GND isnt powered) - and with how much Volt?
 

Specifications

Operating voltage: 3.3V-5V DC

Operating current: 6mA

Power supply: external

 

Which RS232 cable/adapters do you use? maybe if more than 1 nullmodem will switch back to RX/RX and TX/TX.

Or did you use gender changers or 9->24pin adapters?

 

SeedStudio_RS232.jpg

Hi:

    I tried 3.3V and 5V VCC. and I use wires to connect the pins one-by-one, so I can switch tx/rx at each side easily. since I can use the converter from RS323 to TTL, I think it is working. it just can not convert from TTL to RS232.

 

   after observation, I think one side of the converter is "tx,rx,gnd,vcc"(TTL) and the other side is "tx,rx,gnd"(RS232).

 

   maybe I should try more converters for testing. could anyone test his converter if control the router/switch via SBC works?

 

 

 

 

 

Share this post


Link to post
Share on other sites

"since I can use the converter from RS323 to TTL, I think it is working. it just can not convert from TTL to RS232."

 

There is no "from" / "to" usage ! You transmit characters in both direction whatever you are doing with the converter : when you type a character in a serial console, it is sent to the other end and the othe end send it back so it is displayed on screen

 

"could anyone test his converter if control the router/switch via SBC works?"

 

"control" is just an application. If you can "control" the SBC from PC, then the hardware is OK because that mean you can transmit AND receive characters - and both ends are transmitting and receiving. So your problem is only software.

 

Your software needs only to take into account the fact that YOUR RS232 cable transmit or shunt the control wires and the flow control wires - or not. If we donnot use the same software, we can have our app working and you not.

 

If I understand well, "control" mean you want to acces the "console interface" of the router. Then the application is a shell on the router and minicom on SBC. And you cannot modify the software ! So you need to use a good RS232 null modem cable because that sort of device use DTR/DSR control.

Share this post


Link to post
Share on other sites
9 hours ago, arox said:

"since I can use the converter from RS323 to TTL, I think it is working. it just can not convert from TTL to RS232."

 

There is no "from" / "to" usage ! You transmit characters in both direction whatever you are doing with the converter : when you type a character in a serial console, it is sent to the other end and the othe end send it back so it is displayed on screen

 

"could anyone test his converter if control the router/switch via SBC works?"

 

"control" is just an application. If you can "control" the SBC from PC, then the hardware is OK because that mean you can transmit AND receive characters - and both ends are transmitting and receiving. So your problem is only software.

 

Your software needs only to take into account the fact that YOUR RS232 cable transmit or shunt the control wires and the flow control wires - or not. If we donnot use the same software, we can have our app working and you not.

 

If I understand well, "control" mean you want to acces the "console interface" of the router. Then the application is a shell on the router and minicom on SBC. And you cannot modify the software ! So you need to use a good RS232 null modem cable because that sort of device use DTR/DSR control.

Hi:

    there is some difference in hardware. when I minicom from PC to SBC, the SBC is using UART0. when I minicom from SBC to router, the SBC is using UART1.  I have test the router and it only need RX/TX/GND to work, no need for CTS/RTS/DTR/DSR.

 

    after more searching, I found maybe my converter is not good enough. so I ordered more converters to see if there is any difference. it will take two days to arrive so I can continue the experiment.

 

   thanks a lot for all the help! I will report the results later.

Share this post


Link to post
Share on other sites

"I have test the router and it only need RX/TX/GND to work."

 

Then beware of a security breach !

 

I will never buy such sort of device ! What use to force users to put passwords everywhere if you leave the session open for the next who gets hand on console of the major telecommunication equipments !:o;):D

Share this post


Link to post
Share on other sites
5 hours ago, guidol said:

@tbsky did you enable UART1 in armbian-config? Couldnt be that easy?

hi:

    I have tried to use UART1 to connect UART0 directly, and I can get login screen. so I think UART1 configuration is fine, at least  TTL to TTL.

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
On 5/27/2018 at 8:24 PM, martinayotte said:

To test your current RS232 Level Converter, simply add a loopback wire between TX and RX, then you should get echo while typing in minicom.

 

Hi:

   thanks for the hint. it is easier to do the test.

 

  today  I got new converters and they are fine. I don't know what happened to my original converter.  I saw some people said there are many fake chips which can only do 9600 bps. but since the new converter works fine, I don't want to bother what happened to my old converter.

 

   thanks for all the help!! now I can minicom my routers!

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
25 minutes ago, guidol said:

What model/name does your new converter have? do you got a picture

Hi:

    sorry I don't have name. there are tones of converters in the market and they basically looks like the same. the new and old one  both use SP3232EEN.

a.jpg

Share this post


Link to post
Share on other sites

The converters which were "faked" were the FTDI based USB <--> RS232 converters...

The converter you are using is based on a Sipex 3232 (or Maxim MAX3232) chip. Those are so super basic converters (you can buy them on a PCB ready to go for 15 cents each!) that they are not worthwhile faking...

I bet you that the issue you are having is just a cold (bad) solder joint, like in the picture below...

solderjoint.png.2192678f2c0a74ab77ced659bba2fc0e.png

 

The sad part is that this is a picture of an advertisement of one of those 15 cent converters ads on Aliexpress.... In this case the converter would actually work, since the cap with the bad connection is the power supply bypass... So their "quality control" would not even notice it in a functional test..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0