Monitor RS232 comms with millisecond resolution

Since the OP required receive only capability, configure the actual data network with 2 stop bits and the monitoring receiver with 1 stop bit.

In asynchronous mode, the synchronization occurs at the leading end of the start bit, defining the sampling point in the middle of the actual data bits. With a clock frequency error, the sampling point moves away from the middle of the bit and in the worst case falls into the next/previous data bit.

With two stop bits transmitted, there is a larger distance between the start bits of two bytes. When the receiver expects only one stop bit, the actual sampling point for the first (and only) stop bit can fall outside the actual first start bit transmitted into the second stop bit transmitted. This is quite OK and the receiver enters the idle state, waiting for the next proper start bit.

Reply to
Paul Keinanen
Loading thread data ...

.

You still need to be adequately synchronized for each data bit. While doubling up the stop bit might net you some extra slack on the stop bit, the prior (data or parity) bit still has to be sampled not-too- near its edge.

Besides, your idea puts the slack in the wrong place. With the available (x18) divider, the receiver will be running too fast, and will be sampling the stop bit too early - lengthening the stop bit doesn't actually help. If you used a x19 divider, the extra slack might help in detecting the stop bit (since the slack will now add in the helpful direction because the receiver will be running too slow), but you'll be even farther off center for the preceding parity/data bit.

But still, if the OP can guarantee the accuracy of the sender's clock (to rather better than the RS-232 standards), it should be possible to receive the stream with a x18 divider.

Reply to
robertwessel2

At 62.5 kbit/s the bit time is 16 us, thus +/-8 us error from the nominal sampling point from the middle of the bit period would be allowed.

Assuming startbit+8 data bits + 2 stop bits transmitted, the Rx sample point for the last data bit could be theoretically +8 us after the transmitted bit period midpoint. The transmitted midpoint is

8+8x16=136 us from the start of the start bit. The worst case Rx sample point would be at 136+8=144 us, corresponding to 8.5 Rx clock times, i.e Rx clock period of 16.94 us or 59028 bits/s. The sample point for the 1st stop bit would be 9.5 bit times from the start bit at 160.94 us, well before the next transmitted start bit at 176 us (or later).

Clearly 57600 bits/s would be out of question.

Those calculations assume nominal clock frequencies and extreme steep edges.

With 18.432 MHz crystal divided by 19 and then applying the internal UART x16 oversampling would produce 60632 bits/s Rx bit rate.

In the real world, the RS-232 parts are supposed to be slew rate limited, causing ISI, which of course limits how far from the nominal sample point you can go. Especially any noise in the start bit edge detection will also add error to the Rx sample points along the data bits. However, the original poster was talking about RS-485 network, in which even slew rate limited drivers are good for at least 250 kbit/s, thus the edges would be rather sharp.

Reply to
Paul Keinanen

Funny, all the discussions about baudrates and errors. I'd use an ISA COM card and simply replace the crystal... done it, works like a charm. Only 5 minutes work.

Meindert

Reply to
Meindert Sprang

Just be aware that ms resolution does not mean ms precision!

--
Saludos.
Ignacio G.T.
Reply to
Ignacio G. T.

That's assuming that:

1) The OP can change the configuration of the data network. [If that were the case, why not just change it to 57600 or 115200?] 2) The OP has a UART with an 18MHz clock instead of the standard 1.8MHz clock.

I'd bet both of your assumptions are false.

--
Grant Edwards               grant.b.edwards        Yow! I'm definitely not
                                  at               in Omaha!
 Click to see the full signature
Reply to
Grant Edwards

Hehe. But this means you actually _have_ something with an ISA bus on it!! These days... well.

I keep an older 80386DX and 80486DX machine around (three, actually) all nicely sporting lots of ISA slots. Also have proto ISA boards I can use to slap up an easy custom circuit on. No way could do that with PCI.

My 80486DX boots up Win98SE at 33MHZ and 64Mb RAM (with an external cache made from discrete static rams) faster than my WinXP boots on a 2.94GHz cpu. I actually prefer to use it, too.

On your point, yes. A crystal change on any of the usual spate of old ISA boards would easily solve the problem. Forgotten lore.

Jon

Reply to
Jon Kirwan

Then use a PCI card.

It works for PCI cards as well.

--
Grant Edwards               grant.b.edwards        Yow! An Italian is COMBING
                                  at               his hair in suburban DES
 Click to see the full signature
Reply to
Grant Edwards

I like ISA and simpler software.

Although I understand reflection wave principles, clock line skew and serpentine clock lines, and the like, I very much appreciate being able to use simple logic, wire-wrapping techniques, and custom circuit design with the ISA bus. It is a low-tech bus that can be reached by hobbyists. PCI, and not merely because of the hardware but also because of other aspects (plug and play), out of reach of most hobbyist tools and skills.

And I also understand the desire to get rid of the south bridge, chipset side-band channels to support ISA DMA over a bus that simply cannot and does not support ISA DMA timing requirements, interrupt mapping, and so on. It's pretty obvious this was a huge source of continuing chipset bugs and needed testing regimes, as well.

But I like ISA.

Jon

Reply to
Jon Kirwan

And swapping out the buad-rate clock oscillator on a PCI serial card requires no understanding of any of that.

We're not talking about building a card from scratch. We're talking about taking an off-the-shelf serial card and swapping out the xtal oscillator.

Swapping in a 2.00MHz oscillator for a 1.843MHz oscillator on a PCI card requires _exactly_the_same_ skills as doing it on an ISA card.

I have absolutely no idea what any of that has to do with this thread.

--
Grant Edwards               grant.b.edwards        Yow! Mary Tyler Moore's
                                  at               SEVENTH HUSBAND is wearing
 Click to see the full signature
Reply to
Grant Edwards

Agreed. I just took Meindert's comment regarding an ISA board and ran with it. :P

We could be, but I expanded Meindert's comments in a different direction for the pure pleasure of doing so. Threads are sometimes like that.

Not so. I'm looking right now at two such cards, one ISA and one PCI. The ISA board has a large, socketed crystal module. The PCI a tiny, SMT unit. The skills required for modifying one is much different (and the tool tips required, too.) It _may_ be the case, but not necessarily so as these two boards easily illustrate to me.

Then you are lost to what I've been saying. Which is fine. That happens, as well.

Jon

Reply to
Jon Kirwan

COM

ly 5

Just slap something like a PLX 9052 on your PCI board. The front side handles the PCI, the back side is ISA.

Reply to
robertwessel2

I still can't just wire-wrap the PCI bus side of it. 1.5"

+/- 0.1" clock line, serpentined, 2ns clock skew at 33MHz and 1ns at 66, etc. I suppose pre-built boards with chips down and the ISA back-side might do it. But this, again, is getting way over my hobbyist toolset. If there is a problem with the PCI bus, I simply don't have the tools to diagnose. They are kind of expensive, too.

Also, no plug-and-play, required PCI transaction support and registers to deal with, etc. ISA is __very__ easy. Add PCI, even if only on a corner of it, and complexity goes ^^^ up.

I'm glad to keep the older machines around for hobby playing. They work VERY well, even to this day. And Win98SE licensing fits my model and boots _very_ quickly, well.

Jon

Reply to
Jon Kirwan

ISA has also always been out of the reach of the hobbyist. While there is no doubt that it is simpler to design an ISA card than a PCI card, in the days of ISA it was hard to make such a card. Information about the bus wasn't as easily available (no Google), and even if you knew how to do it, the design of a card was not insignificant. But the biggest hurdle for a hobbyist would be testing - you need an expendable spare computer to test your card, because of the high risk of frying the whole machine. These days you can get a cheap PCI bus computer for very little, and second-hand ones for practically nothing. When ISA was the main bus, a spare computer was a big investment.

Reply to
David Brown

Once you've done it a couple of times, you wonder why you ever made such a fuss about it :-) Bu then again, I am an embedded software and hardware guy....

Meindert

Reply to
Meindert Sprang

I designed a few cards back in the 90's. Information was not hard to come by, Intel provided the spec, IIRC, and as long as you double-triple-quadruple checked the power connections, the only serious thing that could happen is that your computer locked up when the card was inserted. And even that actually never happened to me. The hardest thing for me was to find a decent mechanical specification to make it fit into every computer case..

Meindert

Reply to
Meindert Sprang

:) I have put some effort into it, before.

Well, there is that. I am only a hobbyist on the hardware side.

Jon

Reply to
Jon Kirwan

Are you just in a contrary mood, today? No other explanation is possible.

Out of reach??? Hardly. But I suppose it depends upon what is, is. :)

IBM, itself (and I know this because I still have them here), sold very cheap proto boards for the ISA bus as far back as I can recall. Very beautiful boards, too. I believe I paid close to $30 for each. 1984/1985.

Hogwash.

I still have my technical reference multi-volume binder set from IBM with __complete__ documentation. Very complete. Complete BIOS listings, with comments, included, and schematics as well. I used these routinely for hobby playing.

They were available in 1983 and IBM sent regular updates as new boards came out. For example, volume 3 includes a section I used called "IBM Personal Computer General Purpose Interface Bus Technical Reference," that is dated August

15th, 1984. Part number 6138155. (It wasn't called ISA, then, of course.)

Subsequent to this, there were some books out (latish, but for late-comers quite good all the same) that appeared. As a supplement book to those who didn't have access to IBM's manuals (a shame), Edward Solari's books were a great help. His AT book first came out circa 1989/1990, memory serving. And then of course MindShare's multi-editions (my shelf copy here is the 3rd edition) on the ISA (and other buses.)

Personally, I used the rather complete IBM information early on and liked Solari's contribution. MindShare was fine, but came too late.

Trivial, for trivial projects. I think so, anyway. Plus, IBM provided, on their proto boards, a complete, laid out

7400 series style decode section. So I guess maybe I just had it too easy.

Since I do NOT consider myself to be anything other than a hobbyist in electronics -- barely that -- and since I already know just how darned easy this was for me when I knew far, far less than I do now about it, I don't know at all where you are coming from. Or, at least, I simply didn't find all the struggles you suggest.

And by comparison with PCI??? No discussion.

I used tools developed for PCI at Intel. I know how much they paid for them. And I know what including PCI on the Pentium did to "mom and pop" motherboard manufacturers, too. (Intel staff told me this was an internal goal, in fact.)

I won't even debate it. Not worth the trouble.

Jon

Reply to
Jon Kirwan

IBM provided __complete__ documentation. I always felt like I had enough. And that goes back to late 1983 and early

1984. So long before 1990, when Solari's book on the AT arrived. I did terrible things, risky things, and didn't have any trouble to speak about. Just the usual. I avoided the 'mechanicals' issue by simply using the excellent and relatively cheap (in fact, they were less expensive than 3rd-party sources [Jameco, later] which were much inferior and more expensive, to boot) IBM prototype boards. These were perfectly built, bus interface already laid out, and slick as heck to use. No troubles. And that was 1985/1986. And by that time EPROMs that were clearly fast enough for the bus were rather readily available to a meager hack like me. (BIOS extension.)

Jon

Reply to
Jon Kirwan

I suppose it all depends on what you define as "hobbyist".

Finding a source for the documentation, and buying it (assuming these manuals were priced similarly to a lot of other comparable technical information) would take a lot of effort and money.

It may also be as simple as you being lucky in finding these prototype boards from IBM. Imagine a hobbyist who hadn't found out about these and wanted to make an ISA card.

You are /far/ beyond what I would consider a hobbyist - you have a lot more knowledge and experience, and put a lot more time and money into your electronics, than I would classify as hobbyist. Amateur, perhaps (if you don't get paid for it), but I don't expect you would have difficulty getting a job as an electronics engineer.

I am not saying that making an ISA board was too hard to do - merely that the investment required was at the level of "small professional" rather than "hobbyist".

All the information about PCI that you could want is a few google searches away, as are plenty of example designs to get you started. And you can buy an Altera Max II PCI evaluation board within a hobby budget ($150), including software drivers. So playing around with PCI is certainly practical for hobbyists - though I agree that making your own PCI board is well out of reach, even for a small professional company.

Reply to
David Brown

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.