0% found this document useful (0 votes)
5 views

Lect # 5-Architecture_Microcontroller [Compatibility Mode]

The document covers the architecture and components of microprocessors, including their selection criteria and differences between microcomputers and programmable controllers. It discusses input/output devices, buses, registers, and memory organization, as well as the importance of memory requirements in embedded systems. Additionally, it touches on number representation in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lect # 5-Architecture_Microcontroller [Compatibility Mode]

The document covers the architecture and components of microprocessors, including their selection criteria and differences between microcomputers and programmable controllers. It discusses input/output devices, buses, registers, and memory organization, as well as the importance of memory requirements in embedded systems. Additionally, it touches on number representation in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

MECHATRONICS

Lecture 6
Todays Topic:
1. The Architecture of Microprocessor
2. Selection of a Microprocessor
p Systems
y
3. Input/Output devices
4. Micro-Computer
5
5. P
Programmable bl Controller
C ll
6. Difference b/w Microcomputer & Controller
7
7. Buses
8. Registers
9. Memoryy
The Architecture of Microprocessor
Data Bus
The Clock
Microprocessor
Memory Data
Register Instruction Control
Register Memory

Accumulation Stock Internal


Pointer S k
Stock

Memory Address Program ALU


Register Counter

Memory Address Bus I/O

I/O

Components of Microcomputer I/O


Microprocessor
1.Microprocessor has a silicon chip that contain a CPU.
2 I controls
2.It l the
h logic
l i off all
ll digital
di i l devices
d i f
from a clock
l k to a
fuel injection system.
It has three parts: 1. CPU, 2. I/O Interfaces (Registers), &
Control unit.
A microprocessor is a single-large scale integration (LSI) chip
that
h containsi many digital
di i l circuits
i i thath performf arithmetic,
ih i
communication, & control functions necessary to process the
information.
information
A. A microprocessor consists of the following devices
B. Digital IC’s & built-in transistors Æ contains digital
functions for the process
C. Control center of digital system
D
D. Built-in instruction sets Æ tells the device how
Î Control the operations
Î Execute user written programs.
Selection of Microprocessor Systems
• The microprocessor system will be originally conceived from a
functional requirement.
requirement For example,
example to control a robot arm,
arm or to
monitor some process etc.
• Based on the requirements the system specification will be made
Input/Output requirements
• The number and type of input/output devices will be based on the
number
b off sensors andd actuators needed
d d for
f the
h function
f
• Communications with other systems in order to provide remote
control will be chosen to be compatible with these systems in terms
of both hardware and protocols used.
Selection of mP System
• Complexity of the function to be performed will
influence the choice of the processor, the CPU in
particular.
• Performance is the most critical factor to be
considered and most difficult to assess:
Number of operations per second IS NOT a sufficiently
good indicator of the performance.
ÆBenchmarking is better ‐ running a representative piece
of code to determine the speed of execution.
ÆSimulator is another good way of assessing the
performance.
In Short Factors For Selectingg Microcontroller

• Number of I/P Pins


• Interfaces required
• Memory requirement
i
• Number of interrupts required
• Process speed required
Input/Output devices
• Input and output devices provide the means by which a
microprocessor system can convey information between itself
and the outside world.
world
• Microprocessor has to accept input information, respond to it
and p
produce output
p signals
g to implement
p required
q control
• There may be inputs from sensors to provide data to the
microprocessor and outputs such as relays or motors
• The
Th term peripheral
i h l is i usedd for
f a device
d i connected d to a
microprocessor. Such devices add specific functions, like timers
and interrupt controllers to the mP system
Input/Output devices
• But, they
h cannot be,b in general,l directly
d l connected d to a
microprocessor due to a lack of compatibility with the bus
system in signal forms and levels.
levels
• A circuit, called an interface, is used between the
peripheral devices and the microprocessor to overcome
this problem ‐ to perform the required conversion.
• In general, I/O devices contain 2 types of registers:
• Control, or status register ‐ through which the
program
p g can control the mode of operation
p of the
I/O device.
yp of register
• The second type g provides the data p
p path
to enable the microprocessor system to read/write
information to the outside world.
Micro‐Computer
1. When a microprocessor is packaged on a printed
circuit board with other components such as interface
(i/o_ & memory chips is referred as a microcomputer.
2 Hence
2. H a microcomputer
i t i
is composedd off a
microprocessor, memory, I/O devices and wired
connections (called buses) between system
components. Input devices are Keyboard and disks,
mic, light
g pen etc and output devices are Monitors and
Printers.
Important feature of microcomputer is that it can be
programmed d by
b a user with
i h a sequence off instructions
i i
to executed.
Programmable Controller
It is digital operating electronic apparatus Æ uses a programmable memory
for internal storage of instructions for implementing specific functions such
g , sequencing,
as logic, q g, timing,
g, countingg and arithmetic to control through
g
digital or analog I/O modules.
The inclusion of programming, storage, logic and arithmetic capabilities
makes programmable controller sound very much likes a microcomputer.
It is a special form of microcomputer and uses essentially same internal
architecture.
Microcomputer systems were traditionally never design for use in harsh
industrial environment i.e. rough handling, temperature etc. This led to the
creation of programmable controller with built in digital and analog I/O that
could directly interface to industrial processes.
processes
A more general-purpose controller is PLC that is programmed in language
known as ladder logic, which is based on operation of relay circuits.
Important requirements for a controller are number of digital I/O points,
points
number of I/O analog channels and presence of special registers for counting
and timing events.
Difference b/w Microcomputer & Controller

1
1. Micro computer are designed
Micro-computer 1. Programmable controller are
with computational designed with i/o capabilities.
capabilities.
2. Important requirements for a
2. Important requirement of controller are number of digital
Microcomputer is memory size i/o points, number of i/o analog
& speed of execution channels, & ppresence of special
p
registers for counting & timing
events
Buses
- Digital signal move from section to another along
path called buses.
- A bus in a physical sense is just a number of
conductors along with electrical signals can be
carried.
i d
- These are tracks on a printed circuit board or
wires in a ribbon cable.
cable
- There are three forms of buses in a
microprocessor system named
Î Data bus
Î Address bus and
Î Control bus
Buses
Data Bus

To transfer the data associated with the processing


function of the microprocessor.
p Word lengths
g may y
be 4,8,16 or 32 bits. Each wire in the bus carries a
binaryy signal
g ((0 or 1).
) The more wires the data
bus has the longer the word length that can be
used. Thus, for the word length g of 4 bits, the
number of values that can be transferred is 24=16
Address Bus

Which contains the address of a specific


p memoryy
location for accessing stored data. It carries
signals
g which indicate where data is to be found
so that certain memory locations can be selected.
When a p particular address is selected byy its
address being placed on the address bus, only that
location is open
p for communication with CPU.
The CPU communicates with only one address at
a time. Usuallyy address bus contains 16 wires.
Control Bus
This carries the control signals to the memory and
the I/O devices. It is used to synchronise separate
elements. The system clock signal is carried by
the control bus.
Accumulator Register
• Accumulator register ‐ where data for the input to ALU is
temporarily stored.
– First, the CPU needs to be supplied with the address of the
required memory location where an instruction, or data, is
stored so that it can access it via address bus.
– When this is done,
done the instruction,
instruction or data,
data is read into the
CPU via data bus.
– Since only one memory location can be accessed at any one
time temporary storage has to be used when,
time, when for example,
example
numbers have to be manipulated (added, subtracted etc.).
– So, if 2 numbers are to be added, one number is fetched
f
from it memory location
its l ti and d placed
l d into
i t an accumulator
l t
register while the CPU fetches the other number from
another memory location.
– Once they are added to each other, the result is placed to the
accumulator register for temporary storage.
Flag Register
• The flag register (or, status register, or condition
code register) ‐ contains the result of the latest
process carried out by ALU.
– it contains individual bits, each having special
significance. The bits are called flags.
– The status of the latest operation is indicated by a flag.
– each flag may be set (1) or reset ( 0) depending on the
status.
Program Counter Register
• It keeps track of the CPUs position in the program:
– It contains the address of the memory location of the
next program instruction, hence the alternative name
instruction pointer .
– As each instruction is executed, the program counter
register is updated.
– The
Th program counter t isi incremented
i t d eachh time
ti so that
th t
the CPU executes instructions sequentially, unless some
special
p commands ((e.g.
g JUMP)) are ggiven to changeg it
out of the sequence.
– Not accessible by the programmer.
Some other Registers
• Memory Address Register (MAR) contains the address of
the data (like an 'address book' of all the addressed where
various data are stored).
)
• Instruction Register (IR) stores an instruction. After
fetching an instruction from the memory, the CPU stores it
i the
in th IR.
IR It can then
th beb decoded
d d d and d usedd to
t executet an
operation.
• General Purpose Register ‐ temporary storage for data or
addresses; also for transfers between various other
registers.
• Stack Pointer Register (SP) ‐ holds the address of the top of
the stack in RAM. Stack ‐ special area of RAM where
program counter values can be stored when a subroutine
of a program is being executed.
Mini Projects
Automatic Levelingg Platform
Vending Machine
Automatic Door Control
Feasibility report on Security System for any building
MEMORY mapping
Memory mapping
• The memory map designed to meet requirements
of the application.
• It will be used by a hardware designer to partition
p
the address space so that the address range
g of the
memory devices in the system corresponds to the
address rangeg specified
p byy the memoryy map.
p
• This is achieved my means of a address decoder.
Chip Select signal
• When the correct address appears on the address
bus the output from the decoding circuit changes to
the logic state necessary to activate the device to
supply/receive the data
• The signal is called ‘Chip Select’ signal (CS/); often
set as active low.
l
• A decoder is a combinational logic circuit which will
decode a binary code and activate output signals
according to the states of the lines applied at the
input.
Memory Organisation
• The memory unit stores binary data
• The size of the memory is determined by the number of
wires in the address bus
• For data permanently stored ‐ a read‐only memory (ROM)
device is used
• If the content of ROM can be altered (somehow) it is
referred to as erasable programmable ROM (EPROM)
• Temporary data ‐ I.e. the data currently being operated on ‐
is stored in read/write memory called random random‐access
access
memory (RAM)
• When switched ON,, the p program
g from keyboard
y or other
input device is loaded in RAM
Memory Devices
• Typical EPROM: a series of small electronic circuits ‐
g The p
cells ‐ which can store charge. program
g is stored
by producing a pattern of charged/uncharged cells
• The pattern is erasable using UV light (through a
quartz window on the top of the device)
• EEPROM is electronically erasable,
erasable which is easier ‐
but, the chip itself is more expensive
Memory Devices
• Static RAM (SRAM) The output remains in its state
until a subsequent valid input is issued. The bit cell
of a SRAM is relatively large so it cannot be densely
packed within a given area of silicon, which is a
disadvantage
Memory Devices
• The Dynamic RAM (DRAM) bit cell is a capacitor
capable of storing charge.
charge A single data line is
used both to write data into the bit cell and to
read data from it.
it The charge tends to leak out of
the capacitor causing its voltage to drop, so DRAM
needs to be periodically refreshed.
refreshed This is why it is
called 'dynamic' RAM.
• Refreshing is done by reading data and writing it
back to the same cell.
Memory Devices
• Usually
Usually, circuitry external to the memory chip is
used for refreshing
• Packing density is higher for DRAMs than SRAMs,
SRAMs so
more memory can be implemented in the given
area.
area
• Modern DRAM have their refresh control logic on‐
chip
hi
Memory requirements
• There is a considerable difference in memory requirements
between embedded and computing applications
• In both classes the 'system memory' term is used to refer
to the part which is directly accessible to the
microprocessor as opposed to the storage media such as a
microprocessor,
magnetic disc or tape drive etc.
• In embedded systems,
systems the memory consists of varying
amounts of non‐volatile memory (ROM), the contents of
which will not be lost in the case of p
power loss,, and volatile
memory (RAM) which loses its content if power supply is
removed.
Memory requirements
• Once information (program and constant data) is written
into non
non‐volatile
volatile memory it can be considered permanent
and it is referred to as firmware.
• The programs in embedded systems are typically small.
• For example, a washing machine control program may
require
q onlyy 2k bytes
y of memory. y
• For more demanding applications, such as communication
controllers, several hundreds of kilobytes
y of ROM mayy be
required
Number Representation ‐ a Brief Reminder
• Binary and Hexadecimal number representations are
commonly used in programming
• To convert a binary number into a hexadecimal number
it is handy to group digits in fours, because 24=16 and
each block (of 4) can be represented by a single
hexadecimal character
• For example: a binary number
1011100100011110
grouped in fours gives:
1011 1001 0001 1110
B 9 1 E
Hexadecimal Decimal Binary
0 0 0
1 1 1
2 2 Conversion table 10
3 3 11
4 4 100
5 5 101
6 6 110
7 7 111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111

You might also like