Академический Документы
Профессиональный Документы
Культура Документы
Abhishek Dutta
Interfacing with the ISA Bus
Home
Abstract: Parallel port is the most popular choice for interfacing. The 8 data output lines and sometimes the CONTROL
and STATUS ports of the parallel port, used to feed data into the computer, are not sufficient for some complex projects.
Some projects require more data I/O lines. This project shows how to get 32 general purpose I/O lines by interfacing the
ISA Bus. Though PCI bus can be a candidate for interfacing experiments, its greater speed and feature rich nature
poses great complexity in terms of hardware and software to beginners. So this project can be a stepping stone to those
think ing of ultimately getting to PCI Bus for interfacing experiments. This project can also be useful for those think ing of
mak ing Digital Oscilloscope using PC, A/D and D/A converters, Microcontroller programmer, etc.
Academic
PhD Research
MSc Research
BCE Projects
Publications
Personal
About Me
Blog
My Writings
Photography
Pin Description
Contact Me
SIDE X
D0 D7 (pins X2 to X9)
They are the 8 data lines representing the 8-Bit data bus.
A0 A19 (pins X31 to X12)
They are the 20 address lines that contain the address bits. This
address bus can address 1MB (2^20=1024 Kbytes)
AEN (pin X11)
It is used by the DMA controller to tak e over to data and address bus
during DMA transfer.
Side Y
GND (pins Y1,Y10,Y31)
They are connected to ground of computer.
+5V (pin Y3)
+5 Volt DC output
-5V (pin Y5)
-5 Volt DC output
+12V (pin Y9)
+12 Volt DC output
-12V (pin Y7)
-12 Volt DC output
MEMW(pin Y11)*
The microprocessor mak es this line LOW while doing WRITE TO MEMORY.
MEMR (pin Y12)*
The microprocessor mak es this line LOW while doing READ FROM MEMORY.
Use our professional HTML to PDF API at http://www.htm2pdf.co.uk!
Before going into the details of full project lets explain the part that handles the four 8-Bit output lines only. The
Use our professional HTML to PDF API at http://www.htm2pdf.co.uk!
addresses in the range 0x338 to 0x33B was not used by any devices for input output operations in our computer.
The three 74LS138 ICs handle the address decoding part. We have connected the address lines in a way such that there
is short pulse (CLOCK) in the wires (represented by green wire) whenever the address lines contains the address in the
range 0x338 to 0x33B and port output (IOW) is requested.
Whenever the 74LS374 get a CLOCK PULSE it latches-in the 8-Bit data present in the data bus. 74LS245 is a 3-STATE
Octal Bus Transreceiver. It reduces DC loading on the data bus and allows isolation of data bus when required.
To know that I/O port address are available for use in this project we examine the contents of ioports in the /proc
directoryof our linux system.
[root@thelinuxmaniac~]# cat /proc/ioports
0000-001f: dma1
0020-0021: pic1
0040-0043: timer0
.......................
.......................
01f0-01f7: ide0
0378-037a : parport0
037b-037f : parport0
03c0-03df : vga+
.......................
.......................
It is clear from the above output that the addresses 0x238-0x23B and 0x338-0x33B are not being used by any device.
Usually this is the case in most computers. However, if this address is occupied by some device, then you have to
change the wiring of address lines to three 74LS138 IC (used for address decoding).We describe the address decoding
technique here briefly so that you can setup unique address for I/O device we are trying to build according to the nonused address available in your computer.
ADDRESS DECODING
We use 74LS138, 3-to-8 multiplexer for address decoding. Suppose we want to assign the addresses 0x338-0x33B for
four 8-Bit output lines and 0x238-0x23B for four 8-Bit input lines.The binary equivalent of these addresses are:
Use our professional HTML to PDF API at http://www.htm2pdf.co.uk!
Address
0x338
0 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0
0x339
0 0 0 0 0 0 1 1 0 0 1 1 1 0 0 1
0x33A
0 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0
0x33B
0 0 0 0 0 0 1 1 0 0 1 1 1 0 1 1
0x238
0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0
0x239
0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 1
0x23A
0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0
0x23B
0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1
Address Lines A 15 A 14 A 13 A 12 A 11 A 10 A 9 A 8 A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0
We observe that address lines A 8A 1A 0 only change in case of all the eight addresses. The whole process of connecting
wires to 74LS138 IC is like solving a puzzle. Connect the remaining wires ( A 15A 14A 13A 12A 11A 10A 9A 7A 6A 5A 4A 3A 2) to
two 74LS138 such that they finally give low output when these lines have the address bits that partially match our
addresses (except A 8A 1A 0 ).Now we connect the remaining lines (A 8A 1A 0 A 2) to the third 74LS138.All the 8 outputs of
this IC is used to select the 74LS374 latches corresponding to input and output addresses after it is NORed with IOR and
IOW using 74LS02 to distinguish between memory IO and port IO addressing.
74LS138 Truth Table
G1 G2 C B A Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
X H XXXH H H H H H H H
L X XXXH H H H H H H H
H L LLLL H H H H H H H
H L L L HH L H H H H H H
H L L HL H H L H H H H H
H L L HHH H H L H H H H
H L HL L H H H H L H H H
H L HL HH H H H H L H H
H L HHL H H H H H H L H
H L HHHH H H H H H H L
Refer to datasheet of 74LS138 for details
It is not easy to get something work by just reading an article like this. At some point you will need to debug your
hardware.These debugging techniques will help you(as it has helped us a lot) to find the problem in your work.You will
need a multimeter, some LEDs. Remember,what we learned while debugging is that LEDs are the best way to debug
hardware of this nature when you dont have sophisticated debugging instruments. Some important techniques we
discovered while debugging are:
Multimeter will be very useful to check the zeros and ones coming across ICs.Verify that expected output is coming at
every IC.ZERO will be measured as 0.8V and ONE will be measured as 3.8V (this will vary with computer).This can be
used if the address decoding does not work and when unexpected data is seen at output lines.DO NOT CONNECT THE
MULTIMETER PROBES DIRECTLY TO DATA BUS OR THE ADDRESS LINES.ALWAYS CONNECT IT ACROSS THE
OUTPUT OF RESPECTIVE IC
Use of LEDs
LEDs can be very useful to verify the data bits coming at output lines.The lighting up of LED will be visible across latches.
To check whether the clock pulse is going to the right latch, connect a LED across the CLK pin and send data to that
port continuously in a loop like:
while(1) {
outb(0x80,0x338);
}
There are lots of other debugging techniques which you will probably discover by yourself when you get into problems.Try
to ensure that the wiring at the connector that gets into the ISA slot is correct.We checked every part of the device(every
IC,all those jumper wires,etc) and after debugging for about one week we found that IOW and IOR wires were connected
to some other pins of the ISA slot.So, recheck the wiring.We fortunately did not mistake the 12V pin for a 5V pin ;)
We are not responsible for any loss or damage caused by this article.The probability of frying up your motherboard is
more than 100% if you work on this project without using your mind.Keep your eyes open and mind alert while doing the
wiring and connecting the ICs and verify all the VCC and GND connection everytime you switch on your computer after
connecting this device to ISA slot.YOU HAVE BEEN WARNED :). Fortunately the motherboard used for this experiment
is still alive and the experiment was a huge success.
Send in your comments and suggestions to:
Abhishek Dutta, <thelinuxmaniac _AT_ gmail.com>
Badri Adhikari, <badri.aquarius _AT_ gmail.com>
Use our professional HTML to PDF API at http://www.htm2pdf.co.uk!
TLM replied: Yes, you are right. You can connect an inverters(whose input comes from the clock line) output to the OC
pins of 374 latches to prevent the possible interference. I didnt not k now that LOW output of 374 IC lines are actually
connected to ground through its internal circuits. I have learnt a new (and very important) thing about 374 ICs today.
I will update my circuit to implement the idea suggested by you.
Share this:
Share
Written by abhishekdutta
August 30, 2010 at 2:47 pm
Blog at WordPress.com .