7

I wanted to sniff communication between two RS232 devices. This link presents a simple solution but I want to make sure that my 'sniffer' does not load the communication link.

To that effect, I was wondering if I could use a MAX-232 as a 'looping' buffer:

RS232 in -->TTL out-->TTL in-->Rs232 out

The MAX-232 will be powered by an external 5v. Is this a fool proof way of sniffing without loading the line? Does the MAX232 even act as a buffer in this configuration? If not. are there inexpensive RS232 buffer ICs available? All the 74xx range of buffer ICs seem to work only at TTL levels.

My communication link is only half duplex.

UPDATE: I think I was not clear with my description. Please see the image: alt text

Both my devices already are on RS232 levels. I simply wanted to read the data using a COM port of the PC, but thought a MAX-232 in between (the loop buffer that I was talking about) might serve as a buffer. But then again, even the PC's COM port per se might have a MAX-232 inside it...

P.S: I have not indicated the capacitors etc for the max232 in the above figure.

itisravi
  • 386
  • 3
  • 7

5 Answers5

4

If I understand correct, here is your circuit:

RS232 in -->TTL out-->[Sniffer circuit]TTL in-->Rs232 out

in other words:

[device1] <--> MAX232 <--> [sniffer circruit] <--> MAX232 <--> [device2]

That looks good to me. The fact that each side of the circuit is talking directly with a MAX232 should give you plenty of "isolation". You may need to cross the lines (or just use a null modem connection on one side) if you're talking CPE-CPE or computer to computer.

Other than that I don't see any issues.

Brad Hein
  • 1,042
  • 3
  • 13
  • 18
  • Actually ,the "RS232 in -->TTL out-->TTL in-->Rs232 out" are all on the same MAX-232 chip as shown in the figure. – itisravi Aug 25 '10 at 17:31
3

fwiw I've had success with the minimalist two-diode type circuit that you linked to. The only difference being that I used the TX pin of the 'sniffer' device as a handy source of -12V to use through a 47K pull-down to make sure the sniffer's own RX didn't float when neither of the snooped-upon devices was transmitting.

Unless you're driving tens of feet of wire, or are running at faster rates like 115.2kbps, the diode & resistor thing shouldn't affect the circuit too much.

If you really want to buffer the signals to TTL and back, there are of course the MAX chips, and even simple old line-driver/line-receiver type chips like the 1488 quad driver and 1489 quad receiver that would do the job.

JustJeff
  • 19,163
  • 3
  • 48
  • 75
2

Hmm, interesting circuit. You might want to use an actual MAX232 as a buffer between the lines you're reading and your two-diode setup. It has an input resistance of 5Kohms which means assuming that the receivers have the same you'll see 2.5KOhms of resistance on the bus. Perhaps a voltage follower with a higher input resistance might be in order - it is possible to break serial ports by trying foolish things (I've done it). Try testing on something that you don't mind destroying first.

AngryEE
  • 8,669
  • 20
  • 29
  • I tried the configuration shown in my figure (with the max232 looped in) and without it (directly to my PC's com ports). Both work fine. Now is a MAX-232 really needed in between? Does it provide a buffering action at all? – itisravi Aug 25 '10 at 17:35
  • I don't think you need the MAX-232 -- the input to your PC COM port is probably pretty similar to the one on the MAX-232 chip, so the load would be the same. – tcrosley Aug 25 '10 at 17:50
1

Assuming your two devices are talking TTL to each other, a good way to 'isolate' might be something like the following ascii circuit:

         Tx --------------x------------------------------- Rx
                          |              
Device1  Rx --------------------x------------------------- Tx  Device2
                          |     |                          
         Gnd -------------------------x------------------ Gnd
                          |     |     |    
                          |     |     |
                         Rx1   Rx2   Gnd

                            Sniffer (say an XMEGA with 3+ UARTS)

                         Tx1
                          |
                          x-----TX_IN-[MAX232]-TX_OUT----- Rx Computer Terminal

With some creative firmware something like this setup could snoop full-duplex communication between two devices and report the conversation to the user in a 'nice' way. Sorry if this isn't quite what you were asking, but I had to take the ascii art opportunity :).

vicatcu
  • 22,499
  • 13
  • 79
  • 155
  • The devices are already on rs232. I don't want to put a MCU in between; just wanted to keep it simple :) – itisravi Aug 25 '10 at 17:32
1

You can avoid all the 'electronics'completely if you can use two serial ports to do the sniffing. Each of the sniffer ports reads the TX line of one end of the connection. This also gives you extra status input pins to read all status outputs on monitored comms.

  Tx --------------x------------------------------- Rx
                   |              
  Rx --------------|-----x------------------------- Tx
                   |     |                          
                   |     |         
                   |     |     
                   |     x------------ PC COM 1 Rx
                   |
                   x-------------------PC COM 2 Rx
ttt
  • 658
  • 1
  • 6
  • 10
  • We are using this type of RS323 sniffing for over 15 years now without any problems – chrmue Sep 07 '10 at 12:27
  • @Tim, well if you look at my figure, that's exactly what I'm doing but with a max232 in between (which is not necessary as I found out and as others pointed). – itisravi Sep 08 '10 at 03:23