How to figure out the RS232 input/output required - Page 1
Forum section: electronics / beginners

author: Solder Fumes
author_rank: Newbie
timestamp: June 29, 2016, 09:13:35 am
content: Hi,I am wanting to make a hardware interface to some obscure/antique software that uses RS232 for the input and perhaps also for some output. The software requires a hardware controller with 10 switches. The hardware controller is unobtanium and the author of the software is difficult/impossible to locate.Short of disassembling the program is there any easy way to understand what is required by the software?I am thinking that perhaps I can use another PC as a terminal. Then I can try all combinations of baud rate and parity to see if anything works. Ideally I would like to also send all possible commands to the RS232 to see if anything happens in the software.Helpfully the software has a RS232 "debug" screen which shows live information on:CRC ErrorsBad PacketsBad BytesPacket Numbers(also pls see the attached image of the "debug" screen.Hope someone can offer some guidance....Thanks from,H.

author: danadak
author_rank: Super Contributor
timestamp: June 29, 2016, 09:31:54 am
content: A simple logic analyzer would take care of data capture, an example -http://www.ebay.com/itm/24MHz-8-Channel-USB-Logic-Analyzer-8-CH-Logic-Analyzer-for-Arduino-MCU-/142017327036?hash=item2110e46fbc:g:FEUAAOSwQupXVjOqJust search ebay on "Logic Analyzer"They use Saleae software,https://www.saleae.com/downloadsRegards, Dana.

author: TomS_
author_rank: Frequent Contributor
timestamp: June 29, 2016, 09:39:27 am
content: RS232 doesnt use packets, so forget about that. Any packetising of data will be implemented by the software running on either side of the link.CRC errors and bad bytes equally will need to be handled by the software either side.Its really just a bit banging system. Feed a byte to a driver and it bangs it out as different voltage levels.If you still have access to the two devices that are communicating then there is a method you can try to reverse engineer the "protocol" used between the units, allowing you to rebuild existing units or build new units as replacements or upgrades:1. connect a PC with terminal software (e.g. PuTTY) to the controller and determine the baud rate. As you make changes to settings, or request readings, you will see said requests appear in the terminal software on the PC in some form, maybe simply as binary blobs or text based commands (e.g. AT commands when talking to a modem). It really depends on how the protocol is implemented.2. connect the PC to the remote unit and issue the same commands and see what is returnedBy doing this you learn what is done by the controller to make the other unit act or respond, and what should be sent back in response - if anything.Without original source, or reference manuals to detail anything, this is about all you can do - short of disassembly. It could be a very long and arduous process depending on the complexity, or it may be very simple.

author: Solder Fumes
author_rank: Newbie
timestamp: June 29, 2016, 11:39:06 am
content: Thanks very much danadak and TomS for those very helpful replies. I will give those suggestions a try. Thanks for taking the time to give me those tips!Unfortunately I only have the software and not the external hardware controller (control device) so I can't eavesdrop on the communications.I wonder if there is some sort of automated "probing" type terminal software that has been used by others. For example sending all possible commands over RS232 and monitoring the responses....I will keep you updated!

author: daniel4422
author_rank: Newbie
timestamp: June 29, 2016, 11:44:35 am
content: On windows XP there is a software called - "HyperTerminal", which you can connect an RS-232 cable to the computer serial port and echo the incoming/outgoing data.maybe you can try this one ...

author: ebclr
author_rank: Super Contributor
timestamp: June 29, 2016, 11:47:00 am
content: Your pc can help on this use 2 comm port's and a reverse cable, but is like to decrypt a message a lot of stuff is on the software stack , and normally is a kind of state machine with a lot of IF then case situations, but is not rare to see plain ascII commands. good look

author: StuUK
author_rank: Frequent Contributor
timestamp: June 29, 2016, 12:03:48 pm
content: Quote from: Solder Fumes on June 29, 2016, 11:39:06 amDo you know what the possible commands are? There is no concept of commands simply bytes of data passing back and forth which the two systems communicating determine what to do with....

author: ebclr
author_rank: Super Contributor
timestamp: June 29, 2016, 12:15:58 pm
content: 1ST) You need to know your enemyWhat this board does ?What information you have on this board or similar competitor product ?Is any industry standard on the "soup"How is the PC software ( a lot of information may be on the software )Do they have some config / debug files ?

author: TomS_
author_rank: Frequent Contributor
timestamp: June 29, 2016, 03:58:04 pm
content: Quote from: StuUK on June 29, 2016, 12:03:48 pmPrecisely.RS232 sits at layer 1 of the OSI model. It defines a physical interface that allows two systems to be connected with each other. Thats all.Anything beyond that, like commands and data structures, are determined by the software that runs on the two halves of the system.