Path: news1.icaen!news.uiowa.edu!chi-news.cic.net!EU.net!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!feed1.news.erols.com!howland.erols.net!newsxfer.itd.umich.edu!uunet!in1.uu.net!142.77.1.4!news.uunet.ca!news.on.rogers.wave.ca!n4tor.istar!tor.istar!east.istar!news1.istar.ca!news From: i.hate.spam@no.junk.email (Honker) Newsgroups: comp.sys.apple2,comp.sys.apple2.programmer Subject: Messing around with a parallel i/o card Date: 22 Feb 1997 06:11:39 GMT Organization: - Lines: 115 Message-ID: <5em2mr$olc@news.istar.ca> NNTP-Posting-Host: ts20-10.vcr.istar.ca Xref: news1.icaen comp.sys.apple2:116933 comp.sys.apple2.programmer:8486 I've been having some fun with a home brew parallel i/o card for Apple2. It's a modified parallel printer card with a flat cable that plugs into an IBM-PC parallel port allowing the two computers to exchange data directly. Using Borland C I wrote some preliminary software for the IBM to configure it as a file server for ProDos 8 but just as easily it could directly download programs, operating systems such as DOS 3.3, etc. So far I've been using a MacroprintPlus card (by Macrotech Computer Products of BC, Canada) as it was designed for parallel i/o as well as printing. However, the Grappler+ is much more widely available, especially the clone versions. Some time ago I posted instructions on how to modify a Grappler for this function and I've thought up an extension of the concept to make it more versatile by allowing the on-board firmware to be writable at run time. This is particularly handy for me because I use a 6502 cross-assembler on the IBM. Basically the idea involves using both RAM and EPROM. The operating system, program and firmware would all be downloadable from the IBM which has much more storage resources than the usual II+ or //e system with 143k floppy drives. The ROM would contain only minimal boot code, used to download whatever firmware is needed at the moment. It would be handy if the RAM were non-volatile, and Dallas Semiconductor makes a battery-backed 2k x 8 RAM, the DS1220. Modifying the Grappler+ ----------------------- This card has the following hardware features: * socket for 2732 EPROM (more on this below) * 8-bit latched output port * output strobe (active low) * 8-bit input port, currently allocated as: bit 0: printer ACK- bit 1-3: printer status bit 4-6: DIP switches bit 7: interrupt pending * optional interrupt (IRQ-) generated by printer ACK- The provision for a 2732 (4k x 8) EPROM is the basis for this scheme because this chip is replaced by a 2716 (2k x 8) EPROM and a 4116 static RAM of the same size. The high order address line, A11 normally used to select the Grappler's firmware banks becomes the device select line; low for EPROM and high for RAM. The physical placement of the two chips is a minor consideration; The RAM can piggybacked on the ROM, pin for pin except CE- or it can be fitted somehow onto the solder side of the card. In my computer this card is in slot 7 so there's no problem with clearance room on the component side. A slight modification is needed to make the RAM writable. I tried this tonight with a 4116 in the firmware socket and it seems to work: 1. Since this is RAM, it needs a WR- signal to accept data. I cut the trace to U9-21 (was A11 on the 2732 but now the WR- input for a 4116.) and connected a jumper wire from this pin to U3-3, ie. the RD/WR- line. 2. I cut the short trace from U9 pin 20 (OE-) that connects it to the line from U6-11 to U9-18. This pin needs to be connected to the invert of RD/WR-, ie. RD-. For my present purposes I don't need interrupts from this card, so the resources normally used for interrupts become available including the latch at U2A, etc., and RD- was derived from the NAND gate at U6A. When I tried this with a card in slot 1 I could write and read to $C100 - $C1FF with no problem. However, $C800 to $C8FF seems to be mapped into this same space, so the expansion ROM space really starts at $C900. The Grappler+ soft switches are somewhat peculiar. According to the manual the nominal designations for an i/o write are as follows $C080,Y output $C081,Y Select ROM bank 2 $C082,Y reset interrupt Req and IRQ data bit $C084,Y output/interrupt on ACK What actually happens is this: 1. If A0 is high then ROM bank 2 is selected. (From IC U1C). Note: ROM bank 1 is selected on any access to the peripheral firmware (ie $C700 - C7FF for slot 7, etc.) 2. If A0 and A1 are both low then the data bus is written to the output latch and an output STB- is initiated. Also, the ACK latch at U2C is reset. 3. If A1 is high then the interrupt latch is reset. (U1B) 4. If A2 is high then the interrupt latch is set. (U1A Point 2. above is why the card also performs output on $C084,Y. Anyway, after all this messing about I'll be able to program an 2716 just once with some minimal interface code and from then on everything else will be downloadable from the IBM in a convenient way. So when I show my friends a highly modifed board crawling with jumper wires and cables leading here and there and if anyone asks me what's the point, I'll just say -- hacking, that's what the Apple 2 was all about (originally) -- and despite mega this and giga that on the latest Pentiums, the spirit lives on.