Mechatronics Engineering (OFRME200) Lecture 9 PDF
Document Details
Uploaded by DeadOnMotif9031
Menoufia University
Walaa Shoeib
Tags
Summary
This document is a lecture on mechatronics engineering, specifically focusing on microcontroller structure and buses, as well as an introduction to the CPU, accumulator, and status registers, for a Level 2 course at Menoufia University. The lecturer is Walaa Shoeib.
Full Transcript
Mechatronics Engineering (OFRME200) LEC. 9 Level 2- Fall Semester By: Walaa Shoeib Faculty of Electronic Engineering, Menoufia University. CHAPTER 5 Microcontroller Structure 2 Introduction Computers have three sections: a contro...
Mechatronics Engineering (OFRME200) LEC. 9 Level 2- Fall Semester By: Walaa Shoeib Faculty of Electronic Engineering, Menoufia University. CHAPTER 5 Microcontroller Structure 2 Introduction Computers have three sections: a control processing unit (CPU) to recognize and carry out program instructions input and output circuitry interfaces to handle communications between the computer and the outside world memory to hold the program instructions and data. 3 Introduction Computers have three sections: Digital signal move from one section to another along paths called buses. A bus, in the physical sense, is just a number of conductors along which electrical signals can be carried 4 Introduction Computers have three sections: The data associated with the processing function of the CPU is carried by the data bus the information for the address of a specify memory location for the accessing of stored data is carried by the address bus and the signal relating to control actions are carried by the control bus 5 Buses The data bus is used to transport a word to or from the CPU and the memory or the input/output interfaces. Word length used may be 4, 8, 16, 32 or 64. Each wire in the bus carries a binary signal, i.e., a 0 or a 1. 6 The center processing unit (CPU) is the section of the processor which processes the data, fetching instruments from memory, decoding them, and executing them. It can be considered to consist of a control unit, arithmetic and logic unit (ALU) and registers 7 The center processing unit (CPU) The control unit determines the timing and sequence of operations. It generates the time signals used to fetch a program instrument form memory and execute it. The Motorola 6800 used a clock with a maximum frequency of 1 MHz, i.e., a clock period of 1 μs, and instructions require between two and twelve clock cycles. The arithmetic and logic unit is responsible for performing the actual data manipulation. Internal data that the CPU is currently using in temporarily held in a group of registers while instructions are being execute. 8 Accumulator is where data for an input to the arithmetic and logic unit is temporarily stored. In order for the CPU to be able to access, i.e. read, instructions or data in the memory it has to supply the address of the required memory word using the address bus 9 Accumulator When this has been done, the required instructions or data can be read into the CPU using the data bus. Since only one memory location can be addressed at once, temporary storage must be used when 10 Accumulator When this has been done, the required instructions or data can be read into the CPU using the data bus. Since only one memory location can be addressed at once, temporary storage must be used when 11 Accumulator Example in the addition of two numbers, one of the numbers is fetched from one address and placed in the accumulator register while the CPU fetches the other number form the other memory address. Then the two numbers can be processed by the arithmetic and logic section of the CPU. The result is then transferred back into the accumulator register. The accumulator register is thus a temporary holding register for data to be operated on by the arithmetic and logic unit and also, after the operation, the register for holding the results. It is thus involved in all data transfers associated with the execution of arithmetic and logic operations 12 Status register The contains information concerning the result of the latest process carried out in the arithmetic and logic unit. It contains individual bits with each bit having special significance. The bits are called flags. The status of the latest operation is indicated by each flag with each flag being set or reset to indicate a specific status. For example, they can be used to indicate whether the last operation resulted in a negative result, a zero result, a carry output occurs an overflow occurs, or the program is to be allowed to be interrupted to allow as external event to occur. 13 14