Getting started with Experiment #4 So far, we have seen how to build a system using ICs. We have a 16 bit counter, which stores a 4 digit binary coded decimal (BCD) number, e.g. 0000 to 9999. The purpose of lab 4 is to send this count to the PC. The prototyping board is already connected to the computer, but so far we have only used a few of the signals provided by the computer. That is, we have used +5V and GND to power the prototyping board. There are other signals sent between the two, but for the moment, just consider the addresses (A0, A1, A2, ... A19) and data lines (D0, D1, D2, ... D7). These are shown as one-way signals, but that is OK for this lab. Also, we only use address lines A0, A1, ... A9 for this lab. Look in section 7.9 of The Personal Computer From The Inside Out (Sargent and Shoemaker) for more information about the PC bus. ----------- ----------- | | address | | | |------------->| | | PC | | PB | | |<-------------| | | | data | | ----------- ----------- PC = personal computer PB = prototyping board When do we send the data? First, realize that we cannot send all of the data at once. We want to send 16 bits, but we can only send 8 bits at a time. Naturally, the solution is to break the count up, and send 8 bits one time and 8 bits the next time. The PC communicates with the PB through ports. Think of them as memory locations, but rather than storing the data, the data is available on the data lines. So why not just write the first data byte, then write the second? We also have to know WHICH byte to send, and we have to know if the computer is talking to our board or not. Some of this we can decide by looking at the address. We will work with two addresses in this lab, 300 (hex) and 301 (hex). We could make our circuit work with 300h .. 307h if we wanted, by using A0, A1, and A2 to distinguish between these. In other words, A2, A1, A0 specify the lower 3 bits of the address, and A0 is the Least Significant bit (LSb). The following program (entered in Debug) is an infinite loop: mov dx, 300 in al, dx jmp 100 When you start to assemble, 100 is the offset. In effect, this program says "Get data from port 300" over and over again. You can use it to test out these address signals (with an oscilloscope). Experiment #5 builds on this.