Debugging a unknown RS232 - Page 1
Forum section: electronics / projects

author: soeren72
author_rank: Newbie
timestamp: September 22, 2010, 11:35:35 am
content: I have a pelletburner with a DB9 connector on the back, (normally used to connect a GSM module for remotecontrol)Any ideas how to go about, finding out how to control it.I have no information in serial setup (speed and so on)And I don't have the GSM modulany help would be nicebr Soeren

author: DrGeoff
author_rank: Frequent Contributor
timestamp: September 22, 2010, 11:58:12 am
content: Hook up a scope to the TXD line and switch it on. It may send out a stream of characters to indicate that it is ready. Examine the timing of a character and calculate the baud rate (and start/stop/parity settings).If you don't know what the protocol is then it may be difficult, however if it was supposed to talk to a GPS unit it may be 2400 Baud NEMA protocol.

author: soeren72
author_rank: Newbie
timestamp: September 22, 2010, 12:11:10 pm
content: Thanks for replying,It is a GSM not GPSI tryed to hook up a pc, with a terminal program at different serial settings, and once there was a lot of asciibut I havn't been able to recreate it again

author: scrat
author_rank: Frequent Contributor
timestamp: September 22, 2010, 02:09:27 pm
content: Quote from: DrGeoff on September 22, 2010, 11:58:12 amUsing a PC serial port may take a lot of time, if you don't know baud rate and so on.If you haven't by hand any oscilloscope, then you can use your PC's soundcard, just to start.A large capacitor in series with a resistor and a couple of antiparallelled diodes will make the signal to stay into an acceptable range for the line in of a soundcard. There are a lot of "soundcard oscilloscopes", choose one which allows to set trigger. The only problem would be if a high baudrate is selected, but I think it is not so probable.

author: jimmc
author_rank: Frequent Contributor
timestamp: September 22, 2010, 02:29:42 pm
content: A very useful program for debugging RS232 protocols is 'comDebug' fromhttp://www.windmill.co.uk/serial.htmlFree but requires registration.For an 'all singing all dancing' soundcard oscilloscope try 'Visual Analyser' fromhttp://www.sillanumsoft.org/Free. Includes oscilloscope, spectrum analyser,LCR meter (requires simple external circuit), counter, AC voltmeter, waveform generator and more!Jim

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 22, 2010, 05:25:49 pm
content: Quote from: soeren72 on September 22, 2010, 12:11:10 pmSometimes PC COm ports can get confused by wrong baudrates, framing errors etc and you need to flush the input buffer to clear it - closing & re-opening the port after trying each baudrate should be sufficient.

author: soeren72
author_rank: Newbie
timestamp: September 23, 2010, 07:35:35 pm
content: Thanks for all your input, i will give them a tryalso the sugestion about closing/opening the port after changes, i guess it can be even worsewith a USB to serial thing

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 23, 2010, 10:23:54 pm
content: Quote from: soeren72 on September 23, 2010, 07:35:35 pmYes- the FTDI devices can definitely get into a 'stuck' situation when flooded with garbage

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 24, 2010, 12:36:39 am
content: Some microcontrollers have automatic baud rate detection.

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: September 29, 2010, 11:07:05 am
content: One trick I learned long ago may be helpful here.An RS-232 OUTPUT will be at about -11v while idle. An input will be close to zero. On a 9 pin connector, data is on pin 2 or 3, with ground on pin 5. On a 25 pin connector, pins 2 and 3 also carry data and ground is on pin 7. A book I read (sorry I can't recall the title) explained that the documentation for many RS-232 ports was just wrong, so don't even bother with it....When connecting two unknown devices, measure from pins 2 and 3 to ground on one end. A negative voltage indicates the transmit pin. Repeat the process on the other device. Again, the transmit pin will have the negative voltage. Connect the grounds between the two devices, and each transmit pin to the non-transmit (i.e., receive) pin on the other end.Once you have the connections straight, you stand a chance of finding the right baud rate, parity and stop bits. 9600N1 is a good place to start. If this doesn't result in communications, then the device may be waiting on a handshake line.Jon