Subject: Re: Apple II Centronics Newsgroups: comp.sys.apple2 From: dempson@actrix.gen.nz (David Empson) Date: Tue, 16 Nov 1999 12:16:15 +1300 Message-ID: <1e1d1by.o32d3016yewcN%dempson@actrix.gen.nz> References: <382FEC3A.52B9@club-internet.fr> <1e1c7b2.1lu9lca1ieq45cN%dempson@actrix.gen.nz> <3830570c.6648471@news> Organization: Empsoft User-Agent: MacSOUP/2.4.2 NNTP-Posting-Host: 202.49.157.176 X-Original-NNTP-Posting-Host: 202.49.157.176 X-Trace: 16 Nov 1999 12:15:45 NZST, 202.49.157.176 Lines: 150 Path: lobby!newstf02.news.aol.com!portc02.blue.aol.com!pitt.edu!nntp.club.cc.cmu.edu!awabi.library.ucla.edu!128.32.206.55!newsfeed.berkeley.edu!ihug.co.nz!news.iprolink.co.nz!news.actrix.gen.nz!dempson Jeff Blakeney wrote: > On Tue, 16 Nov 1999 00:55:52 +1300, dempson@actrix.gen.nz (David > Empson) wrote: > > >Nicolas Rey wrote: > >> printer) with a custom BASIC program. So far, I've used on/off feature > >> of the serial ports (through PR#1 and PR#2) to command a two relays. I'd > >> like to have more controls and I'm considering switching to a IIe using > >> the parallel port. > > > >Apple IIc? There aint no parallel port, I'm afraid. > > Tsk, tsk, David. You should have read his message more closely. :-) Whoops! I saw "IIc" and "parallel port", and the rest of the article went out the window. :-) OK, lets backtrack and try again. Nicolas Rey wrote: > I'd like to have more controls and I'm considering switching to a IIe > using the parallel port. I couldn't find the pin asignment of the > Centronics plug in my documentation. Any one still has that information > or knows where it can be found on the web ? Given an Apple IIe and a parallel card, I suppose you could set up an external device with a female centronics connector, and plug the parallel cable into it from the IIe. Another option (possibly cheaper) would be to bypass the parallel cable and connect directly to the DB-25 provided by the parallel card. The disadvantage with this method is that the pinout of Apple II parallel cards are different for different brands. The Grappler is similar to the PC's parallel port, but most other cards are completely different. The cable that is supplied with each parallel card will usually only work with that card. I'd suggest sticking to the Centronics connector for now, since it lets you switch to another parallel card (or even another computer) without having to modify your cable or circuitry. The Centronics pinout is documented in most older parallel printer manuals. Off the top of my head, I can remember the following: 1 STROBE (active low) from computer 2 Data bit 0 3 Data bit 1 4 Data bit 2 5 Data bit 3 6 Data bit 4 7 Data bit 5 8 Data bit 6 9 Data bit 7 10 ACK (active low) from printer 11 BUSY from printer I've dug out a Panasonic printer manual, and it lists the rest of them as follows: 12 PAPER EMPTY (output from printer) 13 SELECT (output from printer) 14 AUTO FEED XT (input to printer, active low) 15 (unused) 16 Signal Ground 17 Frame Ground 18 +5V (output from printer, reference voltage only) Pins 19 through 29 are ground lines, paired with each of the STROBE through BUSY lines (for use in a twisted pair or ribbon cable). Pin 30 is the ground return line for pin 31 (PRIME). 31 PRIME (reset input to printer, active low) 32 ERROR (output from printer, active low) 33 Signal Ground 34 (unused) 35 (unused) 36 (unused) I happen to remember that some printers use pin 36 as a SELECT ENABLE input, but I don't recall the polarity. All signals are TTL-compatible, with rise and fall times less than 0.2 microseconds. The pins are numbered in the same manner as a DB-25 - along the top row and then in the same direction along the bottom row. What I'm not certain about is which end has pins 1 and 19. The diagram in this printer manual implies that pin 1 is on the right when looking into the printer connector, thus on the left when looking at the plug on the cable. This would match a DB-25 (male on the plug, female on the printer). To be on the safe side, plug the cable into the computer but not the other device, make sure the computer is switched off, and use a continuity tester to locate the block of ground lines at one end of the bottom row of pins. When using a parallel cable with a PC, you have access to all the printer control and status signals (STROBE, ACK, BUSY, PAPER EMPTY, SELECT, AUTO FEED XT, PRIME, ERROR and SELECT). With an Apple II, a fair number of these signals may not be available, depending on the printer card. For example, Apple's parallel interface card has eight outputs (plus strobe, which is generated automatically) and eight inputs. I don't know offhand where the inputs are supposed to be mapped, and can't locate the manual for the card just now, but the lack of additional outputs prevents control of AUTO FEED XT, PRIME and SELECT ENABLE. The standard handshake logic for the parallel port is as follows: 1. The computer outputs 8 bits of data. 2. There is a minimum 0.5 microsecond delay before activating STROBE. 3. STROBE is pulsed low for at least 0.5 microseconds. 4. The printer BUSY signal goes high in response to strobe, within a maximum of 0.5 microseconds. 5. There is a minimum 0.5 microsecond delay before the data can be removed. 6. Once the printer has finished processing the data byte, it lowers BUSY again, then generates a low-going pulse on the ACK line. This is delayed by 4 microseconds after BUSY went high, and is approximately 3 microseconds wide. The printer drives BUSY in response to STROBE, but I'm pretty sure the computer doesn't wait for BUSY before it sets STROBE high again. The computer usually watches BUSY to identify when it is able to send the next byte. It may ignore the ACK signal completely. Some computers rely on the ACK signal, using a hardware latch to ensure it is not missed, possibly in conjunction with an interrupt trigger. If the computer's parallel port has an output buffer, the ACK signal would initiate transfer of the next byte. The PAPER EMPTY signal goes active (high) as an advance warning of paper empty. If printing continues, the ERROR signal goes active (low), followed by the SELECT signal going inactive (low). The SELECT signal can also go false if the printer is deselected. The PRIME signal is pulsed low for a minimum of 1.0 microseconds to reset the printer. -- David Empson dempson@actrix.gen.nz Snail mail: P O Box 27-103, Wellington, New Zealand