EXAMPLE OF A MICROPROCESSOR-BASED SYSTEM
In the last three sections, we discussed a generalized MPU model. prime memory and its organization model. and I/Os. The discussion can be summarized in the block diagram of a microprocessor-based system as shown in Figure 14. It includes a generalized MPU, two types of prime memory. and two I/O devices.
All address lines are used to address memory. and only the low-order address bus is used to identify I/O devices, indicating that they are connected as peripheral-mapped I/O (the details of Chip Select decoding are omitted here). The
MICROPROCESSOR-BASED SYSTEM: MPU, MEMORY, AND I/O
data bus is bidirectional and common to all devices. The four control signals generated by the MPU are connected to different peripheral!" as shown in Figure 2.14.
HOW DOES THE SYSTEM WORK?
Let us assume that a simple program with three instructions is already written and stored in binary in R/W memory. Those instructions are
1. Read on/off switches at input port No. 20H (H stands for hexadecimal.)
2. Turn on the devices corresponding to on switches at the output port 80H
3. Stop.
To execute these instructions, the MPU performs the following operations:
1. Places the memory address of instruction I on the address bus and fetches the instruction using the control signal Memory Read (The MPU may have to fetch instruction codes more than once if the instruction has more than one byte.) It decodes the instruction.
· Places the address 20H of the input port on the address bus, reads data(logic levels 0/1 of the switches) using the control signal I/O Read and stores the data in one of the registers.
2. Fetches the next instruction by placing the memory address of that instruction on the address bus and the control signal . Then, it decodes the instruction.
· It places the port address 80H and transfers the data using the control signal I/O Write and turns on the devices corresponding to on switches.
Figure 14
Example of a Microprocessor-Based System
3. Again fetches the last instruction from memory as before, decodes it, and stops.
This is a simplified description of how the system works; it excludes the details about multibyte instructions, machine cycles. and timing.