Author Topic: Debugging a unknown RS232  (Read 9656 times)

0 Members and 1 Guest are viewing this topic.

Offline soeren72Topic starter

  • Newbie
  • Posts: 6
  • Country: dk
Debugging a unknown RS232
« on: September 22, 2010, 11:35:35 am »
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 modul

any help would be nice

br Soeren
 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
Re: Debugging a unknown RS232
« Reply #1 on: September 22, 2010, 11:58:12 am »
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.
Was it really supposed to do that?
 

Offline soeren72Topic starter

  • Newbie
  • Posts: 6
  • Country: dk
Re: Debugging a unknown RS232
« Reply #2 on: September 22, 2010, 12:11:10 pm »
Thanks for replying,
It is a GSM not GPS

I tryed to hook up a pc, with a terminal program at different serial settings, and once there was a lot of ascii
but I havn't been able to recreate it again
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: Debugging a unknown RS232
« Reply #3 on: September 22, 2010, 02:09:27 pm »
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.


Using 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.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline jimmc

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: gb
Re: Debugging a unknown RS232
« Reply #4 on: September 22, 2010, 02:29:42 pm »
A very useful program for debugging RS232 protocols is 'comDebug' from http://www.windmill.co.uk/serial.html
Free but requires registration.

For an 'all singing all dancing' soundcard oscilloscope try 'Visual Analyser' from http://www.sillanumsoft.org/
Free. Includes oscilloscope, spectrum analyser,LCR meter (requires simple external circuit), counter, AC voltmeter, waveform generator and more!

Jim
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14192
  • Country: gb
    • Mike's Electric Stuff
Re: Debugging a unknown RS232
« Reply #5 on: September 22, 2010, 05:25:49 pm »
Thanks for replying,
It is a GSM not GPS

I tryed to hook up a pc, with a terminal program at different serial settings, and once there was a lot of ascii
but I havn't been able to recreate it again
Sometimes 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.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline soeren72Topic starter

  • Newbie
  • Posts: 6
  • Country: dk
Re: Debugging a unknown RS232
« Reply #6 on: September 23, 2010, 07:35:35 pm »
Thanks for all your input, i will give them a try

also the sugestion about closing/opening the port after changes, i guess it can be even worse
with a USB to serial thing
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14192
  • Country: gb
    • Mike's Electric Stuff
Re: Debugging a unknown RS232
« Reply #7 on: September 23, 2010, 10:23:54 pm »
Thanks for all your input, i will give them a try

also the sugestion about closing/opening the port after changes, i guess it can be even worse
with a USB to serial thing
Yes- the FTDI devices can definitely get into a 'stuck' situation when flooded with garbage
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9374
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Debugging a unknown RS232
« Reply #8 on: September 24, 2010, 12:36:39 am »
Some microcontrollers have automatic baud rate detection.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: Debugging a unknown RS232
« Reply #9 on: September 29, 2010, 11:07:05 am »
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


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf