Author Topic: cheking RS232  (Read 1283 times)

0 Members and 1 Guest are viewing this topic.

Offline ElizaTopic starter

  • Contributor
  • Posts: 11
  • Country: cn
cheking RS232
« on: January 07, 2021, 03:53:00 pm »
Hello,

I want to check my computer 's RS232 to know it works properly or not.

What are the ways to test it?
 

Offline drvtech

  • Regular Contributor
  • *
  • Posts: 113
  • Country: gb
Re: cheking RS232
« Reply #1 on: January 07, 2021, 05:21:11 pm »
Get yourself a serial terminal program such as Realterm. Make sure it is configured for no software flow control and no hardware flow control. Connect together TxD and RxD  (pins 2 and 3 on a 9 pin D connector). Anything you type into the Realterm window (you need to click in it first) should appear on the screen.
 
The following users thanked this post: Eliza

Offline ElizaTopic starter

  • Contributor
  • Posts: 11
  • Country: cn
Re: cheking RS232
« Reply #2 on: January 07, 2021, 09:45:49 pm »
 Thanks a lot dear drvtech
But  should I connect RX and TX together by a wire?
Dones't RS232 need to be connected to other device like switch  that  Realterm can send and receive data?
Because i used another software befor , that it didn't send any data when RS232 didn't connect to another device
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: cheking RS232
« Reply #3 on: January 07, 2021, 09:47:57 pm »
such a TXD-RXD connection is called loopback; you can solder a d-sub connector where RXD-TXD, CTS-RTS and DTR-DSR are joined together so that you can check hardware handshake too. Such a connector allows you to test the local serial port without having a DCE connected (what normally doesn't help in diagnostic of the serial port)
 
The following users thanked this post: Eliza

Offline ElizaTopic starter

  • Contributor
  • Posts: 11
  • Country: cn
Re: cheking RS232
« Reply #4 on: January 08, 2021, 09:13:38 am »

If I want to check another RS232 that use in other device like switch, how can I test it? Should I connect those pin together and connect it to computer to see send and receive data in Realterm software?
« Last Edit: January 08, 2021, 05:27:40 pm by Eliza »
 

Offline innkeeper

  • Supporter
  • ****
  • Posts: 615
  • Country: us
Re: cheking RS232
« Reply #5 on: January 08, 2021, 09:45:40 am »
that gets a bit more complex.
some devices need rts/cts and dsr/dtr others do not.
some use xon/xoff protocol for flow control.

you can first spoof the hardware flow control to test it like this:

you can connect rts to cts and dsr to dtr  on the device side and on the terminal side ... that will spoof the hardware flow control on both sides if it is using it.. then connect tx on the device to rx on the terminal and rx on the device to tx on the terminal.   some devices use the CDC line so you might need to tie the DCD to  DSR/DTR also.

later you should figure out if the device uses hardware or software flow control.

some devices do not use rts/cts and/or dsr/dtr and/or dcd. some use hardware flow control, some software flow control some both. and some neither.

there is a device called an rs232 breakout box, which gives you pins to jumper on it to help you figure all this out when testing. the fancier ones have led's so you can see what's active.
« Last Edit: January 08, 2021, 09:53:02 am by innkeeper »
Hobbyist and a retired engineer and possibly a test equipment addict, though, searching for the equipment to test for that.
 
The following users thanked this post: Eliza

Offline ElizaTopic starter

  • Contributor
  • Posts: 11
  • Country: cn
Re: cheking RS232
« Reply #6 on: January 08, 2021, 12:28:11 pm »
 i am really confused.
I have a switch that it use RS232. And the computer have RS232  too. You mean I should connect the RX of switch to TX of computer with a wire?
 can't I use the RS232 cable to connect these pins together? Instead of connect them with a wire?
« Last Edit: January 08, 2021, 05:28:15 pm by Eliza »
 

Offline drvtech

  • Regular Contributor
  • *
  • Posts: 113
  • Country: gb
Re: cheking RS232
« Reply #7 on: January 08, 2021, 04:12:44 pm »
My initial reply was to show you how to check that the RS232 port on your computer was working ok. To explain that a little more - with a serial connection like RS232 you have two almost completely separate devices in your computer : 1) there is the keyboard which converts key presses into RS232 signals ; 2) the display which converts RS232 signals into visible characters. The easiest way to check that they are both working is to connect them to each other. When you press a key, that gets converted into an RS232 signal as in 1) above. Because the RS232  output is connected to the input, this gets fed back into the display where it is converted from an RS232 signal into a displayed character. So in summary, if you press the 'A' key and everything is working, you will see an 'A' or an 'a' on the display.

The whole purpose of all of the above is just to check that the RS232 port on your computer is working properly.

Of course, just using the RS232 port to see characters that you are typing is pretty useless. What you need the RS232 port to do is to send characters to another device (in your case this is a switch) and to be able to see what the switch sends back to you. So, instead of connecting the computer's TxD pin to its RxD pin you connect the TxD pin from the computer to the RxD pin of the switch and connect the TxD pin from the switch to the RxD pin of the computer. Now your key presses get sent to the switch and the switch's response appears on your computer.

Unfortunately this is not all you have to consider when connecting two devices. The other main one is the speed at which the two devices expect to communicate. This is referred to as the Baud rate. Typically it will be 9600 but could be anything from 300 to 115200. Actually it could be even higher or lower but this is very unlikely for a switch. If the two devices are not set the same then you will get either nothing at all or complete gibberish. The manual for the switch will tell you what speed it uses and you can change the speed of your computer to match this.

Sorry if this is very simplistic but you seemed to be having difficulty understanding. Hope this helps. You might want to tell us what switch you are trying to connect with.
 
The following users thanked this post: Eliza

Offline ElizaTopic starter

  • Contributor
  • Posts: 11
  • Country: cn
Re: cheking RS232
« Reply #8 on: January 08, 2021, 04:49:50 pm »
I realized finally. 
Thanks all to help me :-+
« Last Edit: January 08, 2021, 04:53:09 pm by Eliza »
 

Offline innkeeper

  • Supporter
  • ****
  • Posts: 615
  • Country: us
Re: cheking RS232
« Reply #9 on: January 13, 2021, 07:33:20 am »
to keep things simple, you can look for something called a null modem cable.
Hobbyist and a retired engineer and possibly a test equipment addict, though, searching for the equipment to test for that.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf