6. Microcomputers and Microcontrollers

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 15

Fair Use Notice

The material used in this presentation i.e., pictures/graphs/text, etc. is solely


intended for educational/teaching purpose, offered free of cost to the students for
use under special circumstances of Online Education due to COVID-19 Lockdown
situation and may include copyrighted material - the use of which may not have
been specifically authorised by Copyright Owners. It’s application constitutes Fair
Use of any such copyrighted material as provided in globally accepted law of many
countries. The contents of presentations are intended only for the attendees of the
class being conducted by the presenter.
Microcomputers and
microcontrollers
Microcomputers

• The digital circuits allow the implementation of combinational


and sequential logic operations by interconnecting ICs containing
gates and flip-flops.
• This is considered a hardware solution because it consists of a
selection of specific ICs, which when hardwired on a circuit
board, carry out predefined functions.
• To make a change in functionality, the hardware circuitry must
be modified and may require a redesign.
• However, in many mechatronics systems, the control tasks may
involve complex relationships among many inputs and outputs,
making a strictly hardware solution impractical. A more
satisfactory approach in complex digital design involves the use of
a microprocessor-based system to implement a software solution.
Microcomputers

• A microprocessor is a single, very-large-scale-integration (VLSI)


chip that contains many digital circuits that perform arithmetic,
logic, communication, and control functions.
• When a microprocessor is packaged on a printed circuit board
with other components, such as interface and memory chips, the
resulting assembly is referred to as a microcomputer or single-
board computer.
• Fig. 1 illustrates the overall architecture of a typical
microcomputer system using a microprocessor. The
microprocessor, also called CPU or MPU, is where the primary
computation and system control operations occur.
• The arithmetic logic unit (ALU) within the CPU executes
mathematical functions on data structured as binary words.
Microcomputers

Fig. 1. Microcomputer Architecture


Microcomputers

• The following define some terms that are key to a CPU’s operation in the storage
and retrieval of data.
• A word is an ordered set of bits, usually 8, 16, 32, or 64 bits long.
• The instruction decoder interprets instructions fetched sequentially from memory
by the control unit and stored in the instruction register. Each instruction is a set of
coded bits that commands the ALU to perform bit manipulation, such as binary
addition and logic functions, on words stored in the CPU data registers. The ALU
results are also stored in data registers and then transferred to memory by the
control unit.
• The bus is a set of shared communication lines that serves as the ‘central nervous
system’ of the computer. Data, address, and control signals are shared by all
system components via the bus.
• Each component connected to the bus communicates information to and from the
bus via its own bus controller. The data lines, address lines, and control lines allow
a specific component to access data addressed to that component.
Microcomputers

• The data lines are used to communicate words to and from data registers in the
various system components such as memory, CPU, and input/output (I/O)
peripherals.
• The address lines are used to select devices on the bus or specific data locations
within memory. Devices usually have a combinational logic address decoder
circuit that identifies the address code and activates the device.
• The control lines transmit read and write signals, the system clock signal, and
other control signals such as system interrupts, which are described in subsequent
sections.
• The read-only memory (ROM) is used for permanent storage of data that the CPU
can read, but the CPU cannot write data to ROM. ROM does not require a power
supply to retain its data and therefore is called non-volatile memory.
• Random access memory (RAM) is used for storing data that is used during the
program run-time: Data can be read from or written to RAM at any time, provided
power is maintained.
Microcomputers

• Erasable-programmable ROM (EPROM): Data stored in an EPROM can be erased


with ultraviolet light applied through a transparent quartz window on top of the
EPROM IC. Then new data can be stored on the EPROM. Another type of EPROM
is electrically erasable (EEPROM).
• Reduced instruction-set computer (RISC): When the set of instructions is small, the
microprocessor is known as a RISC microprocessor. RISC microprocessors are
cheaper to design and manufacture, and are usually faster than the conventional
microprocessor.
• Machine code: The instructions that can be executed by the CPU are defined by a
binary code called machine code. The instructions and corresponding codes are
microprocessor dependent.
• Assembly language: Microprocessors can be programmed using assembly language,
which comprises mnemonic commands corresponding to each instruction.
• Assembler: Assembly language must be converted to machine code using the
assembler, to be understood and executed by microprocessor.
Microcomputers

• High-level languages: Programs can also be written in a higher-level language such


as BASIC or C, provided that a compiler is available that can generate machine
code for the specific microprocessor being used.
• The advantages of using a high-level language are:
• ease of learning and use;
• ease of debugging programs (the process of finding and removing errors);
• ease of comprehension of programs
• availability of programming techniques, such as variable and array management,
assignment statements with complex calculations, logical comparison expressions,
iteration, interrupts, pauses, and special purpose functions.
• Disadvantages: the resulting machine code may be less efficient (i.e. slower and
require more memory) than a corresponding well-written assembly language
program;
• consumption of more EEPROM space.
Microcontrollers

• The microcontroller contains a microprocessor, memory, I/O capabilities, and other


on-chip resources.
• It is basically a microcomputer on a single IC. Popular microcontrollers that have
being in great demand for realizing mechatronics systems are:
• Microchip’s PIC; Motorola’s 68HC11; and Intel’s 8096.
• Factors that have driven the development of the microcontroller are low cost,
versatility, ease of programming, and small size.
• Microcontrollers are attractive in mechatronics system design since their small size
and broad functionality allow them to be physically embedded in a system to
perform all of the necessary control functions
• Fig. 2 shows a block diagram for a typical full-featured microcontroller.
• Included in the figure are lists of typical external devices that might interface to the
microcontroller. The components of a microcontroller are the:
• CPU, RAM, ROM, Digital I/O ports, A serial communication interface, Timers,
Analog-to-digital (A/D) converters, and digital-to-analog (D/A) converters
Microcontrollers

Fig. 2. Components of a typical full-featured microcontroller.


The PIC16F84 Microcontroller

• The PIC16F84 (Fig. 3) is a low cost, high performance, CMOS, fully static 8-bit
microcontroller. Similar to all the PIC microcontrollers, the PIC16F84 employs an
advanced reduced instruction set computer (RISC) architecture.
• The separate instruction and data buses of the Harvard architecture allow a 14-bit
wide instruction word with a separate 8-bit wide data bus. The high performance
RISC CPU features make PIC very versatile and useful in many mechatronics
projects.
• It has 35 single word instructions. It operates at a maximum “f” of 10 MHz. The
program memory allows 1 kB of flash memory, 68 bytes of data RAM and 64 bytes
of data EEPROM. It also has four interrupt sources.
• The PIC16F84 provides 1000 erase/write cycles to the flash memory. The
EEPROM can retain data for more than 40 years.
• It has 13 I/O pins for individual direction control. It provides a 25 mA sink per pin
and 20 mA source per pin; sufficient to drive LEDs. An 8-bit timer/counter makes
the PIC suited for timer-based mechatronic projects.
The PIC16F84 Microcontroller

Fig. 2. The PIC16F84 microcontroller block diagram. (Courtesy of Microchip Technology Inc.).
Main Features PIC16F84 Microcontroller

• The PIC16F84 generally operates on a regulated 5 V supply but has an operable


range from 2 V to 6 V. Its power consumption is minimal and hence can be
operated with dry cells for long hours. The PIC16F84 is available as an 18-pin dual-
in-line package.
• 8-bit wide data bus CMOS microcontroller;
• 18-pin DIP, SOIC;
• 1792 bytes of flash EEPROM program memory subdivided into 14-bit words (0h–
3Fh);
• 68 bytes of RAM data memory;
• 64 bytes of non-volatile EEPROM data memory;
• 1024 (1 kB) instructions capability;
• 4 MHz clock speed (maximum 10 MHz);
• 15 special function hardware registers;
• 36 general purpose registers (SRAM); 13 I/O pins
Homework

• Home Work:
• Detailed report on the architecture of Microcontrollers.
• Report on sub-sections of PIC16F84 Microcontroller.

You might also like