6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Jun 04, 2024 11:25 am

All times are UTC




Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Tools of the Trade.
PostPosted: Fri Sep 02, 2022 7:37 pm 
Offline

Joined: Sun Jun 29, 2014 5:42 am
Posts: 337
BigEd wrote:
(Hi JK - jk means "joking")

((or even "just kidding"))


Top
 Profile  
Reply with quote  
 Post subject: Re: Tools of the Trade.
PostPosted: Fri Sep 02, 2022 7:38 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10822
Location: England
(Oh right - that makes more sense!)


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 02, 2022 8:52 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8198
Location: Midwestern USA
floobydust wrote:
Going further back in time, pretty much all IBM I/O devices, regardless if they were punch card, tape, disk or printer had a "ready" indicator lamp...I’m not quite sure that it was IBM trying to pressure Epson to make a one-off printer (hence proprietary)...

I got that story from someone who was working at Epson at the time of the PC’s genesis. He told me the mechanicals and the circuity of the printer were the same as an MX80. The only difference was in the bastardized parallel port. The IBM/Epson printer was compatible with the Centronics ports of third-party computers, since the pins Epson used for the new functions were not assigned to anything on the real Centronics port.

Quote:
PS - I also wrote code to drive a parallel port printer from my C64 back in the 80’s... I bought a Star Micronics dot matrix printer... even as a employee, couldn’t afford/justify the employee discounted price on the IBM-logoed Epson printer. Oddly, I still have an IBM ProPrinter that’s basically NOS, but I’m certain it needs a new ribbon!

I have had a number Star Micronics printers, which were of high-quality. Their nine-pin models did decent NLQ, as long as you weren’t in too much of a hurry.

In the truck leasing system I built for a client, there were three of those printers, one being a wide unit for printing reports on greenbar. The printers were driven off the cartridge port of a C-64, which acted as a print spooler. Lloyd Sponenburgh of Fiscal Information designed the interface so it would be compatible with the Lt. Kernal hard drive subsystem, using four MC6821 PIAs to interface to the printers (one per printer).

The driver for this mess was interesting to write. The printers were interrupt-driven in a manner similar to the way multiple serial ports would be driven, and the foreground was what picked up and buffered the data that was to be printed. Since the C-64 could control up to four printers, I developed a protocol for job-routing purpose. It was all done by passing data through a contiguous-block data file on the hard drive, using file locking to avoid contention.

I did test it with four printers connected and running simultaneously (which made a lot of racket :D), but as I said above, the client only needed three. With all four simultaneously printing, the C-64 had its work cut out for it. :shock:

Dr Jefyll wrote:
My experience has been the same as Garth’s, BDD; ie, never a hiccup ignoring /ACK and using BUSY instead. I’m not convinced I need /ACK to tell me "the most recent byte was accepted for processing." In practical terms, how is that different from knowing the printer is online and has room in its buffer? The only thing my code (Z80 code, in this case) wants to know is, "can I send a byte now or must I wait?"

I’m not saying it won’t work, at least with a driver that doesn’t use interrupts or on a relatively slow system. It’s more likely to be a problem with a real fast system that uses interrupts to drive the parallel port. Also, depending on its age, a printer may have a true Centronics port, which means there will be no BUSY.

Quote:
Quote:
BUSY is asserted almost immediately when /STROBE is driven low.

True, but I’m not connecting the dots on how this constitutes a problem. Are you worried about a high-speed computer reacting too promptly to an interrupt caused by BUSY being asserted?

Yes.

Quote:
As for the limitations of TTL totem-pole outputs, I agree there’s some real asymmetry there.

Yep! That asymmetry, coupled with the effects of the cable connecting the computer to the printer, introduced some interesting design challenges in the early days (recall that I’ve been messing with computers for some 52 years, so much of which I monkeyed was beset with design challenges we don’t see any more). The original Centronics printers, with which I have quite a bit of experience, used a ribbon cable to make the connection, rather than shielded cable as we do now. It was the relatively weak output of the available bus drivers of the time that informed that choice. Shielded cable resulted in unacceptably-rounded edges and unreliability.

In any case, the BUSY output doesn’t exist in a true Centronics interface. The IBM parallel port uses /STROBE-/ACK as the primary handshake, same as Centronics, but also requires that BUSY be low before a byte will be send, a belt-and-suspenders arrangement, as it were. BUSY also goes high when the printer goes off-line or runs out of paper. Hence even though the printer can still accept and buffer data while off-line, the computer will not send any, a feature of questionable value, in my opinion.

When Centronics designed the interface, they arranged the handshake timing to assure de-skew of the cable’s data lines. That’s why the fall of /ACK trails the rise of /STROBE by a considerable amount. Based upon the original timing specs, the theoretical maximum data transfer rate was ~360KB/sec. Current PC parallel ports maintain that limit if operating in SPP mode, although in practice it’s rarely achieved.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Tools of the Trade.
PostPosted: Wed Sep 07, 2022 2:27 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3363
Location: Ontario, Canada
Maybe I can rewind this handshaking discussion for a moment. I think you had a fair point, BDD, when (in this post) you objected to the phrase Garth included in his printer article which states, "You do need to pay attention to the busy line."

BigDumbDinosaur wrote:
Many years ago, I concocted a Centronics interface for my Commodore 128 through the user port, which is wired to CIA #2. The handshaking was /STROBE and /ACK
Right. With the approach Garth chose, one does need to pay attention to the BUSY line. But with the approach you chose, one doesn't, and the wording in Garth's article seems to deny that (although inadvertently, I expect).

So, it's reasonable to draw attention to the narrow context of Garth's phrase. But then you go on to argue that BUSY is not only unnecessary but actually flawed -- "not entirely trustworthy as a handshaking line" -- and I see issues with both of your lines of reasoning in this regard.

I get that you have concerns about data corruption resulting perhaps from interrupts and too-fast machines, but these concerns seem vague and shapeless -- you haven't spelled out an a, b, c sequence that would result in a failure. It's good to be on the lookout and anticipate potential timing problems, but I don't believe those problems are unmanageable. And telling us to be on the lookout is different from telling us the BUSY method isn't trustworthy.

BigDumbDinosaur wrote:
Also note that BUSY is high-true, but /ACK is low-true. There is a reason for that...in handshaking, low-true is usually considered the more reliable arrangement due to limitations of TTL totem-pole outputs.
Oops, we had a run at this before and got nowhere... perhaps because I failed to quote the specific comment I was responding to, so this time I am including it.

You seem to be saying a wise decision was made when the polarity of /ACK was defined but a poor decision was made when the polarity of BUSY was defined, is that right? I'd say both decisions were wise, and I can't help wondering if you suffered a titch of mental flatulence, as any one of us might. Names can be distracting. BUSY could just as easily have been named /READY and yet its behavior would be the same. (And of course it's behavior that matters. I talked about this in the final paragraph of my previous post.)

-- Jeff

ETA: Still not confident I've made myself clear; so, for anyone still wondering... Electrical noise can get superimposed on a signal in transit from the printer back to the host. And, recalling that TTL voltage levels are used, we know it takes only a volt or so of noise superimposed on a TTL low to create a momentary error during which the signal appears high. Thus a false high can occur fairly easily. But it would take more than a volt or so of noise to cause a TTL high to seem like a low, and thus a false low is comparatively unlikely.

The writers of the printer interface specification can't change the quirks of TTL, but they do get to choose whether they'll use a high or a low to mean "proceed." Given that a false low is comparatively unlikely, they're wise to use low to mean proceed. That's because it's a critical error for handshaking to proceed prematurely. They're wise to use a low to mean acknowledge and they're wise to use a low to mean ready.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: