Microprocessor and Peripherals Interfacing Notes: Course Code: ECC501 Class: TE-EXTC Mumbai University
Microprocessor and Peripherals Interfacing Notes: Course Code: ECC501 Class: TE-EXTC Mumbai University
Course objectives:
To understand the basic concepts of microcomputer systems.
To develop background knowledge and core expertise in 8086 microprocessor and co-
processor 8087.
To write assembly language programs for 8086 microprocessor
To understand peripheral devices and their interfacing to 8086 and to study the design
aspects of basic microprocessor based system.
Course outcomes:
After successful completion of the course student will be able to
Understand the basic concepts of microcomputer systems.
Understand the architecture and software aspects of microprocessor 8086.
Write Assembly language program in 8086.
Know the Co-processor configurations.
Interface peripherals for 8086.
Design elementary aspect of microprocessor based system.
CPU
The CPU is the heart and brain of a computer. It receives data input, executes instructions, and
processes information. It communicates with input/output (I/O) devices, which send and
receive data to and from the CPU. Additionally, the CPU has an internal bus for communication
with the internal cache memory. The CPU contains internal memory units, which are called
registers. These registers contain data, instructions, counters and addresses used in the ALU's
information processing.
Clock
In a computer, clock speed refers to the number of pulses per second generated by an oscillator
that sets the tempo for the processor. Clock speed is usually measured in MHz (megahertz, or
millions of pulses per second) or GHz (gigahertz, or billions of pulses per second). Today's
personal computers run at a clock speed in the hundreds of megahertz and some exceed one
gigahertz. The clock speed is determined by a quartz-crystal circuit, similar to those used in
radio communications equipment.
Computer clock speed has been roughly doubling every year. The Intel 8088, common in
computers around the year 1980, ran at 4.77 MHz. The 1 GHz mark was passed in the year
2000.
8086 requires an external clock generator/driver chip Intel 8254 to generate the 8086 clock
input signal. The 8086 divides the external clock connected at the CLK pin internally by three.
Memory
Semiconductor memory is a digital electronic data storage device, often used as computer
memory, implemented with semiconductor electronic devices on an integrated circuit (IC).
There are many different types of implementations using various technologies.
Most types of semiconductor memory have the property of random access, which means that
it takes the same amount of time to access any memory location, so data can be efficiently
accessed in any random order.
Microprocessor doesn’t contain any internal RAM/ROM memory, they are normally interfaced
externally.
1. Address Bus:
It is a group of wires or lines that are used to transfer the addresses of Memory or I/O devices.
It is unidirectional. In Intel 8086 microprocessor, Address bus was of 20 bits.
It can access 220 = 10, 48,576 locations in memory, as in 8086 memory is mostly byte
organized means at each location/address memory can store 8 bits=1 byte of data, therefore 10,
48,576 locations multiplied by one byte is equal to 10,48,576 bytes = 1Mb.
2. Data Bus:
As name tells that it is used to transfer data within Microprocessor and Memory/Input or Output
devices.
It is bidirectional as Microprocessor requires to send or receive data.
3. Control Bus:
Microprocessor uses control bus to process data that is what to do with the selected memory
location.
Some control signals are Read, Write and Opcode fetch etc.
Various operations are performed by microprocessor with the help of control bus.
This is a dedicated bus, because all timing signals are generated according to control signal.
Tristate Logic
A tri-state buffer is similar to a buffer, but it adds an additional "enable" input that controls
whether the primary input is passed to its output or not. If the "enable" inputs signal is true,
Need of ALP
As a programmer, the closest you can come to the processor of a machine is by using assembly
language. Here, you can write code to access the registers and even deal with memory addresses
directly for retrieving values and pointers. So, if you are writing a program that has a great
algorithm, you are going to benefit greatly. This is mainly because assembly language is the
gateway to optimization in speed, thereby offering great efficiency and performance.
If you are writing a program that is meant to be a compiler or a device driver, then a complete
understanding of the processor’s function is a big plus. So, in this case the best option is to
write some code in assembly language and see how the processor and the memory work.
3. Direct access to hardware
Assembly language is the only language that speaks to the computer/machine directly. It is the
language that a certain CPU recognizes and different CPUs recognize different types of them.
When compared to high-level languages, which are mostly in the form of abstract data types,
assembly language is bare and transparent. This is largely since it has a small number of
operations. So, this is very helpful for algorithm analysis, consisting of semantics and flow of
control. It also makes it easier for debugging, as it is less complex. Overall, there is less
overhead as compared to high-level languages.
Compiler
The compiler is a computer program that reads the program written in a source language,
translates it into equivalent assembly language and forwards the assembly language code to the
Assembler. While the translation of the source code to assembly code the compiler also reports
the error in the source code to its user.
Compilers are also classified as single-pass, multi-pass, load-and-go, debugging and
optimization. Classification is done on the basis of what function does a compiler perform and
Assembler
The assembler takes as input the assembly code generated by the compiler and translates it into
relocatable machine code.
Assembly code is the mnemonic version of machine code. It means it assembly code uses
names for representing operations and it even gives names to the memory addresses. On the
other hands, the machine code uses binary codes for representation of operations and memory
addresses.
Even the simplest form of assembler performs two passes over the input.
The first pass detects all the identifiers in the assembly code that denotes storage location and
store them in the symbol table (other than compilers symbol table). The storage location is
assigned to the identifier that is encountered in the first pass.