On Sun, 20 Jun 2010 18:34:48 -0500, "rowan.bradley"
<rowan@n_o_s_p_a_m.sylvester-bradley.org> wrote:
>Anyone know the quickest or easiest way of recording a serial data stream
>and timestamping each byte with a resolution of at least 1ms (preferably
>finer)? I can only find cheap or free programs with less resolution, or
>very expensive solutions, often involving special hardware.
>
>I only need to monitor one port, and I don't need to send any characters
>(actually I'm snooping on an RS485 bus).
>
>I'm prepared to use an old PC with a "real" serial port, run MSDOS, Linux
>or whatever other OS will do the job, use some sort of microprocessor to
>capture the data (preferably one I'm familiar with, such as 8051 family or
>PIC) or anything else so long as it's quick and cheap. I just need to get
>the job done, preferably tomorrow!
>
>If possible I'd like it to run at a non-standard baud rate (62,500 baud).
I'm not sure an IBM PC uart can run at that rate. I think
57600 is doable, though. Something that bothers me about
your request is this 1ms resolution. At 62500 bps, one stop
and one start, this is 6250 cps. That works out to 160us per
character. Yet you don't seem to __require__ better than 1ms
resolution? (I do read you saying that you'd like better.)
Okay. None of that really helps. The IBM PC is everywhere,
so I understand that desire. But I don't think you can nail
the rate at 62500. If you can use 57600, I think that works
on the PC. There is a 16-bit timer on the PC. It doesn't
interrupt fast enough for you, but you can read it when the
characters arrive. So if you use DOS, write in assembly
code, can accept the 57600 bps rate, then it's doable. I
keep new boxes of DOS 5.0 laying about and 80386 and 80486
machines here with nice ISA buses, just for doing stuff like
this. But you may not have them. And new PCs seem to be
avoiding RS-232 ports more and more.
USB would barely get you by (one of those USB to RS-232
things), as I believe the max 'pace' is 1ms there. (I don't
know USB that well, but I disagree with Paul on this subject
unless you dig _really_ deep into the USB VxD level of
stuff.) In general, I don't know how closely you can track
it through through the HID driver and all of the Windows
layers. I'd probably avoid it, imagining the work there to
be way too much to bite off for too little potential.
Which gets to either someone's device you can buy -- you've
already looked -- or else something you pony up. I'd wire
something up from crap I have around here. Some don't have
the level shifters, but you are only looking to receive, not
send, so you can easily use a BJT and a few resistors there
(cheap and easy.) Software is extra, of course.
If you did have one of those USB-RS232 units and could wire
up to it (I got one included in the $24 MSP430 Chronos kit I
bought, for example), you might choose a micro with two UARTS
and wire one of them to the USB-RS232 connector and send
serial data in that direction that includes the received
characters and their time stamps for logging onto the PC and
wire the other one to monitor your 62500 bps line. Add time
stamps and send to the USB side. Not too much software that
way and you have a huge data logger, then. (You didn't
mention how much data must be logged, which is yet another
potential problem.)
Jon
|