You are on page 1of 27

6

Microcontroller and
Microprocessor
Introduction
Control ; If we take a simple control problem, e.g. the sequencing of the red, yellow,
green lights at a traffic crossing, then it should be possible to solve it by an electronic
control system involving combinational and sequential logic integrated circuits.
Microprocessor Systems
Systems using microprocessors basically have three parts: a central processing unit
(CPU) to recognize and carry out program instructions (this is the part which uses the
microprocessor), input and output interfaces to handle communications between the
microprocessor and the outside world (the term port is used for the interface) and memory
to hold the program instructions and data.

Microprocessors which have memory and various input/output arrangements all on the
same chip are called microcontrollers.
General form of a microprocessor system and its buses
Buses
Digital signals move from one section to another along paths called buses. A bus, in the
physical sense, is just a number of parallel conductors along which electrical signals can
be carried and are paths which can be shared by all the chips in the system.

Typically a bus has 16 or 32 parallel connections so that each can carry 1 bit of a data
word simultaneously. This gives faster transmission than having a serial connection in
which an entire word is sent in a sequence of bits along a single conductor.

There are three forms of bus in a microprocessor system ;

1. Data bus ; The data associated with the processing function of the CPU is carried by the
data bus. Thus, it is used to transport a word to or from the CPU and the memory or the
input/output interfaces.
Cont.
Each wire in the bus carries a binary signal, i.e. a 0 or a 1.

2. Address bus; The address bus carries signals which indicate where data is to be found
and so the selection of certain memory locations or input or output ports. Each storage
location within a memory device has a unique identification, termed its address, so that the
system is able to select a particular instruction or data item in the memory.

Each input/output interface also has an address. When a particular address is selected by
its address being placed on the address bus.

3. Control bus; The signals relating to control actions are carried by the control bus. For
example, it is necessary for the microprocessor to inform memory devices whether they are
to read data from an input device or write data to an output device.
The Microprocessor
The microprocessor is generally referred to as the central processing unit (CPU).
General internal architecture of a microprocessor
Cont.
It is that part of the processor system which processes the data fetching instructions from
memory, decoding them and executing them. The internal structure-the term architecture-
is used-depends on the microprocessor concerned.

The following are the functions of the constituent parts of a microprocessor.

1. Arithmetic and logic unit (ALU); The arithmetic and logic unit is responsible for
performing the data manipulation (arithmetic function, addition subtraction
multiplication, logic gates).

2. Registers; Internal data that the CPU is currently using is temporarily held in a group
of registers while instructions are being executed. These are memory locations within
the microprocessor and are used to store information involved in program execution.
Cont.
3. Control unit; The control unit determines the timing and sequence of operations. It
generates the timing signals used to fetch a program instruction from memory and execute
it. The Motorola 6800 uses 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.
Memory
The memory unit in a microprocessor system stores binary data and takes the form of
one or more integrated circuits. The data may be program instruction codes or numbers
being operated on.

The size of the memory is determined by the number of wires in the address bus. The
memory elements in a unit consist essentially of large numbers of storage cells with each
cell capable of storing either a 0 or a 1 bit. The storage cells are grouped in locations
with each location capable of storing one word.

The size of a memory unit is specified in terms of the number of storage locations
available; 1K is locations and thus a 4K memory has 4096 locations
Cont.
There are a number of forms of memory unit ;

1. ROM ; For data that is stored permanently a memory device called a read-only memory
(ROM) is used. ROMs are programmed with the required contents during the manufacture
of the integrated circuit. No data can then be written into this memory The data can only be
read and is used for fixed programs such as computer operating systems and programs for
dedicated microprocessor applications. They do not lose their memory when power is gone.

2. PROM ; The term programmable ROM (PROM) is used for ROM chips that can
be programmed by the user. Initially every memory cell has a fusible link which
keeps its memory at 0. The 0 is permanently changed to 1 by sending a current
through the fuse to open it permanently.
Cont.
3. EPROM ; The term erasable and programmable ROM (EPROM) is used for ROMs that
can be programmed and their contents altered. A typical EPROM chip contains a series of
small electronic circuits, cells, which can store charge.

4. EEPROM ; Electrically erasable PROM (EEPROM) is similar to EPROM. Erasure


is by applying a relatively high voltage rather than using ultraviolet light.

5. RAM ; Temporary data, i.e. data currently being operated on, is stored in a read/write
memory referred to as a random-access memory (RAM). Such a memory can be read or
written to.
Cont.
 When ROM is used for program storage, then the program is available and ready for use
when the system is switched on. Programs stored in ROM are termed firmware. Some
firmware must always be present.

When RAM is used for program storage then such programs are referred to as software.
When the system is switched on, software may be loaded into RAM from some other
peripheral equipment such as a keyboard or hard disk or floppy disk or CD.
Input/output
 The input/output operation is defined as the transfer of data between the microprocessor
and the external world. The term peripheral devices is used for pieces of equipment that
exchange data with a microprocessor system.
Microcontrollers
 For a microprocessor to give a system which can be used for control, additional chips
are necessary, e.g. memory devices for program and data storage and input/output ports
to allow it to communicate with the external world and receive signals from it.

While, the microcontroller is the integration of a microprocessor with memory and


input/output interfaces, and other peripherals such as timers, on a single chip.

The general microcontroller has pins for external connections of inputs and outputs,
power, clock and control signals.

The pins for the inputs and outputs are grouped into units called input/output ports.
Usually such ports have eight lines in order to be able to transfer an 8-bit word of data.
Block diagram of a
microcontroller
Atmel Microcontroller
Raspberry Pi Microcontroller
Cont.
 Microcontrollers have limited amounts of ROM and RAM and are widely used for
embedded control systems. A microprocessor system with separate memory and
input/output chips is more suited to processing information in a computer system.
Intel 8051
 Another common family of microcontrollers is the Intel 8051, showing the pin
connections and the architecture. The 8051 has four parallel input/output ports, ports 0,
1, 2 and 3. Ports 0, 2 and 3 also have alternative functions.

The 8051AH version has 4K ROM bytes, 128-byte RAM, two timers and interrupt control
for five interrupt sources.
Intel 8051
Applications
Temperature measurement system

As a brief indication of how a microcontroller might be used, shows the main elements
of a temperature measurement system using an MC68HC11. The temperature sensor
gives a voltage proportional to the temperature (e.g. a thermo-transistor such as LM35).
The output from the temperature sensor is connected to an ADC input line of the
microcontroller.

The microcontroller is programmed to convert the temperature into a binary-coded


decimal (BCD) output which can be used to switch on the elements of a two-digit, seven-
element display. However, because the temperature may be fluctuating it is necessary to
use a storage register which can hold data long enough for the display to be read.
Temperature measurement system
Programming
A commonly used method for the development of programs follows the following steps;

1. Define the problem, stating quite clearly what function the program is to perform, the
inputs and outputs required, any constraints regarding speed of operation, accuracy,
memory size, etc.

2. Define the algorithm to be used. An algorithm is the sequence of steps which define a
method of solving the problem.

3. For systems with fewer than thousands of instructions a useful aid is to represent the
algorithm by means of a flow chart. Each step of an algorithm is represented by one or
more of these symbols and linked together by lines to represent the program flow.
Thank you!!

You might also like