



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




By Dr.Oday A.L.A Ridha University of Baghdad- References:
interfacing”
David Benson, “PIC microcontroller application guide”
Martin Bates, “PIC microcontrollers: an introduction to microelectronics”
Tim Wilmshurst, “ Designing embedded systems with PIC microcontrollers: principles
and applications”
Microchip official site: http://www.microchip.com
http://www.eeherald.com
Embedded Systems is a special purpose computer system/board, which encapsulates all the devices such as processor, memory, interface and control in single package or board to perform only a specific application tasks.
Cell-phones Automatic Teller Machine The Digital Interfaced Gasoline Station Airborne Flight Control System Automotive Engine Health Monitoring System Home Security Systems Modern Air-conditioners Washing Machines Medical Equipment DVD Players Printers Medical Equipment The list goes on………. Wherever the microcontroller is used it's embedded computer.
The most common examples are,
Communication Computer Peripherals Industrial Control and Automotive Consumer Electronics Test and Measurement Medical Military/Aerospace
The leading applications of embedded market are,
A computer is made up of hardware and software. The hardware of a computer consists of four types of components: _ Processor. The processor is responsible for performing all of the computational operations and the coordination of the usage of resources of a computer. A computer system may consist of one or multiple processors. A processor may perform general-purpose computations or special-purpose computations, such as graphical rendering, printing, or network processing. _ Input devices. A computer is designed to execute programs that manipulate certain data. Input devices are needed to enter the program to be executed and data to be processed into the computer. There are a wide variety of input devices: keyboards, keypads, scanners, bar code readers, sensors, and so on. _ Output devices. No matter if the user uses the computer to do certain computation or to find information from the Internet or a database, the end results must be displayed or printed on paper so that the user can see them. There are many media and devices that can be used to present the information: CRT displays, flat-panel displays, seven-segment displays, printers, light-emitting diodes (LEDs), and so on. _ Memory devices. Programs to be executed and data to be processed must be stored in memory devices so that the processor can readily access them.
a) Von Neumann structure or architecture. The computer has just one address bus and one data bus, and
Memory and Processor Architectures
the same address and data buses serve both program and data memories. The input/output may also be interconnected in this way and made to behave like memory as far as the CPU is concerned. b) Harvard structure is an alternative to the Von Neumann structure. Every memory area gets its own address bus and its own d ata bus.
Another approach is to keep the CPU very simple and have a limited instruction set. This leads to the RISC approach – the Reduced Instruction Set Computer. The instruction set, and hence overall design, is kept simple. This leads to fast operation. One characteristic of the RISC approach is that each instruction is contained within a single binary word. That word must hold all information necessary, including the instruction code itself, as well as any address or data information also needed. A further characteristic, an outcome of the simplicity of the approach, is that every instruction normally takes the same amount of time to execute.
A processor is also called the central processing unit (CPU). The processor consists of at
The Processor
least the following three components: Registers. A register is a storage location inside the CPU. It is used to hold data and/or a memory address during the execution of an instruction. Because the register is very close to the CPU, it can provide fast access to operands for program execution. The number of registers varies greatly from processor to processor. Arithmetic logic unit (ALU). The ALU performs all the numerical computations and logical evaluations for the processor. The ALU receives data from the memory, performs the operations, and, if necessary, writes the result back to the memory. Today’s supercomputer can perform trillions of operations per second. The ALU and registers together are referred to as the datapath of the processor. Control unit. The control unit contains the hardware instruction logic. The control unit decodes and monitors the execution of instructions. The control unit also acts as an arbiter as various portions of the computer system compete for the resources of the CPU. The activities of the CPU are synchronized by the system clock. The clock rates of modern microprocessors have exceeded 3.0 GHz at the time of this writing,
where 1 GHz = 1 billion cycles per second
The period of a 1-GHz clock signal is 1 ns (10–9^ second). The control unit also maintains a register called the program counter (PC) that keeps track of the address of the next instruction to be executed. During the execution of an instruction, the occurrence of an overflow, an addition carry, a subtraction borrow, and so forth are flagged by the system and stored in another register called a status register. The resultant flags are then used by the programmer for program flow control and decision making.
The advancement of semiconductor technology allows the circuitry of a complete processor
The Microprocessor
to be placed in one integrated circuit (also called a chip ). A microprocessor is a processor
packaged in a single integrated circuit. A microcomputer is a computer that uses a microprocessor as its CPU. A personal computer (PC) is a microcomputer. Early microcomputers were very slow. However, many personal computers manufactured in 2003 run at a clock rate higher than 3.0 GHz and are faster than some supercomputers of a few years ago. Depending on the number of bits that a microprocessor can manipulate in one operation, a microprocessor is referred to as 4-bit, 8-bit, 16-bit, 32-bit, or 64-bit. This number is the word length (or datapath length ) of the microprocessor. Currently, the most widely used microprocessors are 8-bit. Although the clock rate of the microprocessor has been increased dramatically, the improvement in the access time of the high-capacity memory chips has been moderate at best. The microprocessor may complete one arithmetic operation in one clock cycle; however, it may take many clock cycles to access data from the memory chip. This disparity in speed makes the high clock rate of the microprocessor alone useless for achieving high throughput. The solution to this issue is adding a small high-speed memory to the CPU chip. This onchip memory is called cache memory. The CPU can access data from the on-chip cache memory in one or two clock cycles because it is very close to the ALU. The cache memory is effective in improving the average memory access time because the CPU demonstrates locality in its access behavior. Within a short period of time, the CPU tends to access a small area in the memory repeatedly. Once the program segment or data has been brought into the cache, it will be referenced many times. This results in an average memory access time very close to that of the access time of the cache memory.
Microprocessors and input/output (I/O) devices have different characteristics and speed. A microprocessor is not designed to deal with I/O devices directly. Instead, peripheral chips (also called interface chips ) are needed to make up the difference between the microprocessor and the I/O devices. For example, the Intel i8255 was designed to interface the 8-bit 8080 microprocessor from Intel, and the M6821 was designed to interface the 8-bit 6800 from Motorola with I/O devices. Microprocessors have been widely used in many applications since they were invented. However, there are several limitations in the initial microprocessor designs that led to the development of microcontrollers: __ External memory_ chips are needed to hold programs and data because the early microprocessors did not have on-chip memory. __ Glue logic_ (such as address decoder and buffer chips) is required to interface with the memory chips. __ Peripheral chips_ are needed to interface with I/O devices.
Because of these limitations, a product designed with microprocessors cannot be made as compact as might be desirable. The development of microcontrollers has not only eliminated most of these problems but also enabled the design of many low-cost microprocessor-based products.