Homebrew 8088

                    Home    8088 Programming    80x86 Assembly    8088 opcodes    Arduino    Troubleshoot 


    This web page is dedicated to developing 8088 single board computer projects. It will provide you with the information step by step at a beginners level on how to get your own 8088 up and running. I will go beyond the basic setup of just adding memory and go more in depth, showing you how to include I/O's so that you can communicate with the world. I have had several years of experience wiring up 8088 processors and have worked out a lot of issues that you will run into. I have wired up both minimum and maximum mode configurations, I am going to begin with a minimum mode system. So far i have not seen any disadvantages or advantages to ether configuration. They both use the same code internally to run and communicate with memory and I/O's. The difference is the bus controller is external on the maximum mode configuration.

    When you build your project you are going to want to get a large breadboard or wire wrap board. To begin your project using a breadboard is fine, but as your project grows the wire wrap seems to be better for reliability. You tend to get loose wires that are hard to spot  and everything gets to be tangled up on a breadboard.  My preferred method is wire wrap.
Parts list to get up and running: 

    1 - 8284A, 
    1 - 24mHz crystal or 15mHz crystal (8088-2 or 8088)
    1 - 10K resistor
    1 - 4.7 uF capacitor 
    1 - 8088-2 or 8088
    1 - 74LS245N
    3 - 74LS373N
    2 - 74LS138N
    1 - 74LS04N
    1 - Ram, 2k to 512k
    1 - Rom, 2k to 512k 

The Clock:

    The clock is what makes your 8088 run, with out a properly functioning clock nothing works right. You need to select the crystal based on the processor you chose to use. The mHz of the crystal is divide by three and output on the CLK pin. The maximun rating is 5mHz for the 8088, and 8mHz for the 8088-2. You can go as low as 2mHz and run ether the 8088 or 8088-2 effectively. 

    This is the best way I have found to connect the clock. The CSYNC, AEN1, AEN2, and F/C pins are connected to ground. The X1 and X2 connect to your crystal. The RES pin is used to trigger the RESET pin on the 8088. You pull the RES pin low the RESET pin goes high and resets the 8088. The button in the schematic helps you accomplish this easily. You can also connect RDY1 and RDY2 (pin 4 and pin 5) high but it is not necessary. 


The Processor:

    You connect the clock's CLK, Ready, and Reset pins to the processor's CLK, Ready, and Reset pins. You connect the MN/MX pin high for minimum mode. The Test pin must be connected to ground or the processor will wait in the wait cycle on the bus. The Non-Maskable Interrupt and Interrupt pins are connected to ground for now to avoid any unintended interrupts.  

(Not shown) Tie pin 31 "hold" to ground.


The Latches:

    The 0-7 address pins are multiplexed with the 0-7 data pins. This was done to keep the 8088 in a smaller package. You have to separate them from each other. The address latches is how the 8088 address memory and I/O's. The data latch is how the 8088 transmits and receives data. The address latches are only outputs and the data latch is bidirectional. The processor first sends out the the address for memory or an I/O and "latches" it to the address bus. It then transmits or receives from the data bus. 

    You must connect all the data lines for your system to work. However you only need to connect the number of address lines you need for the size of memory you connect. For example 2k of memory has 11 address lines, 512k has 19 address lines. We will talk more about decoding memory lines later.

    Connect the 74LS145, pins A1 - A8 are connected to pins AD0 - AD7. The G pin is connected to DEN pin, this enables the the chip. The DIR pin is connected to the DT/R pin, This controls the direction of the data. B1 - B8 is the data bus lines 0 - 7.

    Connect the first 74LS373, pins 1D - 8D are connected to pins AD0 - AD7. The ENC pin is connected to ALE pin, this is what signals the latch to hold the address. 1Q - 8Q is address bus lines 0 - 7. 


    Connect the second 74LS373, pins 1D - 8D are connected to pins A8 - A15. The ENC pin is connected to the ALE pin. 1Q - 8Q is address bus lines 8 - 15. 
    Connect the third 74LS373, pins 1D - 4D are connected to pins A16 - A19. The ENC pin is connected to ALE pin1Q - 4Q is address bus lines 16 - 19.


Bus Decoding:

    When the bus reads and writes to memory or an I/O you need to decoded the output lines and select the right type of bus cycle. Using a 74LS138 (1 of 8 decoder/demultiplexer) is a good way to do this. Connect the RD pin to the A pin, the WR pin to the B pin, and the IO/M pin to the C pin. Connect the G1 pin to 5v, G2A and G2B to ground. Y1 is memory write, Y2 is memory read, Y5 is I/O write, and Y6 is I/O read. 


    There are several ways that your memory can be placed on the address bus. You can put as much or as little memory as you need. The 8088 maxuimin memory is 1 megabyte. Most people don't use a full megabyte it is just not necessary for smaller projects. When you have less than a megabyte there are two basic ways to place your memory in the system.

    The first way is to cut out and ignore the address lines that are higher than what you need. For example if you only have 64k of memory between ram and rom then you would not use address lines A16 to A19. When you do it this way your 8088 will see the 64k of memory repeat in in address's. So address 0000:0000 is the same location as as 1000:0000 and the same location as 2000:0000 and so on to all the way to F000:0000. This is good because your 8088 will always have a memory location to read or write to. As the programmer you just have to make sure that you do not over write your own data when addressing it.

    The second way is to decode your upper address bus lines out and place your chips where you need them. The smaller chips you use the more line you have to decode. For example if you only have 64k of memory between ram and rom, you would decode the ram to the beginning of memory and your rom to the end of memory. The benefit of doing this is your memory wont repeat in memory, but you will now have gaps in your memory where there is nothing to read or write to. You as the programmer have just to know where there is memory and where there is not. 

    The key thing to know is; that for your 8088 to get started you will need to have placed rom at address FFFF:0000 with start up code. This is because when the 8088 powers on it starts reading from that address. One note, you can have a system that only has rom and it will operate but you will only be able to read from memory. This would eliminate using any call functions or interrupts, so having ram is a good thing. When you add ram the best place is to have it at address 0000:0000 because it will allow you to set up the interrupt vector table. 

    This tutorial is going to show you how to connect 512k of ram and 8k of rom on the system. You can use any sizes of memory you have, just remember to decode the address line out where you want them and need them. 

    RAM: To connect 512k of ram on a single chip you just connect the address lines to the address bus and the data lines to the data bus. The WE pin is connected to the MWR line on the 74LS138 from the bus decoder, The OE pin is connected to the MRD line on the 74LS138 from the bus decoderThe CE pin is connected to the A19 line. This is because for memory address's 7000:FFFF and below this line is low, for memory address's 8000:0000 and up this line is high. 

    If you run the A19 line through a 74LS04 when it goes high it will invert it low, then you can use it to enable a second 512k chip of memory ram or rom. We will not be using it here so you can ignore that part for now. 


    ROM: To connect 8k of Rom it is just like connecting ram, you just connect the address lines to the address bus and the data lines to the data bus. The OE pin is connected to the MRD line on the 74LS138 from the bus decoder, You don't connect the MWR line

    In the schematic below if you connect address lines A16 - 19 to a 74LS138 (1 of 8 decoder/demultiplexer) as shown you can decode every 64k block in the upper 512k block of memory.

    Y0 = 8000:0000
    Y1 = 9000:0000
    Y2 = A000:0000
    Y3 = B000:0000
    Y4 = C000:0000
    Y5 = D000:0000
    Y6 = E000:0000
    Y7 = F000:0000   

    Connect the CE pin to Y7 so that your rom is in the upper most part of memory. Because it is only 8K it will repeat 8 times in the last 64k of memory.


Testing with LED's (Optional):

    Your now at a point where you can test your project with real code. 
    Parts needed:
        4 - LED's
        1 - 510 ohm Resistor 
        1 - 74LS373N.
        1 - 74LS04N
    Connect data bus lines D0 - D3 to the 74LS373N's D1 - D4 , connect the LED's to 1Q - 4Q, put a the resistor between the LED's and ground. Connect the IOWR to an input of 74LS04 then connect the output to the ENC pin. This inverts it so that the IOMR line goes high when you write to memory, and enables the latch. 

    What this does is allows you to write a number to any I/O port and you will see the bottom 4 binary digits light up on the LED's. This is a cheap and effective way to check code. I usually leave these LED's on my project through development for testing purposes. 

        Code example: This will write the binary value of 0100 to the LED's.

        MOV AL, 04
        OUT 00, AL


Decode The I/O bus:

    Decoding the I/O bus is a lot like decoding memory. You can use ether a 74LS138N or 74LS139N. Address lines A0 - A15 are uses for I/O addressing this gives you 64K different I/O locations. I start at the bottom and usually decode out enough lines for my project. It is just redundant to decode out the entire 16 address lines when you only have one or two Peripherals.

    You start by connecting address bus lines A2 - A4 to the A, B, and C pins of the 74LS138N, conect the G1 to 5v, and connect G2A and G2B to ground. This will give you 8 I/O ports with the A0 and A1 to select 4 individual registers on your Peripherals. 


    The first and best I/O for an 8088 sbc to add is an 8255A Programmable Peripheral Interface. The 8255 has three bidirectional ports A, B, and C.

    Connect the D0 - D7 pins to the data bus, connect  the RD pin and WR pin to the IORD and IOWR lines, connet the Reset pin to the system Reset on the clock, and connect CS to the port select you want. I connected mine to port 1C, pin Y7 on the 74LS138N

    8255A Port Map:
    1C = Port A
    1D = Port B
    1E = Port C
    1F = Control Port


LCD 16 x 2:
    The 8255 works as a good interface with a 8 bit parallel LCD screen. I have tried to connect a LCD directly to the address bus and data bus, but it does not work out. On my project I connect the LCD's data lins to PORT B on the 8255, I connect the LCD's control lines to PORT C on the 8255. This gives me full control of the LCD. I connect the VEE pin to a 510 ohm resistor to adjust the to contrast, you can use a POT for better control. 

        Code example with the 8255 on port 1C: 

        MOV AL, 00000001b    ;Disable the EN pin. Effective disabling any read write functions of the LCD.
        OUT 0x1E, AL 

        MOV AL, 00000000b    ;Enable the EN pin, Write to the Command Register.
        OUT 0x1E, AL 

        MOV AL, 00000100b    ;Enable the EN pin, Write to the Data Register.
        OUT 0x1E, AL         

        MOV AL, Byte               ;Puts data on PORT B that is connected to D0 - D7.
        OUT 0x1D, AL      

    Check out the programming Link for more information.  8088 Programming