Help with Analyzing RS232 Voltage Data Recorded in a CSV File

4 views (last 30 days)
I recently performed an RS232 communication test and recorded some voltage data. The interface was RS232, and I transmitted the character "H". The transmission settings were 1 start bit, 1 stop bit, no parity, and 8 data bits. The baud rate was set to 9600, and the sample frequency was 200ksps. The voltage data was saved as a comma-separated values (CSV) file. I'm trying to analyze this data and would appreciate help in interpreting the recorded voltage levels, given the sample rate and transmission settings. Specifically, I want to know how to extract the bit information from the voltage data for the transmitted character "H". Can anyone provide insight into how to work with this data and reconstruct the transmitted bits?
Thank you!
  7 Comments
Walter Roberson
Walter Roberson on 11 Jul 2025
Edited: Walter Roberson on 12 Jul 2025
it's possible the voltages are sent as a decimal string of digits,
No, the user explicitly said that the character 'H' was being transmitted over RS232. RS232 defines the protocol -- start bit, data, stop bit. Wikipedia says
Valid signals are either in the range of +3 to +15 volts or the range −3 to −15 volts
with respect to the "Common Ground" (GND) pin; consequently, the range between −3
and +3 volts is not a valid RS-232 level. For data transmission lines (TxD, RxD, and
their secondary channel equivalents), logic one is represented as a negative voltage
and the signal condition is called "mark". Logic zero is signaled with a positive
voltage and the signal condition is termed "space".
Start bits are logic 0 (so, positive voltage) and stop bits are logic 1 (so, negative voltage.)
Bits are sent least significant first (so reverse of the typical order of writing.)
Presuming ASCII, that would make the bit order
['0', fliplr(dec2bin('H')), '1']
ans = '000010011'
and the voltage levels
regexprep(ans, {'0', '1'}, {'H', 'L'})
ans = 'HHHHLHHLL'
Nothing all that complicated about it.
dpb
dpb on 12 Jul 2025
I guess I whiffed on the missive, Walter...I thought the OP had a CSV file of data from an instrument and didn't understand how to interpret that...should have read more than the title more thoroughly...

Sign in to comment.

Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!