0% found this document useful (0 votes)
227 views50 pages

2nd CHAPTER Mechatronics

This document provides an overview of microprocessors and the Intel 8085 microprocessor. It discusses: 1) The development of microprocessors as an alternative to hardwired logic circuits that provides more flexibility through software solutions. 2) The basic architecture and components of microprocessors, including registers, arithmetic logic unit (ALU), buses, and memory. It also discusses different types of memory like RAM, ROM, EPROM, and their uses. 3) Specific details of the Intel 8085 8-bit microprocessor introduced in 1977, including its registers, flags, pins, address bus that can access 64KB of memory, and multiplexed address/data bus lines.

Uploaded by

premscrebd
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)
227 views50 pages

2nd CHAPTER Mechatronics

This document provides an overview of microprocessors and the Intel 8085 microprocessor. It discusses: 1) The development of microprocessors as an alternative to hardwired logic circuits that provides more flexibility through software solutions. 2) The basic architecture and components of microprocessors, including registers, arithmetic logic unit (ALU), buses, and memory. It also discusses different types of memory like RAM, ROM, EPROM, and their uses. 3) Specific details of the Intel 8085 8-bit microprocessor introduced in 1977, including its registers, flags, pins, address bus that can access 64KB of memory, and multiplexed address/data bus lines.

Uploaded by

premscrebd
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/ 50

UNIT 2 MICROPROCESSOR IN MECHATRONICS

ME 0304 ELEMENTS OF MECHATRONICS

By

V. THULASIKANTH
Assistant Professor
Mechanical Engineering Department

SRM Nagar, Kattankulathur 603 203


1

Development of microprocessor systems, 8085 Architecture, Pin


diagram, Input and Output peripheral circuits, communications
Input, Output and Memory with timing diagrams, A/D and D/A
convertors. Introduction to design and recent developments in
microprocessors and controllers.

DEVELOPMENT OF MICROPROCESSORS
Earlier we came through 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. This is a satisfactory approach for simple design tasks.

However, in many mechatronic 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.
Software is a procedural program consisting of a set of instructions to execute logic and
arithmetic functions and to access input signals and control output signals.
An advantage of a software solution is that, without making changes in hardware, the
program can be easily modified to alter a mechatronic systems functionality.
3

Intel 8085

WHAT IS MICROPROCESSOR?
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.
In 1971 Intel Corporation introduce 4004, a 4-bit microprocessor and its basic
circuit contains 2300 transistors.
The Intel 8085 ("eighty-eighty-five") is an 8-bit microprocessor introduced by
Intel in 1977.
5" in the model number came from the fact that the 8085 requires only a +5-Volt
(V) power supply.

The Intel 8085 required at least an external ROM and RAM and an 8 bit address
latch (both latches combined in the Intel 8755 2Kx8 EPROM / 2x8 I/O, Intel 8155
256-byte RAM and 22 I/O and 14 bit programmable Timer/Counter)
At a first sight, the microprocessors are specified by: Number of bits it can
handle for data processing and speed of operation.
Higher the bits microprocessor can handle for data processing more faster.
The speed of the operation is estimated from the clock frequency of the
microprocessor.
APPLICATIONS OF MICROPROCESSOR
Actuator control system: Speed, velocity and acceleration control of electric
motor, fluid power actuators.
Control system for home appliances: Microwave oven, washing machine,
refrigerator, heating system, air conditioner, etc
6

Control system for computer peripherals.


Automobile control system: Engine control, locking system, monitoring system, etc
Traffic control systems: Road, air & ocean traffic, navigation, spindle machines, etc.

Machine control systems: Robotics, AGV, CNC, etc


Production lines: Assembly lines, Packaging, etc
New and advanced versions of microprocessors are constantly being developed.
Some of the leading companies are;

Intel
Motorola
Toshiba
Fairchild
7

Phillips
Cyrix
National Semiconductor
Zilog
Texas Instruments

WORKING OF MICROPROCESSOR
The microprocessor, also called the central processing unit (CPU) or
microprocessor unit (MPU), is where the primary computation and system
control operations occur.
It consists of semiconductor memories like EPROM, RAM, input/output device
an interfacing devices.
The arithmetic logic unit (ALU) within the CPU executes mathematical functions
on data structured as binary words.
8

10

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.

Buses: The buses are group of lines that carries data, address or control
signals. With the help of buses, the devices communicate with one another.
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.

Address lines are used to select devices on the bus or specific data locations within
memory.

Control lines transmit read and write signals, the system clock signal, and other
11control signals such as system interrupts, which are described in subsequent
sections.

A key to a CPUs operation is the storage and retrieval of data from a memory
device. Different types of memory include read-only memory (ROM),
randomaccess memory (RAM), and erasable-programmable ROM (EPROM).

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
nonvolatile memory.

RAM can be read from or written to at any time, provided power is


maintained. The data in RAM is considered volatile because it is lost when
power is removed.
There are two main types of RAM: static RAM (SRAM), which retains its data in flip-flops
as long as the memory is powered, and dynamic RAM (DRAM), which consists of
capacitor storage of data that must be refreshed (rewritten) periodically because of
charge leakage.

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
12
stored on the EPROM

. Another type of EPROM is electrically erasable (EEPROM). Data in EEPROM can


be erased electrically and rewritten through its data lines without the need for
ultraviolet light.
Because data in RAM are volatile, ROM, EPROM, EEPROM, and peripheral mass
memory storage devices such as magnetic, optical, and solid-state drives are
sometimes needed to provide permanent data storage.
Communication to and from the microprocessor occurs through I/O devices
connected to the bus.
External computer peripheral I/O devices include keyboards, printers, displays,
and network devices.
For mechatronic applications, analog-todigital (A/D), digital-to-analog (D/A),
and digital I/O (D/D) devices provide interfaces to switches, sensors, and
actuators.
The instructions that can be executed by the CPU are defined by a binary code
called machine code.
13

Microprocessors can be programmed using assembly language.


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.

14

8085 Microprocessor
It is a 8 bit microprocessor.
It has 16-bit address bus and hence can address up to 216 = 65536 bytes (64KB)
memory locations through A0-A15 .

The first 8 lines of address bus and 8 lines of data bus are multiplexed AD0 AD7
Data bus is a group of 8 lines D0 D7 .
It supports external interrupt request.
A 16 bit program counter (PC)
A 16 bit stack pointer (SP)
Six 8-bit general purpose register arranged in pairs: BC, DE, HL.
It requires a signal +5V power supply and operates at 3.2 MHZ single phase

clock.
It is enclosed with 40 pins DIP (Dual in line package).
15

Architecture of Intel 8085

16

Six general-purpose registers B, C, D, E, H, L with capacity to store 8 bit data


are employed.
They are combined as BC, DE, HL to perform 16 bit operations.
In addition to Register array, two 16 bit registers viz. stack register and
program counter are provided.
Program counter is employed to sequence execution of instructions.
This register always points to the memory address from which next byte is to
be fetched.
Stack Pointer points to memory location in R/W memory. It is also called as a
stack'

Accumulator
The accumulator is an 8-bit register (can store 8 bit data) that is a part of
arithmetic/logic unit (ALU). In general after performing logical or arithmetical
operations, result is stored in accumulator. Accumulator is also identified as
17Register A.

Flags
ALU of 8085 have five flip flops whose states (set/reset) are determined by the
result data of various other registers and accumulator. They are called as Zero,
Carry, Sign, Parity and auxiliary carry.

Instruction Register/Decoder
Before execution of instruction, it is sent to Instruction Register. Instruction
register stores current instruction of any program. Decoder takes the instruction
from memory, decodes it and then passes it to next stage.

Memory Address Register


Memory Address Register or generally abbreviated as MAR holds address of
next instruction to be executed.

18

The pins on the chip can be


grouped into 6 groups:

1. Address Bus.
2. Data Bus.
3. Control and Status
Signals.
4. Power supply and
frequency.
5. Externally Initiated
Signals.
6. Serial I/O ports.
19

The Address and Data Bus Systems


The address bus has 8 signal lines A8 A15 which are

unidirectional.
The other 8 address bits are multiplexed (time shared)
with the 8 data bits.
So, the bits AD0 AD7 are bi-directional and serve as
A0 A7 and D0 D7 at the same time.
During the execution of the instruction, these lines
carry the address bits during the early part, then
during the late parts of the execution, they carry the
8 data bits.
In order to separate the address from the data, we can
use a latch to save the value before the function of the
bits changes.

The Control and Status Signals


There are 4 main control and status signals. These are:
ALE: Address Latch Enable. This signal is a pulse that

become 1 when the AD0 AD7 lines have an address


on them. It becomes 0 after that. This signal can be
used to enable a latch to save the address bits from
the AD lines.
RD: Read. Active low.
WR: Write. Active low.
IO/M: This signal specifies whether the operation is a
memory operation (IO/M=0) or an I/O operation
(IO/M=1).
S1 and S0 : Status signals to specify the kind of
operation being performed. Usually not used in small
systems.

Frequency Control Signals


There are 3 important pins in the frequency control

group.
X0 and X1 are the inputs from the crystal or clock
generating circuit.
The frequency is internally divided by 2.
So, to run the microprocessor at 3 MHz, a clock
running at 6 MHz should be connected to the X0
and X1 pins.
CLK (OUT): An output clock pin to drive the clock of the

rest of the system.

Control and Status Signals.

RESET signal
Following are the two kind of RESET signals:
RESET IN: an active low input signal, Program Counter (PC)

will be set to 0 and thus MPU will reset.


RESET OUT: an output reset signal to indicate that the p was
reset (i.e. RESET IN=0). It also used to reset external devices.

Direct Memory Access (DMA)


DMA is an IO technique where external IO device

requests the use of the MPU buses.


Allows external IO devices to gain high speed access to the
memory.
Example of IO devices that use DMA: disk memory system.

HOLD and HLDA are used for DMA.


If HOLD=1, 8085 will place it address, data and control

pins at their high-impedance.


A DMA acknowledgement is signaled by HLDA=1.

25

Interrupt signals
An interrupt is a hardware-initiated subroutine CALL.

When interrupt pin is activated, an ISR will be called, interrupting

the program that is currently executing.

26

Timing diagram of 8085


Timing diagram is the display of initiation of read/write and transfer
of data operations under the control of 3-status signals IO / M , S1,
and S0.

As the heartbeat is required for the survival of the human being, the
CLK is required for the proper operation of different sections of the
microprocessors.
All actions in the microprocessor is controlled by either leading or
trailing edge of the clock.
The execution of instruction always requires read and writes
operations to transfer data to or from the P and memory or I/O
devices.
Each read/ write operation constitutes one machine cycle (MC1)
27

Each machine cycle consists of many clock periods/ cycles, called Tstates.
The heartbeat of the microprocessor is the clock period.
Each and every operation inside the microprocessor is under the
control of the clock cycle.
The clock signal determines the time taken by the microprocessor to
execute any instruction.
The clock cycle shown in Fig. has two edges (leading and trailing or
lagging).
State is defined as the time interval between 2-trailing or leading
edges of the clock.
Machine cycle is the time required to transfer data to or from memory
or I/O devices.
28

29

PROCESSOR CYCLE
The function of the microprocessor is divided into fetch and
execute cycle of any instruction of a program.
In the normal process of operation, the microprocessor fetches
(receives or reads) and executes one instruction at a time in the
sequence until it executes the halt (HLT) instruction.
Thus, an instruction cycle is defined as the time required to fetch
and execute an instruction.
For executing any program, basically 2-steps are followed
sequentially with the help of clocks, (1) Fetch and (2) Execute.
The time taken by the P in performing the fetch and execute
operations are called fetch and execute cycle.

30

Each read or writes operation constitutes a machine cycle.


The instructions of 8085 require 15 machine cycles containing 36
states (clocks).

The 1st machine cycle of any instruction is always an OpCode fetch


cycle in which the processor decides the nature of instruction.
It is of at least 4-states. It may go up to 6-states.

31

The processor during (M1 cycle) puts the program counter


contents on the address bus and reads the opcode of the
instruction through read process.
The T1, T2, and T3 clock cycles are used for the basic memory
read operation and the T4 clock and beyond are used for its
interpretation of the opcode.
Based on these interpretations, the P comes to know the type of
additional information/data needed for the execution of the
instruction and accordingly proceeds further for 1 or 2-machine
cycle of memory read and writes.
The Op. code fetch cycle is of fixed duration (normally 4-states),
whereas the instruction cycle is of variable duration depending on
the length of the instruction.

32

A2D and D2A Converters


Digital signals
Out put from the most sensors tends to be in analog form, if we use microprocessor as a
part of measurement or control system.
Analog output from the sensor has to be converted into digital form before we get it as a
input to microprocessor.
Same way most of the actuators need analog input and so digital input from the
microprocessor should be converted to analog form before sending to actuators.

SENSOR

Analog

ADC Digital

Digital

DAC

Analog

ACTUATOR
33

Analog Signals
Analog signals directly measurable quantities in terms of some other
quantity
Examples:
Thermometer mercury height rises as temperature rises
Car Speedometer Needle moves farther right as you accelerate
Stereo Volume increases as you turn the knob.

Digital Signals
Digital Signals have only two states. For digital computers, we refer to
binary states, 0 and 1. 1 can be on, 0 can be off.
Examples:
Light switch can be either on or off
Door to a room is either open or closed

A digital signal is superior to an analog signal because


it is more robust to noise and can easily be recovered,
corrected and amplified. For this reason, the tendency
today is to change an analog signal to digital data.

35

Examples of A/D Applications


Microphones - take your voice varying pressure waves in
the air and convert them into varying electrical signals

Strain Gages - determines the amount of strain (change in


dimensions) when a stress is applied
Thermocouple temperature measuring device converts
thermal energy to electric energy
Voltmeters
Digital Multimeters

In practice, an ADC is usually in form of an integrated circuit (IC).


ADC0808 and ADC0809 are two typical examples of 8-bit ADC with 8channel multiplexer using successive approximation method for its
conversion.

ADC0809
National Semiconductor

37

Just what does an


A/D converter DO?

Converts analog signals into binary words

4.39

Pulse Code Modulation (PCM)


Delta Modulation (DM)

Analog signal is sampled every TS sec.


Ts is referred to as the sampling interval.

Analog Digital Conversion


2-Step Process:

Quantizing - breaking down analog value is a


set of finite states
Encoding - assigning a digital word or
number to each state and matching it to the
input signal

Step 1: Quantizing
Output
States

Example:
You have 0-10V
0
signals. Separate them 1
into a set of discrete
2
states with 1.25V
increments. (How did 3
we get 1.25V? See
4
next slide)

Discrete Voltage
Ranges (V)
0.00-1.25
1.25-2.50
2.50-3.75

3.75-5.00
5.00-6.25

6.25-7.50

7.50-8.75

8.75-10.0

Quantizing
The number of possible states that the
converter can output is:
N=2n
where n is the number of bits in the AD converter
Example: For a 3 bit A/D converter, N=23=8.
Analog quantization size:
Q=(Vmax-Vmin)/N = (10V 0V)/8 = 1.25V

Encoding

Here we assign the


digital value (binary
number) to each
state for the
computer to read.

Output
States

Output Binary Equivalent

000

001

010

011

100

101

110

111

Accuracy of A/D Conversion


There are two ways to best improve accuracy of
A/D conversion:

increasing the resolution which improves the


accuracy in measuring the amplitude of the
analog signal.

increasing the sampling rate which increases the


maximum frequency that can be measured.

Resolution

Resolution (number of discrete values the converter can


produce) = Analog Quantization size (Q)
(Q) = Vrange / 2^n, where Vrange is the range of analog
voltages which can be represented

limited by signal-to-noise ratio (should be around 6dB)

In our previous example: Q = 1.25V, this is a high


resolution. A lower resolution would be if we used a 2-bit
converter, then the resolution would be 10/2^2 = 2.50V.

A/D Converter Types


Numerous methods are used for converting analog signals to digital
form. Five most commonly used methods are listed below:

47

Staircase ramp
Successive approximation
Dual slope
Voltage to frequency
Parallel (or flash)

D/A Converter
DACs are electronic circuits that convert digital, (usually binary) signals
(for example, 1000100) to analog electrical quantities (usually voltage)
directly related to the digitally encoded input number.

DACs are used in many other applications, such as voice synthesizers,


automatic test system, and process control actuator. In addition, they
allow computers to communicate with the real (analog) world.
Input Binary
Number

Register

Analog Voltage
Output

48

Voltage
Switch

Resistive
Summing
Network

Amplifier

Register: Use to store the digital input (let it remain a


constant value) during the conversion period.
Voltage: Similar to an ON/OFF switch. It is closed when
the input is 1. It is opened when the input is 0.
Resistive Summing Network: Summation of the
voltages according to different weighting.
Amplifier: Amplification of the analog according to a predetermined output voltage range. For example, an
operation amplifier
49

50

You might also like