Technician's Guide to 68HC11 Microcontroller.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
chapter 1 Introduction to Computer Hardware Objectives I ntr odu ct ion to Com put er H ardw are After completing this chapter, you should be able to: ◗ Describe the fundamental elements of every computer system: proces- sor, memory, and input/output ◗ Compare elements of the HC11 block diagram to the fundamentals of every computer system ◗ Describe the use of busses to connect computer elements ◗ Explain the three major functional units of a processor ◗ Illustrate the typical registers inside the processor ◗ List the HC11 processor registers ◗ Discuss the HC11 processor modes ◗ Compare and contrast various memory types ◗ Describe the on-chip memory of the HC11 ◗ Specify input/output functions present on most computers ◗ Use some basic BUFFALO commands to control the EVBU Outline ◗ 1.1 Elements of Every Computer ◗ 1.2 Elements of Processors ◗ 1.3 Introduction to Memory ◗ 1.4 Memory Types ◗ 1.5 Input/Output 1 ◗ 1.6 EVBU/BUFFALO Technician’s Guide to the 68HC11 Microcontroller Introduction Computer systems have been developed for a variety of functions and purposes. General-application desktop machines are the most common. They run a variety of software applications, such as word processing, financial management and data processing. They have all but replaced the typewriter as a necessary business tool. Computers are also present in automobiles, appliances, airplanes and all types of controllers and electromechanical devices. Despite the differences among these computer systems, they all share fundamental components and design. The purpose of this chapter is to provide an understanding of the fundamental components of a computer system. A conceptual presentation regarding the elements of every computer system is made with sufficient detail to establish a foundation for these concepts. The concepts will then be extended to the HC11 hardware. 1.1 Elements of Every Computer All computers are made up of a group of three fundamental elements: a central processor, memory, and input/output devices. Figure 1.1 shows a block diagram of a computer that includes these three elements. The examination of any kind of desktop computer, workstation or computer control system will reveal at least this minimum structure. Many computing devices will have multiple processors, multiple memory types, and numerous input/output devices. In many cases, the input/output devices contain all three elements as a unit. Video cards for personal computers, for example, always contain a video processor and memory in addition to their inherent input/out- put capability. Address Bus Memory Data Bus Central Processor (CPU) Connection to the Outside World Input/Output Control Bus 2 Figure 1.1 Fundamental Block Diagram of a Computer Introduction to Computer Hardware HC11 Hardware Block Diagram The HC11 is a computer system on a single chip that contains the three functional blocks of a computer system. Its internal central processor is a member of the 6800 family of processors; it has on-board memory and sophisticated on-chip input/output capabilities. The HC11 block diagram is shown in Figure 1.2. This block diagram is specific to the M68HC11E9 version of the HC11. This version of the HC11 is used on the development board (EVBU), as well as in the examples used throughout this text. Three types of memory are included on-chip: RAM, ROM and EEPROM. The HC11 also supports expanded off-chip memory. It contains five on-chip input/output functions, an analog-to-digital converter, and a sophisticated timing system that supports numerous event-driven functions. The address, data and control busses are not shown in this diagram; the processor is connected to the memory and input/output functions inside the HC11 chip in the manner illustrated in Figure 1.1. 3 Figure 1.2 M68HC11E9 Block Diagram Technician’s Guide to the 68HC11 Microcontroller NOTE: Throughout this text, references to the HC11 presume the M68HC11E9 version of the chip; thus, the shorter, more general name “HC11” will be used, unless otherwise specified. Central Processor The processor is the device at the center of the machine. It has the responsibility to execute instructions, manipulate data and perform arithmetic functions. It controls and manages the activities of the entire machine. The human brain is the ultimate processor. It can receive and process instructions, process data (like visual images and sounds) and perform arithmetic calculations. However, the human brain is much, much more than a processor because it has the ability to think and to reason. Computer processors cannot think in the same sense. The term Central Processing Unit (CPU) is used to refer to the main processor in a system. The CPU often works in conjunction with a set of processors to complete a whole system. Modern computers contain additional processors, other than the CPU. They contain video processors, input/output processors, memory controllers, interrupt controllers and math co-processors, to name a few. Since these other processors are subordinate to the central processor, they are often called sub-processors. Many peripheral devices, such as harddrives, printers and video projection systems, have dedicated processors embedded into their control circuitry. Memory Memory is a term that refers to any component that stores data and programs used by the processor. Memory can have many forms. There are semiconductor memories, magnetic memories, and optical memories. Semiconductor memories include read only memory (ROM) and read/write memory (RAM). Magnetic memories include floppy disk drives, hard disk drives and tape systems. Optical memories include CD-ROM, DVD and optical disks. A thorough presentation of memory relevant to the HC11 will be provided in chapter 8. Section 1.3 will address concepts of memory that are applicable to all computer systems and a necessary foundation for this study of the HC11. Input/Output Input/Output is a term that refers to any subsystem that has the responsibility of receiving data for the processor (input) or sending data out from the processor (output). Input/Output is typically abbreviated as I/O and does not necessarily imply that a particular device has both input and output capability. Typical input devices are keyboards, mice or scanners. Typical output devices are printers and monitors. Typical devices that perform both input and output functions are modems or tape drives. 4 Collectively, all these devices are referred to as I/O devices. The HC11 I/O capability is discussed in detail in chapters 10 through 13. Introduction to Computer Hardware Busses The processor communicates with the memory and I/O via busses. On a computer, a bus is a set of two or more conductors that are grouped together to form a parallel information path to and/or from the processor. The bus size, given in bits, is a measure of the number of conductors that can be active simultaneously on the bus. There are three major busses on computer systems: the data bus, the address bus and the control bus. The data bus is responsible for the transfer of data between the processor and memory or the processor and I/O. It is a bidirectional bus, because data can travel to or from the processor and other devices. Typically, a data bus transfers data in byte widths. Thus, a data bus is an 8-bit, 16-bit or 32-bit bus (1 byte, 2 bytes or 4 bytes wide). The number of bits, or data bus width, also directly correlates with the default processing capacity of the processor. Typically, processors and computers are referred to by the size of their data busses. An HC11 is considered an 8-bit processor because it has an 8-bit data bus and has the default processing capability of one byte. Pentium-based personal computers are 32-bit or 64-bit machines. Thus, they can process four or eight bytes simultaneously. The address bus is responsible for the transfer of addresses from the processor to mem- ory or to I/O. The address is used to identify specific memory locations or I/O devices. It is a unidirectional or one-way bus, because processors are the only devices that can create an address for memory or I/O. Typically, an address bus transfers addresses over the bus in double byte widths. Thus, an address bus is usually a 16-bit, 32-bit, or 64-bit bus (2 bytes, 4 bytes or 8 bytes wide). The HC11 uses a 16-bit address bus. The control bus is responsible for the control signals necessary to interface the various devices within a computer system. This bus is not typically structured as a fixed number of conductors, as are the data and address busses. It is more likely to be a collection of all other signals necessary for proper operation of the system. Figure 1.3 illustrates how busses might be implemented between an HC11 and some expanded off-chip memory device. This example uses a 16-bit address bus, an 8-bit data bus and two control signals that would be part of a larger system control bus. Address Bus External Data Bus HC11 Memory Chip Device Read/Write Control Output Enable Two signals connected to the memory device that are part of the system control bus 5 Figure 1.3 Computer Bus Example Technician’s Guide to the 68HC11 Microcontroller Self-Test Questions 1.1 1. What are the three main hardware components of a computer? 2. What is the function of each of the three hardware components of a computer? 3. What connects the three hardware components and allows the data, addresses and control signals to move between these components? 1.2 Elements of Processors Processors have the job of processing the data within a computer and controlling the overall operation of the system.