is an introduction to Z80 assembly language programming. It explains commonly used instructions, elementary programming techniques and their applications, and the modular approach to software design. The content is presented in a format similar to one for learning a foreign language. One approach to learning a foreign language is to begin with a few words […]
Continue reading…
Interfacing I/O Devices
ASSIGNMENTS ON INTERFACING I/O DEVICES
ASSIGNMENTS 1. Explain why the number of output ports in peripheral-mapped I/O is restricted to 256 ports. 2. In peripheral-mapped I/O, can an input port and an output port have the same port address? 3. If an output and input port can have the same 8-bit address, how does the Z80 differentiate between the ports? […]
Continue reading…
SUMMARY OF INTERFACING I/O DEVICES
SUMMARY in this chapter, we have examined the machine cycles of the OUT and IN instructions and derived the basic concepts for interfacing peripheral-mapped I/Os. Similarly, we examined the machine cycles of memory-related data transfer instructions and derived the basic concepts for interfacing memory-mapped I/Os. These concepts were illustrated with three examples of interfacing I/O […]
Continue reading…
5.9 SOME QUESTIONS AND ANSWERS
5.9 SOME QUESTIONS AND ANSWERS During the discussion of interfacing I/O devices, we focused on the basic concepts and avoided some details in order to simplify the presentation. We will now attempt to answer some of those questions. 1. What are the other I/O instructions in the Z80 instruction set, and how do they differ […]
Continue reading…
5.8 TROUBLESHOOTING I/O INTERFACING CIRCUITS
5.8 TROUBLESHOOTING I/O INTERFACING CIRCUITS In the last several sections, we discussed the interfacing of I/O devices and instructions to test them. In I11ustrative Example 1(Figure 5.4), the test program includes two instructions that load the byte 97H into the accumulator and output the byte to port 07H• If we execute these instructions and no […]
Continue reading…
5.7 ADDITIONAL ILLUSTRATIVE EXAMPLES: INTERFACING SENSORS AND MOTORS
5.7 ADDITIONAL ILLUSTRATIVE EXAMPLES: INTERFACING SENSORS AND MOTORS In previous examples, we illustrated the interfacing of I/O devices that were primarily binary devices (on/off). We now extend the concepts to interface analog devices such as temperature sensors and motors. In interfacing analog devices, the basic procedure remains similar to that of interfacing binary devices; the […]
Continue reading…
ILLUSTRATIVE EXAMPLE 3: APPLIANCE CONTROL USING MEMORY-MAPPED I/O TECHNIQUE
ILLUSTRATIVE EXAMPLE 3: APPLIANCE CONTROL USING MEMORY-MAPPED I/O TECHNIQUE Figure 5.10 shows a schematic of interfacing I/O devices using the memory mapped I/O technique. The circuit includes one input port with eight DIP switches and one output port to control the appliances. The appliances are turned on and off by the microprocessor according to the […]
Continue reading…
5.5 MEMORY-MAPPED I/O
5.5 MEMORY-MAPPED I/O In, memory-mapped I/O, the input and output devices are assigned and identified by 16-bit addresses. To transfer data between the microprocessor and I/O devices, memory- related instructions (such as LD A, (16-bit) and memory control signals (such as M̅R̅E̅Q̅) are used. The microprocessor communicates with an I/O device as if it were […]
Continue reading…
ILLUSTRATIVE EXAMPLE 2: INTERFACING INPUT SWITCHES
ILLUSTRATIVE EXAMPLE 2: INTERFACING INPUT SWITCHES In this section, we will analyze the circuit used for interfacing eight DIP switches as shown in Figure 5.8. The circuit includes the 74LS138 3-to-8 decoder to decode the low-order bus and the tri-state octal buffer (74LS244) to interface the switches to the data bus. The port can be […]
Continue reading…
INTERFACING INPUT DEVICES
5.3 INTERFACING INPUT DEVICES The interfacing of input devices is almost identical to that of interfacing output devices, but with some differences in bus signals and circuit components. In this discussion, we will assume that you are familiar with the basic concepts of interfacing (Section 5.1.3) and describe only the additional details. First, we examine […]
Continue reading…