Coprolite.com
Google
 
Web Coprolite.com
Categories:
GNU/Linux | Homebrew designs | Perl | Microcontrollers | Graphics | Z-80 | FreeDOS | Electronics | Odyssey 2 | 8048 | Other/Msc.

Last 30 Days | Last 60 Days | Last 90 Days | All Articles/Links


Categories:
·GNU/Linux
·Homebrew Designs
·Perl
·Microcontrollers
·Graphics
·Z-80
·FreeDOS
·Other/Msc.
·Electronics
·8048
·All Categories
·Other SignalQ Websites




Z-80 Homebrew Computer - Interfacing with an IBM XT
Topic: Z-80   Posted:2003-07-06
Printer Friendly: Print

spacer
There are 12 parts to this article:
1 - 2 - 3 - 4 - 5 - 6 - 7 < 8 - 9 - 10 - 11 - 12

In this article I'll show you how to hook up an XT to the homebrew to transfer data in both directions through the PC parallel port. The programs for transfering to and from the Homebrew could be modified for just about any communication with the parallel port. Warning: you could very well electrocute yourself or destroy your PC. Don't tinker with this unless you are absolutely sure about what you are doing. See Terms of use.

The first PC that I interfaced the homebrew computer to was a Toshiba 8086 laptop. This was back when it was just on a breadboard during the summer of '91. This was also when I built the front panel. These days, I use a uClibc GIAGD system, but there are a lot of old XTs and even newer systems that can be put to good use to control random projects like this.

Since we are hooking up stuff we solder together, it is better to test the rig out on something like an old XT anyway. I got this at Goodwill for $1. It has a 10 meg hardcard, 640k of memory, a ttl monochrome video card with one printer port on the same card, and two 360k floppy drives. Ahhh, but check it out. I have a strange 286 daughterboard that plugs into the 8088 slot to make it into a somewhat slower AT. It benchmarks at 3 times the speed of an XT:



The older printer ports can have different addresses. To check and see what LPT1 is, you could enter:

debug 
-D 40:08 L8 

On my 360CSE, the output is:

0040:0000  BC 03 00 00 00 00 87 01 

This means LPT1 is at 3bc.

I use a book called 80x86 IBM PC and Compatible Computers: Assembly Language, Design, and Interfacing Volume I and II by Muhammad Ali Mazidi and Janice Gillispie Mazidi for the nitty gritty stuff on the printer ports, which is where I found the above very cool debug test. It has many details on the design and Interfacing of PCs. Another good book is Parallel Port Complete by Jan Axelson. There is a lot of included Visual Basic code, which you may find useful. Personally, I wish the code was more low level. It seems absurd to load windows and VB just to tweak a printer port. Then again, I tap out my bootstrap bit-by-bit with paperclips. :) If you are primarily interested in Parallel Port interfacing, Axelson's book is probably best. If you are at all interested in the other components of the PC, and the assembly language and BIOS stuff behind the components, then get Mazidi's book.

OK. On to the interfacing. First let's convert the addresses. There are three addresses. The standard (today) is 378,379, and 37a hexadecimal. Using BC from Hackinjoe's page:

bc 
ibase=16 
378  
888 

OK. We can convert from hexadecimal to decimal. This old XT of mine has an older style printer port with an address of 3bc hexadecimal. So, we need to convert 888->956, 889->957, and 890->958. I happen to have an old copy of Power C, so I'm going to use that and gwbasic. I'm also running DOS 6.22 on the XT. After changing references to 889->957 in getdump, all compiled fine with powerc, and input.exe ran just swell. Here is the c source for getdump that will compile on an XT using PowerC. Here is an MS-DOS executable.

Getdumpxt.exe dumps the contents of the EPROM and does some crude disassembly:



Ahhh... Genuine IBM green screen from a Hercules card. So very nice.

Here is the entire dump.txt output. It lists the hex, binary, and assembly code for the instructions in the bootstrap EPROM/EEPROM. I used to have to enter this by hand by tapping out bits on the front panel and writing the code down on graph paper:



The bootstrap program (dump.txt) first dumps its memory to the PC parallel port, and then does a fancy lamp test while waiting for a keypress on the keypad. Here is the gwbasic program (Gee Wiz BASIC, no?) used to dump a program embedded in data statements to the Home-brew computer: putprogxt.bas.txt. Here is the .bas file.

Let's run the program:

GW-BASIC 3.23
(C) Copyright Microsoft 1983,1984,1985,1986,1987,1988
60300 Bytes free
Ok
files
C:\GWBASIC
.   <DIR>         ..  <DIR> GETDU~B1.EXE      GETDU~CU.TXT
PUTPR~QI.BAS      GWBASIC .EXE
2924544 Bytes free
Ok
LOAD"putpr~qi.bas
Ok
run
waiting?

On the PC monitor:



This program puts prog--1 on the 7 segment leds on the front panel. When was the last time you stared at a "64k free" GWBASIC prompt? See Hackinjoe for UBASIC, which will run the above program with a slight tweak to the restore command.




Please read our Terms of Use
Microsoft, Windows, Windows XP, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. Coprolite.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2008 Coprolite.com