Trying to probe RS232 on an analog oscilloscope - need some help.  Thx - Page 1
Forum section: electronics / beginners

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 03:57:09 pm
content: Question: Anyone have any advice on how to get a string of hyperterminal characters to trigger on an analog oscilloscope?Background:I can connect two Microsoft PCs to one another. One PC is connected via a RS232 serial port and the other PC uses a USB port. The two are connected via a startech.com cable that has a RS232 Null Modem connector on one end and a FTDI USB connector on the other end. The StarTech cable came with a USB driver that works fine on the USB PC. (There are some other threads here about people trying to get similar connections working - this cable was easy to setup and was delivered very rapidly via Amazon in case anyone is interested.)I can definitely send characters a key stroke at a time, back and forth in both directions - or I can send an entire text file in either direction - so I know the overall send/receive process is working between the two PCs.Next I have been able to remove the RS232 connector from the PC with RS232 port and plug it back into the RS232 port and the data still flows in both directions when I resume typing or sending a text file, so I know just removing the cable doesn't send everything into lala-land. I can also continue to type on the USB PC and see the characters echo on the USB PC screen even when the RS232 connector has been removed from it's PC.Next I probe the ground (Pin 5) on the StarTech female RS232 connector and the RxD (Pin 3) on the StarTech female RS232 connector with my Tektronix analog scope. Then I try sending data from the PC (which has the USB port) and I'm just trying to see the voltage go high and low on the scope. I don't seem to get anything resembling the +/-13 or so volts that I would expect to see from the RS232 connector (or even anything like the 0/+5 volts or so I would expect from a USB connector) - but maybe I have those specs wrong. I've tried various settings on the scope from millivolts to whole volts and various settings around milliseconds (including slower and faster). I've tried all three trigger settings NORM, AUTO, and Auto Level.It's possible that I don't have the right pins probed (but I'm pretty sure I have them correct and I've tried other combinations), or it's possible that maybe the data really isn't flowing despite my step by step process, or it's possible that I don't have the scope set right for triggering (my second most likely guess), or it's possible that the world is telling me it's time to buy a digital scope so I can more easily trigger on a single shot event.For what it's worth, I found this:Part way through video the demo shows the pins being probed (it looks like the same pins I'm using but my connector happens to be female).Any suggestions would be appreciated. Thanks!

author: c4757p
author_rank: Super Contributor
timestamp: September 24, 2013, 04:03:26 pm
content: Quote from: Electro Fan on September 24, 2013, 03:57:09 pmWhatdoyou see? Just zero? (And no, you won't see 0/+5V on USB, it's lower-voltage differential - and RS232 doesn't require the full voltage either, you're more likely to see about +- 8V)I wouldn't use auto level, because it will probably try to adjust the trigger level when the data is transmitted, and you won't see anything while it adjusts. Set the level manually to 0V.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 04:10:45 pm
content: Quote from: c4757p on September 24, 2013, 04:03:26 pmThanks. I see signals that look like noise (fuzzy and diagonal) and nothing over two volts; mostly either 1-2 volts or in the millivolts. Nothing that resembles square waves. It might be that I don't have a really good understanding of setting the triggering. For what it's worth I have a Tektronix 2247A. (The photo isn't my unit - just a photo that sort of shows the trigger layout toward the right side of the scope.) I'm guessing "manually" means use the "NORM" trigger setting?

author: c4757p
author_rank: Super Contributor
timestamp: September 24, 2013, 04:24:48 pm
content: NORM or AUTO - NORM will only display if there is a signal to trigger on; AUTO will trigger by itself if the signal is absent, so there's always something on the screen.Hmm... I suspect the probing setup. How exactly are you connecting the probes? You have connected ground, right?Once you have a display, you can play with the holdoff control to see if you can get the whole signal to display. Failing that, you can probably hack together a simple 555 circuit to isolate the start bit, then trigger on that.

author: AG6QR
author_rank: Frequent Contributor
timestamp: September 24, 2013, 04:32:03 pm
content: To get started, set the time base very slow, try something in the neighborhood of a second per division. This won't let you pick out the ones and zeroes of individual bytes, but it will let you see the range of voltages present. Set the trigger to "free run", where it just continuously sweeps without waiting for a trigger event. (Auto could work, but it will wait a while before sweeping when no trigger is present). This way you can concentrate on figuring out the vertical range without worrying about triggering.Set the vertical scale at something like 2V/div. Ground the probe and center the trace. You should see it sweep slowly from left to right across the time axis line of the screen, repeating the scan continuously.Now probe the circuit, and watch the trace both while you're sending characters and while the line is silent. You should get varying voltages. Adjust your vertical scale and position as appropriate so that the trace mostly fills the available vertical space.Now speed up the sweep to something like 0.1 s/div and adjust the triggering so that it triggers on a rising or falling slope in the range of voltages you're seeing. You should be able to get it so that it triggers when you send a character. Finally, speed up the sweep so that you can see the individual bits.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 04:33:32 pm
content: Quote from: c4757p on September 24, 2013, 04:24:48 pmI have the male end of the Tek probe inserted into the female RxD and the probe ground clip attached to the female GND with a short piece of wire (into the female GND). Might be something flakey about the connection but I've tried pretty hard to make good connections.I've also payed with the holdoff control - I'm not 100% sure but I don't think this is the issue.I happen to have recently done a simple project with a 555 but I'm inclined to think my skills with the 555 would make this approach to solving the RS232 issue more complicated rather than less complicated - but I appreciate the creativityAt about 1:53 in the video the demo shows how the AC and DC signals can viewed - what the demo shows is fairly close to what I've been seeing on my scope. I've been just using DC coupling - any chance I should have been using AC? (Duh??) Thx- Are we pretty sure the characters are viewable as clean rising and falling square waves on an analog scope? I thought the trigger just slowed down a sweep of a continuous signal to make it look like the signal is stationary? On my analog scope I don't see how I can actually freeze a one shot signal, but maybe I'm not understanding something (VERY possible).

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 04:38:13 pm
content: Quote from: AG6QR on September 24, 2013, 04:32:03 pmThanks - this is very close to what I have been doing (I think).Just to confirm, when I set the sweep to very slow I can get it so slow that I see the dot go from left to right very slowly, and then I have gradually increased the speed. But I will go back and retrace your suggested process and see if I can get it to show the data signals. Thx again

author: c4757p
author_rank: Super Contributor
timestamp: September 24, 2013, 04:38:54 pm
content: It won't freeze a one-shot signal, but keep in mind that a digital signalisrepetitive. It won't see a transmission as one event, it will trigger on each edge. If you want to see the whole transmission, you could set up the computer to transmit repeatedly, as well.I don't see a problem with themechanicalway you are probing. But... have you checked the pinout?RXD is pin 2. What end are you probing at? The signal should be going into the receiving computer on pin 2, or coming out the transmitting computer on pin 3.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 04:53:42 pm
content: Quote from: c4757p on September 24, 2013, 04:38:54 pmc4757p - Thanks, very nice of you to post that pinout diagram.It is similar to the diagram supplied in the StarTech manual but a bit different.In the StarTech manual it also shows Pin 5 as the Ground - so we are good on that.The StarTech manual shows Pin 3 as RxD - which I would think is the pin on which the RS232 connector is receiving data. So, Pin 3 (the middle pin on the long side) is what I have been primarily trying to get working with the scope probe. But just in case of some confusion, I have also tried Pin 2 (which is labeled by StarTech as TxD).Your diagram might be the official/conventional pinout; maybe the StarTech is their proprietary way of doing things - possibly because of how the USB end works but I don't see why that would be the case. For now, I'm trying both Pin 3 and Pin 2 in concert with the GND on Pin 5.I'll keep "plugging".- Just to confirm, the scope should be on DC coupling, right?

author: Unknown
author_rank: Unknown
timestamp: September 24, 2013, 04:56:11 pm
content: A continuous stream of capital Us (eg. UUUUUUUUUUUUUUU...) is an excellent test signal. In 8N1 (8 bits, no parity, 1 stop bit) format this produces a square wave.

author: c4757p
author_rank: Super Contributor
timestamp: September 24, 2013, 04:57:26 pm
content: Yep, DC coupling.Quote from: alm on September 24, 2013, 04:56:11 pmHow the hell did I never think of that?

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 04:58:30 pm
content: Quote from: alm on September 24, 2013, 04:56:11 pmCool, Thanks, alm. I will try Capital Us next (already have 8 bits, no parity, 1 stop bit).

author: AG6QR
author_rank: Frequent Contributor
timestamp: September 24, 2013, 05:17:08 pm
content: Quote from: Electro Fan on September 24, 2013, 04:33:32 pmEven if you're not getting the triggering right, as long as the sweep is running, the worst that will happen is that you'll get a confused mass of multiple digital signals on top of each other. You should still be able to see that the signal spends most of its time at the "high" and "low" voltage range of the RS-232 signal lines (supposed to be +-12V or so, might be 0V to 5V or some other range).The trigger doesn't "slow down", in the sense that, once the sweep starts, it progresses across the screen at the selected speed no matter what. But if you meant "slow down" to mean that the trigger causes each sweep to wait until some starting condition is met before it will start the sweep, you've got it.An analog scope isn't the best tool for viewing a one shot digital waveform, especially not if a digital scope is available. But there are ways to do it on an analog scope anyway.One is to turn the "one shot" digital waveform into a repetitive waveform. Autorepeating a "U" as alm suggests is great. Setting the trigger holdoff will be important to trigger on only the first bit of the "U".Another way is to use the screen persistance to see a true single shot. Darken your room. Turn the trace brightness up. Send one character.Sometimes people would use photographic means instead of just relying on the phosphor persistance. If you can set a camera on a tripod to watch the screen, in a darkened room, with a long shutter speed, you might be able to capture a single trace. Scope cameras have been designed to make the process easier. Many of them would use polaroid film. They're pretty much obsolete these days.Even the lowest of today's hobby grade digital scopes makes observing one-shot digital signals so much easier than it is on a top notch analog scope.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 05:26:48 pm
content: Thanks everyone.Here's the report. I've got the good news and the bad news.The good news is that I have found the cap lock key and the U key and without a doubt I can send a capital U or as many as I want in either direction from computer to computerThe bad news is that not much else seems to be workingI have tried setting the trigger around 1.5 volts (and higher and lower, even at -1.5 volts in case something is inverted) but nothing seems to trigger in any mode (including Norm or Auto).I'm sure it's user error. I haven't tried the dark room persistence idea yet but I'll revisit everything as best I can.I'm pretty sure this is a cosmic message that it's getting close to time for a DSO

author: dfmischler
author_rank: Frequent Contributor
timestamp: September 24, 2013, 05:38:11 pm
content: When no data is flowing and everything is cabled up you should see a negative voltage on Rx and Tx. Do you see that? What voltage do you see there?

author: Electro Fan
author_rank: Super Contributor
timestamp: September 24, 2013, 05:47:30 pm
content: Quote from: dfmischler on September 24, 2013, 05:38:11 pmHey, hey, some progress!When I leave out the StarTech cable and I connect the scope (or a DMM) directly to the male pins on the RS232 connector (on the other computer) I get 12 volts if I probe the Ground pin with the plus (red) on the DMM and the I probe the middle (3 Pin what StarTech calls RxD) with the negative (black) on the DMM.(ie, you were right - I was seeing negative voltage which is what caused me to put the red/positive DMM probe on the GND and the black/negative DMM probe on the RxD); that was my way of getting postive voltage - which I figured would help me set the trigger on the scope above the 0/Gnd line, but I realize I can trigger south of the line too.) The good news is that I have something to measureI'm going to try redoing the sweeping and triggering by probing the male pins on the RS232 port of the other computer and quit trying to probe the female connector on the StarTech cable; I'm getting the StarTech cable out of the equation. It works fine for data transfer but for now I'm confident the computer with the RS232 is working so I'll focus on that as the source of the data. I'll try both Pin 3 and Pin 2 to make sure I'm not confusing the send and receive.Thanks

author: Unknown
author_rank: Unknown
timestamp: September 24, 2013, 07:44:40 pm
content: You can't reverse the scope leads (attach ground lead to pin 2/3 and probe tip to the ground pin / shell) like you did with the DMM. The scope's ground lead is grounded, and so is the computer (probably), so you would be shorting out the output. Not likely to be harmful, but it won't allow you to measure anything.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 12:21:25 am
content: Back at it again.I took some color female to male breadboard jumper wires and inserted all the female jumper ends over the male pinouts on the RS232 port. Then I inserted all the male jumper ends into the female RS232 cable connector and ran the cable back to the USB port on the other computer. The text transfers nicely back and forth between the computers so I have confidence that my jumper wires attached to the 9 pins of the RS232 port on the computer are making good connections.I can use the DMM to probe Pin 5 GND (with DMM negative) and Pin 3 RxD (with DMM positive) and I get -12 volts (actually -11.98). When I connect the DMM probe to Pin 2 TxD (with DMM positive) I get +11.33 volts.When I replace the DMM probes with the scope probe the voltage readings on the scope correspond to the DMM voltage readings but when I push the keys I can't detect any waveforms and no combination of triggers reveals anything.That's about it so far......The silly thing is that this is sort of funGo figure

author: c4757p
author_rank: Super Contributor
timestamp: September 25, 2013, 12:24:34 am
content: Is the scope interfering with the actual transmission of data, or do you get a proper transfer with the scope connected?

author: Unknown
author_rank: Unknown
timestamp: September 25, 2013, 12:30:21 am
content: Do you get a decent square wave if you use the same probe, channel and front panel setup to probe the probe calibration signal available on the front panel of the scope? This should be a 1 kHz square wave (a period should be one div wide on 1 ms/div) and is somewhat similar to an RS-232 signal. My guess that there is something wrong with the trigger settings, like triggering set to line, or HF reject, or something else. I think W2AEW has some usefulvideosavailable. This one might be relevant:

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 12:31:38 am
content: Quote from: c4757p on September 25, 2013, 12:24:34 amThat's a good question, but I don't know how to determine the answer. It sure doesn't seem like anything other than static (unchanging) voltage is getting through to the scope. Right now the scope is connected to the GND and TxD and it reads about 11.25 volts. When I push a key on the computer I can't see any change in the voltage (numerically or with a waveform).I'm wondering if despite what the demo showed in the video if I'm really sending any voltage change over just the two wires? When I connect all nine wires/pins the text transfers but maybe something about my setup is not really signalling anything up and down? It's kind of challenge because I can't figure out if it's the pin connection/assignment, or if it's something I'm doing that is not enabling the triggering to occur. I need to find a way to isolate which of these is the issue.Thanks

author: c4757p
author_rank: Super Contributor
timestamp: September 25, 2013, 12:34:28 am
content: OK. Don't worry about triggering. Set up your computer to emit a constant square wave (UUUUUUU........ as above). Then put the scope in auto trigger mode, with the trigger level anywhere, perhaps 1ms/div 5V/div, and probe around on the cable. In auto mode, it will still plot the signal even if it can't lock onto it, so you'll get a wide illuminated region. Get that working first. And do it spliced into the cable while the other computer is receiving, so you can verify that the transfer is taking place.And like alm said, check the cal signal to make sure the scope and probe work.

author: Unknown
author_rank: Unknown
timestamp: September 25, 2013, 12:42:26 am
content: If you're unsure about pin assignment, then try connecting as few wires as possible. You only need RX, TX and ground if you're not using flow control (turn this off on both sides). You can even disconnect RX on one side, and that side is only able to send. If you're still receiving data on the other side, you can be sure that that one remaining wire is TX. RS-232 uses a voltage swing of at least +/- 3 V or so, so there will be voltage signals on that line.Of course you would do this after ensuring you can display a known-good signal on the scope, see my earlier post for some hints. If you're unable to get the probe cal signal to display even after watching W2AEW's video, then a good picture of the scope's front panel showing all of your settings (i.e. your scope with the settings you're using) might be useful to troubleshoot any issue with scope settings.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 12:46:36 am
content: Quote from: alm on September 25, 2013, 12:30:21 amYes, I can get a very nice 1 kHz square wave using the front panel test feature and I can easily move the trigger into the path of the square wave to stop the wave. Maybe this shows that my triggering system and my basic triggering skills might be ok in which case the issue starts to look like maybe although the static voltage is making it to the scope from the computer the key presses aren't toggling the voltage up and down?If I send one character from the keyboard (like a capital U) that should theoretically send 9 bits (8 data bits and a stop bit) in the form of 9 1s and 0s, ie 9 ups and downs, right? And given the voltage of RxD and TxD the voltage should toggle between roughly +13 volts and roughly -13 volts. So, if I start out high with no key presses, at +13 volts, then maybe I should set the trigger between 0 and -13 volts, or should I set it on the positive side just slightly above 0 volts?Thanks again

author: c4757p
author_rank: Super Contributor
timestamp: September 25, 2013, 12:49:10 am
content: Like I said, if you set the computer to transmit continuously, you don't have to predict where to set the trigger, because you'll have a constant square wave. Just set it, probe, and play with the controls.

author: Unknown
author_rank: Unknown
timestamp: September 25, 2013, 12:56:42 am
content: If the probe cal signal works, you can transmit data across the RS-232 link but you're not seeing a signal, then a connection problem seems the most likely to me. Especially ground, since you don't need to connect a ground lead for the probe cal signal. Try switching between the signal ground and the shield of the RS-232 connector (you can sort of clip onto the screws / posts. Try a different probe or set the probe to 1x, if available.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 01:32:52 am
content: Quote from: alm on September 25, 2013, 12:56:42 amAlm thanks. I have moved the ground connection from the scope probe to the PC chassis (to a screw on the RS232 port).Let's go back a few steps. Do you think I should be on Pin 3 RxD where I get -12 volts, or on the Pin 2 TxD where I get +11.33 volts? I would think we want Pin 2 TxD as I assume that is the pin that is transmitting (from the PC to the scope).Next, if the static (non transmitting) voltage is +11.33 volts, then what is the expected voltage when a key is depressed and at least some of the bits go low? (Where should the trigger be set? A few volts above zero, or between 0 and -12 volts?)Thanks for the patience and persistence.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 01:38:34 am
content: Quote from: c4757p on September 25, 2013, 12:49:10 amI don't know how I'm going to get the computer to transmit continuously. So far I can hit a key or several keys in a row manually (or for as long as I like keying), or I can transmit a relatively long file full of characters (but even that will send a page or so in about a second). I like the idea of transmitting continuously because then to your point I could just play with the trigger until it finds something. Just not sure how to make it transmit continuously. Thx

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 04:32:21 am
content: Ok, as much fun as this is I'm starting to wonder.... Anyone out there with an analog oscilloscope and a PC with hyperterminal and an RS232 port want to see if this really works on an analog scope?

author: AndyC_772
author_rank: Super Contributor
timestamp: September 25, 2013, 06:52:22 am
content: I think you're going to struggle to see anything much on an analogue scope.Each RS232 character takes 10 bit times to transmit (assuming 8N1 data format). At 9600 baud, one character takes 1/960 sec, or about 1 millisecond to transmit. Even if you hold down a key in your terminal software and get 20 repeats/second, the line is busy for 20ms and idle for 980ms per second.Set up the scope to trigger on rising edges, with a trigger level of 0V, and use normal (not auto) triggering. This will ensure you trigger on the beginning of the start bit, and only see the active period. Set the time base so each bit is about 1 division wide - say, 100us/div for 9600 baud.Press a key and your scope should trigger. Most scopes have a trigger LED or similar indicator to let you know when they've triggered OK, so even if you don't see much on the screen, you should at least see the trigger light flash.Once it's triggering OK, turn the CRT trace brightness way up, and see what you can pick out. If you can't see anything much when pressing keys in your terminal software, try sending a long file to keep the link actively transmitting more of the time.This sort of sporadic, non-repetitive signal is just the sort of signal that digital storage scopes are much better at showing, because they can capture the trace once and then show it continuously until the next trigger comes along. The brightness and persistance problems you get with trying to examine the signal on an analogue scope just go away. If you do a lot of work with serial interfaces like this, an inexpensive DSO would be money well spent - and once you've tried one with serial UART decoding built in, you won't want to go back.

author: Unknown
author_rank: Unknown
timestamp: September 25, 2013, 09:21:31 am
content: Sometimes you can make a sporadic signal continuous, like the continuous stream. I was thinking wire rate, not keyboard repeat rate. Any programming language that can access the serial port can do this, but I guess you can also make a 1MB file with a million times the same character and send that.

author: amyk
author_rank: Super Contributor
timestamp: September 25, 2013, 10:01:12 am
content: Quote from: Electro Fan on September 25, 2013, 01:38:34 amSometimes the obvious solution is the one overlooked...Also turn the baud rate all the way down. 110 or so.

author: dfmischler
author_rank: Frequent Contributor
timestamp: September 25, 2013, 12:09:13 pm
content: Quote from: Electro Fan on September 25, 2013, 12:21:25 amIf no data is flowing the signal should be marking (i.e. negative). It should only be spacing (i.e. positive) to denote 0 bits in the transmission, or a break condition. This applies to both transmit and receive signals.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 04:35:44 pm
content: Quote from: AndyC_772 on September 25, 2013, 06:52:22 amAndy, thanks. I will try 9600 and 100us/div.I'm also going to try a much slower rate as suggested by amyk; 2400 to 110 or so. Any suggestions for the time div settings at these lower speeds or do you still like 100us/div? I've created a relatively large text file that just repeats a full line of text. So far it has carriage returns after each line. I'm not sure if the carriage returns are helping or hurting the process of trying to trigger the character strings - any thoughts on that? (My guess is that a carriage retrun is just another ASCII character and the scope doesn't know if I'm sending the Gettysburg Address or anything else - it's just a bunch of 1s and 0s and the longer I can keep 1s and 0s flowing at a steady rate the longer I have to twiddle dials while I try to figure out how to trigger on the overall serial string.)This is a good learning process and I'm just wondering if it's something I'm missing or if even a more experienced scope operator would have find this to be difficult or impossible? Either way, I'm confident that on a DSO it is very doable - I'd just like to run this to ground and draw some some conclusion.Getting serial data into a scope and having it help with decoding the data would definitely be a nice tool to have... I've got it narrowed down to about 5 DSO models

author: Electro Fan
author_rank: Super Contributor
timestamp: September 25, 2013, 04:52:28 pm
content: Quote from: dfmischler on September 25, 2013, 12:09:13 pmdfmischler, thank you. So, are you saying (given what I described above) that when no data is flowing I should be at -12 volts? And are you saying that 0 bits (which are are part of some characters) will be represented by approximately +11 volts? If so, what about "1s"? What voltage would you expect for 1s? (Will those be treated as "markings" which are -12 volts, or something else?)I think I need to get a grip on the expected voltage when the proper two wires are connected to the computer when it is powered up but nothing is being transmitted and what voltages are expected for each "0" and each "1" as they reach the scope.

author: AG6QR
author_rank: Frequent Contributor
timestamp: September 25, 2013, 05:47:43 pm
content: Quote from: Electro Fan on September 25, 2013, 04:52:28 pmThe glib answer is, that's what you need to use your scope to determine.There are two voltage levels used, called "mark" and "space". A mark is low voltage, and a space is high voltage. The precise levels of the voltages depends on the drivers, but they might be -12V for mark, +12V for space, or maybe something different. I would expect them to fall completely within the +15/-15 V range, and I'd expect them to be separated by at least a few volts. To find more details than that, measure them with your scope.Put your scope on 5V per division and see what you see. That will surely display both the mark and space voltages, but maybe at poor resolution. After you see the voltages, adjust the position and scale of the vertical controls to make it so that they are displayed with better resolution, but still fall entirely on the display.When the line is idle, it should have mark voltage. The start bit is a space voltage. After the start bit, you should see mark voltage for every 1, and space voltage for every 0, until the stop bit. Something like this:http://en.wikipedia.org/wiki/File:Rs232_oscilloscope_trace.svgOne general strategy for probing an unknown signal is to start by using auto triggering with a very slow time base, say 1s/div, and a low enough gain on the vertical section so that you see the whole signal, in this case 5V/div should be plenty. Then watch the trace as you adjust the vertical section to capture the full range of the signal. After you've got the vertical section approximately set, speed up the sweep to see the transitions, and adjust the trigger to stabilize the waveform. Finally, you might want to adjust both vertical and horizontal controls to "zoom in" on something or fine tune the display to your liking.

author: andtfoot
author_rank: Unknown
timestamp: September 25, 2013, 06:00:14 pm
content: Quote from: Electro Fan on September 25, 2013, 04:52:28 pmThat is correct. A logic 1 is the negative voltage (mark), which is also the standby state.I'm not sure how familiar you are with RS-232, but basically there are two types of devices: Data Terminal Equipment (DTE) and Data Communications Equipment (DCE)If you are connecting a DTE to a DCE then you use a straight through cable. Otherwise, a DTE to a DTE (or DCE to DCE) requires a crossover, or null modem, cable.A computer generally has a DTE port.This means that according to the standard, it should be transmitting on pin 3 of its port. If you are using a crossover/null modem, then you would be looking at pin 2.Are you checking on the oscilloscope with both devices connected, or only the one?I actually built a tester I use at work, which is basically a diode from ground through two different LEDS; one to pin 2, and one to pin 3. Whichever pin has the negative voltage on it lights the relevant colour LED. This tells me which pin is the output pin of that device (the one that lights up).It's very rare that it doesn't work.

author: amyk
author_rank: Super Contributor
timestamp: September 25, 2013, 09:47:36 pm
content: Quote from: Electro Fan on September 25, 2013, 04:35:44 pmNo, 100us is much too fast - at 110 baud each bit is ~9.1ms and a character is around 91ms. 100ms/div is more like it.If you set keyboard autorepeat to the fastest and leave a weight on a key it's 30cps which is faster than 110 baud can handle so it'll start dropping characters but otherwise the UART is going to be transmitting continuously. That should give a good signal to scope.

author: andtfoot
author_rank: Unknown
timestamp: September 26, 2013, 01:01:18 am
content: First up, here is that tester I made that I mentioned:This is connected straight to the port. Being a computer, it is a DTE port and therefore transmitting on pin 3. The tester shows this with a red LED (and this is the pin I tested on my 'scope).This is with a crossover in place. The port is now transmitting on pin 2, hence the green LED this time.I then hooked up my 'scope, and usedRealtermto transmit a constant string of capital U. I use this program because I know it outputs on the port as soon as you hit the key. I have found some terminal emulation software that only outputs once you hit 'Enter' or similar.I have the baud rate on the port set to 1200. The scope is set to 2V/div vertical, and 1ms/div horizontal. I have it triggered off the negative edge roughly as it passes through ground.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 03:47:26 am
content: Quote from: andtfoot on September 25, 2013, 06:00:14 pmYes, I am assuming I have a DTE (the port on the computer) and therefore I am focusing on Pin 3.I have the oscilloscope probe connected to Pin 3 with the ground from the probe attached to Pin 5.I have reset Hyperterminal to 110 baud. The scope is set for .1 sec (100 milliseconds).When no key is pressed the scope is seeing -12.1 volts.When I press keys so far no triggering is occuring but I am still working at it. Seems like I should be getting closer.Thanks for all the suggestions - please keep them coming!

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 03:53:22 am
content: Quote from: andtfoot on September 26, 2013, 01:01:18 amOk, your post has given me full confidence that this is doable - hard to argue with a photo of the exact same model of scope showing the exact settings I need. Thanks. I am working to duplicate your results. Will keep you posted.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 04:16:35 am
content: andtfoot,I have duplicated your setup. 1200 baud, 2v/div, 1 ms div. Every light on my scope is the same as yours (including the alt under chop).I am probing directly onto Pin 5 and Pin 3 on the computer port.When no key is pressed my volt meter says -12 volts if I select DC on the screen menu (on the right side above +Peak, -Peak, PK-PK; I think you have your menu turned off); when I select PK-PK so the display shows CH1 PK-PK as your photo shows I get about 0.4V.I have a second computer with a RS232 port I am also testing and it causes almost the same results except that instead of getting -12 volts I get -7 volts.But no key pushing with your specific triggering settings or any trigger settings shows the square wave pattern you have or any pattern.I am going to feel very silly when I find out what I have goofed on but so far it is mysterious.

author: andtfoot
author_rank: Unknown
timestamp: September 26, 2013, 04:41:31 am
content: Just to confirm... You don't have any kind of flow control turned on, right?

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 05:18:18 am
content: Quote from: andtfoot on September 26, 2013, 04:41:31 amuh oh... I had hardware flow control on; I have turned it off now (set flow control to none) and will repeat the testing....

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 05:30:47 am
content: Turning off flow control didn't seem to help (just curious.... what impact would flow control have on such a test?)On a possibly related matter, I have found that even though I have echo turned on in both copies (on both computers) in Hyperterminal, the characters don't echo on either (local) screen - but they do successfully transmit over their respective RS232 ports and the RS232 cable in between. (It's possible that this is just a bug in Hyperterminal in an early version of the program.)

author: IanB
author_rank: Super Contributor
timestamp: September 26, 2013, 05:43:11 am
content: Quote from: Electro Fan on September 26, 2013, 05:30:47 amIn some circumstances it is necessary to assert the DTR (data terminal ready) signal at the receiver before the sender will transmit any data.This is unlikely to be the case with a simple PC serial port, however.To make absolutely sure of what you are trying to detect with the scope, you should make a complete link from one terminal to the another with an RS232 breakout device in the middle. Check that characters are sending and receiving from one end to the other and then probe the signals in the middle via the breakout box. Such breakout boxes often have LEDs to monitor the signals, and the TX (or RX) leds should flicker when you send characters. Once you see an LED flickering, probe this pin with the scope.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 08:03:38 am
content: HEY, HEY - MISSION CONTROL - WE HAVE LIFT OFF!First the good (great) news. We have successfully transmitted ASCII characters via RS232 Pins 3 and 5 to a Tektronix 2247A (analog scope).As can be seen in the attached image we have a steady stream of capital U characters triggered by the scope. Thank you to alm who pointed out that "A continuous stream of capital Us (eg. UUUUUUUUUUUUUUU...) is an excellent test signal. In 8N1 (8 bits, no parity, 1 stop bit) format this produces a square wave."Also, thanks very much to andtfoot for getting the whole thing to work on his Tek 2247A which gave me confidence that there was light at the end of the tunnel (if I would just get my head of the sand and turn the light on).Additionally, I'd like to thank each of you for your assistance, support, patience and persistence:c4757pAG6QRalmdfmischlerAndyC_722amykandtfoot (brother 2247Aer)IanBI wish I could tell you what took me so long but here are a few things in case anyone else might want to go down a similar path.The settings I homed in on were 1200 baud, 5v/div and 1ms/div. The winning transmission occurred after I kicked off a fairly long text file of random characters. Sending the long text file rather than keying characters one or a few at a time gave me extra time to sit at the scope and figure out how to find/trigger the signal. I sent a bunch of text files before finally getting it figured out. I'm sure it would have taken longer just hitting a few keys here or there. Keeping the baud rate low was a good idea too as it also gives more viewing time. After I got the first successful transmissions I realized they didn’t look quite so nice for the photo so I made a new file and photo using all capital U characters. (I've kept the photo of original first successful non capital U transmission in case the Smithsonian wants to put it along side the “Mr. Watson, come here, I need you” exhibit.)It turns out that Auto Level, AUTO, and NORM triggering all work fine.The key thing is that on an analog scope the triggered event will only remain in place while the string is being transmitted. A single key stroke results in triggered event about the duration of a key stroke; a long text file can last many seconds - but when the transmission is over the triggered signal is gone. I guess this is one reason DSOs are popularAnother part of the hold up was making sure I had the right pins on the RS232 port (I know, how hard could it be to find the right pins?). Another contribution to slow results was that the copies of Hyperterminal I have are near 1.0 and they don't support echo. So I could confirm that my two computers were sending and receiving while they were connected - but when I disconnected the cable between them so I could probe the pins on either port I couldn't be 100% sure any data was still going out the probed port since the local receiving computer was disconnected and the local sending computer (that I probed) didn't have the echo feature. If I had it to do over again, I'd have started by making sure I had software that would provide a local echo.I suspect that my scope operating skills and especially my triggering abilities have now moved up from close to non-existent to 101 - I'm sure this was part of the holdup. I'd hate to admit that I might have been looking for signals that were off the screen because I lost track of the vertical position - hmmmm.Anyway, my plan is take it all apart and prove I can put it back together and find/trigger the signal much faster on the next pass. Then I'm going to spend some time studying ASCII characters. I plan to see what happens when I go from no parity to even, odd, mark, or space parity and from 1 stop bit to 2 stop bits, etc. After that I’d like to see if I can generate specific ASCII characters without the computer just using a power supply and some type of programming. I know it's very fundamental and simple stuff for lots of folks here but I’m loving the ability to observe and manage in a hands-on manner at the intersection of A to D.Thanks again to each of you. Go EEVbloggers!Electro Fan(A Big Fan of Electronic Things, both Analog and Digital, both Hardware and Software, both Computing and Networking, both Wired and Wireless/RF)

author: AndyC_772
author_rank: Super Contributor
timestamp: September 26, 2013, 09:15:15 am
content: YayIf you want to study the effect of changing the data format, it's really important that you get a stable trace which always triggers in the same place, ideally at the beginning of the start bit. The proper trigger condition for this is a rising edge around zero volts.One difficulty you'll encounter sooner or later is that rising edges occur at many times, every time the data transmitted changes from 1 to 0. If the scope triggers on data bits instead of just start bits, the bit patterns on successive sweeps won't necessarily line up, and you won't see a stable trace.To work around this, you'll need to make use of the Hold Off control, which temporarily disables the trigger circuit for a period of time after each trigger event. Set the Hold Off period to be at least as long as it takes to send a complete character - 10 bit times at whatever baud rate you're using - and the trigger circuit won't re-arm until the character is complete and the line is idle again. This ensures that the first edge it sees will be the start bit.This technique relies on there being an idle period in between characters on the line, which you'll get if you hold down a key. If you send a long file, triggering (not to mention identifying which bit is which) will be much more difficult.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 09:37:46 am
content: Quote from: AndyC_772 on September 26, 2013, 09:15:15 amOk, 1200 baud (roughly 1200 bits per second?) would mean 10 bits would take 1/120th of a second; not sure if I calculated that right but even if I did, how do I specify precisely that amount of hold off? On my scope I can use the hold off knob by simply eye-balling when the pattern stabilizes, but I'm sure if I can key in a specific time value - or maybe I'm confused, some more

author: AG6QR
author_rank: Frequent Contributor
timestamp: September 26, 2013, 05:23:06 pm
content: Quote from: Electro Fan on September 26, 2013, 09:37:46 amI don't know your scope well enough to say what options you have for specifying a precise holdoff value. But even if you have to adjust it only by turning an analog knob, you can achieve the right result by sending something that is NOT a "U" and adjusting holdoff to the lowest value that gives you a good stable pattern. For example, a "Z" is hex 5A, which means that the second four bits are reverse of the first four. It's got plenty of transitions, but you'll only get that sequence of two '1's to be stable in the right spot if your trigger holdoff is set properly.Also, I'd recommend you make a simple RS-232 breakout box so that you can probe things while devices are talking to each other. It can be as simple as taking male and female DE-9 connectors, wiring everything straight through, but expose the insulation on pins 2 & 3, as well as pin 5, so that you can easily connect scope probes to 2&3 and ground clips to pin 5.When you have a DSO, you can use that kind of breakout box to really dig in to serial device protocols. With a 2 channel scope, you put pins 2 & 3 each on a channel, and you can see the call and response as two devices talk to each other.

author: Electro Fan
author_rank: Super Contributor
timestamp: September 26, 2013, 10:22:42 pm
content: Quote from: AG6QR on September 26, 2013, 05:23:06 pmI get it - Very cool suggestions!Thanks