I'd like to be able to measure the baud rate that a couple of sealed devices are using to talk to each other over a serial (RS232) cable. I know that they only use the common baud rates 9600, 19200, etc.
Can anybody give me some pointers on a circuit I could build that I could daisy chain with the serial cable to do this? A digital readout would be nice, but an analogue dial or set of LEDs would do. Or perhaps even a circuit that generates an audio tone at a frequency that is some fraction of the baud rate, and the tone could be compared to a set of reference tones (or even tuning forks) by the user.
I'd like to build something cheap, compact and simple, rather than buying a hardware or software protocol analyser.
Get two female and one male serial connectors (DB9 or 25 as appropriate), and some wire, and make a jumper where you can tap off the ground and tx/rx wires. Connect the tap off wires to the rx and ground on a computer. Get the free Portmon program off the net and run it on the computer to monitor the activity between the two devices.
Find the serial monitor that HeathKit once sold. It has male & female DB connectors so it can be plugged in the serial line. Uses LEDs to display the baud rate being sensed, up to 19,200 or 38,400 (not sure about the highest rate - haven't used mine in a while ;-)
Well, you could use the serial data lines (tx,rx) to clock a binary counter such as CD4040 and hang a few LEDs off the counter bits. That would give a visual indication but you probably need a extra 9 volt battery for power. Also the data will be bi-polar so you need a diode to block the negative swings into the counter and also limit the counter input to +9. Shouldn't take too many parts.
Thanks for all of the replies. In answer to some of the issues raised:
- I hadn't really thought about baud vs. bits/s, but aren't they the same thing for a 2-level scheme like RS232?
- Ideally I'd like to build something that requires no additional power supply, and can make do with the 10mA or so that can be leached from the RS232 lines. The idea of building useful circuits that are powered from signal lines appeals to me, eg.
the easiest way is to use a microcontroller programmed to look at pulse lengths. it may be possible to finesse an LM3915 into doing the task too.
for line powered operation there may be enough power in the line your monitoring to run the LED at sufficient brightness. you may need to recover the power lost when the line is on the wrong side of ground.
here's an idea.
.------ASCII-SCHEMATIC----------------------------------------. | This is an ascii schematic, if the diagram appears garbled | | try switching to a fixed-pitch font (courier works well) | | pasting it into notepad works well on ms-windows. | | or in google groups "view source" (found under options) | `-------------------------------------------------------------' LED1 on 300 // // in --[4.7K]-+----------+--->|---+-->|--------> to microcontroller pins | | | | | | // 600 +->|- VCC | +-->|--------> | V | | T | // 1200 | | +-->|-------->
here the LEDs operate like a zener diode to regulate the voltage to the microcontroller the balast led isd a slightly higher voltage led that the rate leds to stop the voltage giong too high when ther are all unlit and so that it goes out when any of the other leds are on. two LEDs in series will get you 3-6V depending on which LEDs you pick. (mostly it's determined by colour red, green is moddle, blue is high
the ballast led is a slightly higer voltage led that the other rate indicator leds pulse goes to an input pin on the micro. Vcc to the positive supply pin.
hmm... if you (ab)use the clamp diodes built into the micro to rectify, you get current on both half-cycles....
txd----[4K7]--------------------------------------. | .-----------------------------------|------. | // power led | | +->|+---+---+---+---+---+---+---+---|---. | | | | | | | | | | | | | | | | | | | | | | | | | | V V V V V V V V | | | .---+ T T T T T T T T | | | | | | | | | | | | | | | | | _-___-___-___-___-___-___-___-___-___-_. | | | | | | |+ | |-- _____ | | === 10uF | | | /||MEL ATtiny2313 | | | | |__' ~~~~~~ | | | | | | | | | `-_---_---_---_---_---_---_---_---_---_-' | | `---' | | | | | | | | | | | | | | | | | | | `---|--+ 1 1 1 1 1 1 l | | 1 ballast led A A A A A A A | | A | | | | | | | | | | `---+---+---+---+---+---+---|-------+--' | gnd-------------------------------------------'
the software would be the fun bit... maybe 30-60 lines of assembler... bye.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.