Author Topic: test RS232 voltage  (Read 2375 times)

0 Members and 1 Guest are viewing this topic.

Offline alamwteTopic starter

  • Regular Contributor
  • *
  • Posts: 51
  • Country: af
test RS232 voltage
« on: January 05, 2021, 09:53:45 pm »
hello everyone
I have a question.
I have a device that use RS232 to send and receive data. Now I want to test its RS232  to know that it work properly or not.
How can I test RS232? Can I use multimeter or oscilloscope to test it or I have to use a softwere?
And I want to see the voltage of receive and transmit when it send and receive data. I know when I send '1' logic its voltage should be between -3 to -13 and 3 to 13 when I send '0' logic. Can I use multimeter to see these voltage or I have to use oscilloscope?
My multimeter show -11 in RX pin and -6 in TX pin but when I send data I don't see any change in voltage of multimeter.
Thanks
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3248
  • Country: us
Re: test RS232 voltage
« Reply #1 on: January 05, 2021, 10:26:35 pm »
An oscilloscope would be the best method.

Most multimeters are too slow to capture the rapidly changing voltages of an RS-232 signal. They are, however, pretty good at measuring average values. So if you send a stream of the same character you should (theoretically) be able to compute the average voltage as a function of the following voltages:

V_idle - voltage used when idle
V_space - voltage used for a space (logical 0) - between +3 and +15V
V_mark - voltage used for a mark (logical 1) - between -15 and -3V

(Usually V_idle is the same as V_mark, but, of course, you can measure V_idle on a quiet line.)

This combination will depend on the character format -- number of start bits, stop bits, data bits -- and the actual character data being sent.

See this page for how the character format is translated into voltages:

https://www.best-microcontroller-projects.com/how-rs232-works.html

So, pick a character to repeatedly send, determine the proportion of space bits to mark bits based on the character's binary value and the transmission format and measure the RS232 voltage.

Since there are two unknowns (V_space and V_mark) you will need to do this twice to get two equations.
 

Offline alamwteTopic starter

  • Regular Contributor
  • *
  • Posts: 51
  • Country: af
Re: test RS232 voltage
« Reply #2 on: January 05, 2021, 11:34:20 pm »
Thank you dear ledtester
I have another question.
when I measure the voltage of RX pin of my computer when it is no connected to any device it is  -11.57v and when is connected to the switch device it show -10v . And the Tx show 0v when is no connected and -6v when is connected to the switch. ( I am not sure which pin is RX and which one is TX)
Would you tell me what's the reason of these voltage when they are not connected to any device and why they change when they are connected to switch, while I don't send or receive data at the time?
 
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3248
  • Country: us
Re: test RS232 voltage
« Reply #3 on: January 06, 2021, 02:03:31 am »
Quote
I have another question.
when I measure the voltage of RX pin of my computer when it is no connected to any device it is  -11.57v and when is connected to the switch device it show -10v . And the Tx show 0v when is no connected and -6v when is connected to the switch. ( I am not sure which pin is RX and which one is TX)

I'm a little out of my depth, but this is what I think may be going on...

Here I've replicated Figure 4 of this TI document: https://www.ti.com/lit/an/snla037b/snla037b.pdf

1145838-0

I've added Rout which is the output impedance of the driver. It typically is small but every signal source has an output impedance. From the TI document Rin is specified to be between 3K and 7K for RS232.

Note that if the receiver is disconnected you will measure 0V at the receiver and if the driver is disconnected you will measure V_idle at the driver. But when you put the two together you will get an intermediate voltage due to the voltage divider created by Rout and Rin.
 
The following users thanked this post: alamwte

Offline alamwteTopic starter

  • Regular Contributor
  • *
  • Posts: 51
  • Country: af
Re: test RS232 voltage
« Reply #4 on: January 06, 2021, 05:12:21 am »
Thanks for your information  :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf