Sei sulla pagina 1di 32

UNIT-4

Digital electronics or digital (electronic) circuits are electronics that handle digital
signals – discrete bands of analog levels – rather than by continuous ranges as used in
analog electronics. All levels within a band of values represent the same information
state.

Digital electronics are those electronics systems that use a digital signal instead of
an analog signal. Digital electronics are the most common representation of Boolean
algebra and are the basis of all digital circuits for computers, mobile phones, and
numerous other consumer products.

A digital system is a system that stores data in a discrete way. The opposite is an
analogue (US- analog) system, which stores the data in a continuous way. Usually, digital
systems store the information in a binary way; that is, every bit of information can not
have a value other than zero (off) or one (on).

Advantages Of Digital Electronics

Digital Electronic circuits are relatively easy to design.

It has higher precision rate in terms of accuracy.

Transmitted signals are not lost over long distance.

Digital Signals can be stored easily.

Digital Electronics is more immune to 'error' and 'noise' than analog. But in case
of high-speed designs, a small noise can induce error in the signal.

The voltage at any point in a Digital Circuit can be either high or low; hence there
is less chance of confusion.

Digital Circuits have the flexibility that can change the functionality of digital
circuits by making changes in software instead of changing actual circuit.

Disadvantages of Digital Electronics

The real world is analog in nature, all quantities such as light, temperature, sound
etc. Digital Systems is required to translate a continuous signal to discrete which leads to
small quantization errors. To reduce quantization errors a large amount of data needs to
be stored in Digital Circuit.

Digital Circuits operate only with digital signals hence, encoders and decoders are
required for the process. This increases the cost of equipment.

Analog signals have a continuous range of values within some specified limits and
can be associated with continuous physical phenomena. On the other hand, digital signals
typically assume only two discrete values (states) and are appropriate for any
phenomena involving counting or integer numbers. While we are mostly dealing with
voltages and currents at specific points in analog circuits, we are interested in the
information flow in digital circuits. The active elements in digital circuits are either BJTs
or FETs (already discussed in Chapter 3). These transistors are designed to operate in
only two states ('on' and 'off), which normally correspond to two output voltages. Hence
the transistors act as switches. The two digital states can be given various names:
ON/OFF, true/false, high/low, or 1/0. The 1 and 0 notation naturally leads to the use of
binary (base 2) numbers. Octal (base 8) and hexadecimal (base 16) numbers are also
often used since they provide a condensed number notation. Decimal (base 10) numbers
are not of much use in digital electronics.

Number systems

We are accustomed to using a decimal system for most of our mathematical


computations. This is a base ten system, in which each digit of a number represents a
power of 10. Consider the decimal number abc. We can write this as

abcio = (a x 102) + (6x 101) + (c x 10°)

For example, the number 789.45 can be expressed as:

(7 x 102) + (8 x 101) + (9 x 10°) + (4 x 10"1) + (5 x 10 ).

This format can be rewritten more generally by assigning the digits 7, 8, 9, 4, and
5 to the expressions D(2), D(l), D(0), D(-l), and D(-2), respectively. The numbers in
parentheses are the same as the exponents of the powers of ten they correspond to. We
can also express the base, in this case, 10, as r. These substitutions give us the following
expression:

[D(2) x r2] + [D(l) x r1] + [D(0) x r°] + [D(-l) x r"1] + [D(-2) x r"2].

We now have a generalization for expressing numbers of any base r in terms of a


power series. Using this generalization, we can convert from any base to decimal (or any
other if you can readily add and take exponents in that base). For example, we can find
the decimal value of 325.023 as follows:

[3 x 32] + [2 x 31] + [5 x 3°] + [0x 3"1] + [2 x 3"2] = (3 x 9) + (2 x 3) + (5 x 1) + (0 x


1/3) + (2x 1/9) = 27 + 6 + 5 + 2/9 = 38.22

Binary numbers

The binary number system is a base 2 number system, using only the digits 0 and
1. It is commonly used when dealing with computers because it is well suited to
representing logical expressions, which have only 2 values: TRUE (1) and FALSE (0).
Single binary digits are often referred to as bits. In the binary system a number abc can
be written as

abc2 = (a x 22) + (b x 21) + (c x 2°)

The left most bit is the highest-order bit and represents the most significant bit
(MSB), while right most bit, which is the lowest-order bit is the least significant bit (LSB).

Octal numbers

Octal numbers are base 8 numbers, using only the digits 0 through 7. The eight
octal numbers are represented with the symbols 0,..., 7. In the octal system a number abc
can be written as

Abc8 = (a x 82) + (b x 81) + (cx 8°)

Since 8 is power of 2, each of its digits can be represented as a group of bits. The
number of bits is the same as the power of 2 that the base is. In other words, since 8 = 23,
a base 8 digit can be represented as three bits, as in the following examples:

237.448= 010|011|111|. 1100| 1002 7372.018 = 111 |011|1111010|. |000|0012


Hexadecimal numbers

Hexadecimal numbers (often referred to as hex) are base 16 numbers, using the
digits 0 through 9, and the letters A through F (A representing 10i0, B representing 11 io,
and so on). Since 16 is power of 2, each of its digits can be represented as a group of bits,
the number of bits being the same as the power of 2 that the base is. In other words, since
16 = 24, a base 16 digit can be represented as four bits as in the following examples:

A443.4CB16 = 1010|0100|0100|0011|. |0100|1100|10112 lAA.03i6 =


0001|1010|1010|. |0000|00112

Our number example abc can be written as

abci6 = (ax 162) 4- (b x 161) + (c x 16°)

Base conversion

Conversion from binary, octal, or hex to decimal

Notice that in our examples, each group of bits on the right corresponds to a digit
in the higher based number on the left. It is also easy to convert the other way, from
binary to hex or octal. One simply starts at the decimal point and counts out groups of
threes or fours, depending on the base to which one is converting, and add leading and
following zeros to fill the outer groups. Octal to hexadecimal conversion, or vice versa, is
most easily performed by first converting to binary first. This ease of conversion makes
octal and hex a good shorthand for binary numbers. Conversion from binary, octal, or hex
to decimal can be done using a set of rules, but it is much easier to use a calculator or
tables (see Table 4.1).

Conversion from decimal to other bases

We have seen how to convert to decimal from other bases using a power series.
One can use the same principle to convert from decimal to other bases. In this case, one
can make a power series in the base one wants to change to, with coefficients of 1. We
find the first number larger than the decimal number. The next step is to divide the
decimal number by the next smallest number in the power series, and take an
Table Decimal, binary, octal, and hexadecimal equivalents

Decimal

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16

Binary

00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010
01011 01100 01101 01111 10000

Octal

00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17 20

Hex

00 01 02 03 04 05 06 07 08 09 0A 0B OC 0D 0E OF

10 integer result.

Then the process is repeated with the remainder. The number in the new base is
the result of the divides, lined up in order of exponent from left to right, while we make
sure to remember to put zeros in places where the divide result was zero. For example,
let us find the value of 175i0 in base 3. First we take a power series of 3:

3° = 1 3!=3 32 = 9 33=27 34 = 81 35 = 243


Since 81 is the next smallest number, we start by dividing 175 by 81, and continue
through the power series as follows:

175/81 = 2 Remainder 13

13/27 = 0 Remainder 13

13/9 = 1 Remainder 4 (4.4A)

4/3 = 1 Remainder 1

1/1=1 Remainder 0

MODing the decimal number can simplify this method by the new base, and
repeating the process with the integer result of dividing the decimal number by the new
base until the division result is 0. The result is then the results of the MODs taken from
bottom to top. For example, let us repeat the example from above:

175 MOD 3 = 1 175/3 = 58

58 MOD 3 = 1 58/3 = 19

19 MOD 3 = 1 19/3 = 6 (4.4B)

6 MOD 3 = 0 6/3 = 2

2 MOD 3 = 2 2/3 = 0

Thus, the result again is 201113.

LOGIC CONTROL

Control logic is a key part of a software program that controls the operations of
the program. The control logic responds to commands from the user, and it also acts on
its own to perform automated tasks that have been structured into the program.

Control logic can be modelled using a state diagram, which is a form of


hierarchical state machine. These state diagrams can also be combined with flow charts
to provide a set of computational semantics for describing complex control logic. This mix
of state diagrams and flow charts is illustrated in the figure on the right, which shows the
control logic for a simple stopwatch. The control logic takes in commands from the user,
as represented by the event named “START”, but also has automatic recurring sample
time events, as represented by the event named “TIC”.

Logic gates

Electronic circuits which combine digital signals according to the Boolean algebra
are referred to as logic gates because they control the flow of information. Positive logic
is an electronic representation in which the true state is at a higher voltage, while
negative logic has the true state at a lower voltage. We will use the positive logic type in
this chapter. In digital circuits no inputs must be left unconnected. Logic circuits are
grouped into families, each with their own set of detailed operating rules. Some common
logic families are:

• RTL: resistor-transistor logic;

• DTL: diode-transistor logic;

• TTL: transistor-transistor logic;

• NMOS: n-channel metal-oxide silicon;

• CMOS: complementary metal-oxide silicon;

• ECL: emitter-coupled logic.

ECL is very fast. MOS has very low power consumption and hence is often used in
large scale integration (LSI) technology. TTL is normally used for smallscale integrated
circuit units. Any logic operation can be formed from NAND or NOR gates or a
combination of both. Gates also often have more than two inputs. Inverter gates can be
formed by applying the same signal to both inputs of a NOR or NAND gate.

The AND gate

AND gates are used to determine when both inputs are true. The schematic symbol
is shown in Figure , and the truth table is shown in Table.

The NAND gate

NAND gates are negated AND gates. They are true when at least one input is not
true. As a side note, it is often easier (and cheaper) to buy NAND gates instead of AND
gates. This is due to the fact that on the transistor level, the number of transistors
required to construct a NAND gate is less than the number needed for an AND gate. The
schematic symbol is shown in Figure 4.2, and the truth table is shown in Table.

The OR gate

OR gates are used to determine when at least one input is true. The schematic
symbol is shown in Figure 4.3, and the truth table is shown in Table

The NOR gate

NOR gates are negated OR gates. They are true when all inputs are not true. The
schematic symbol is shown in Figure 4.4, and the truth table is shown in Table
The NOT gate

NOT gates return the opposite of the input. The schematic symbol is shown in
Figure 4.5, and the truth table is shown in Table 4.7. The open circle is used to indicate
the NOT or negation function and can be replaced by an inverter in any circuit. A signal is
negated if it passes through the circle.

The exclusive-OR gate

The exclusive-OR gate (EOR or XOR) is a very useful two-input gate. XOR gates are
true when an odd number of inputs are true. (Note that an XNOR gate is true only when
an even number of inputs are true.) The schematic symbol is shown in Figure 4.9, and the
truth table is shown in Table 4.10.

Q = AB + AB

We can draw the implementation directly from the truth table (Figure 4.10).

MICRO PROCESSORS AND MICRO CONTROLLERS

The digital circuits presented in Chapter 4 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. 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
the mechatronics system's functionality.

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. Figure 6.1 illustrates the overall architecture
of a typical microcomputer system using a microprocessor. The microprocessor, also
called the central processing unit (CPU) or microprocessor unit (MPU), is where the
primary computation and system control

Microcontrollers

Recently, there have been two directions in the ongoing advances of


microprocessor technology. One direction supports CPUs for the personal computer and
workstation industry, where the main constraints are high speed and large word size (32
and 64 bits). The other direction includes development of the microcontroller, which is a
single IC containing specialized circuits and functions that are applicable to mechatronics
system design. 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.

Microcontrollers are used in a wide variety of applications including home


appliances, entertainment equipment, telecommunication equipment, automobiles,
trucks, airplanes, toys, and office equipment. All these products involve devices that
require some sort of intelligent control based on various inputs. For example, the
microcontroller in a microwave oven monitors the control panel for user input, updates
the graphical displays when necessary, and controls the timing and cooking functions. In
an automobile, there are many microcontrollers to control various subsystems, including
cruise control, antilock braking, ignition control, keyless entry, and environmental
control, and air and fuel flow.

An office fax machine controls actuators to feed paper, uses photo sensors to scan
a page, sends or receives data on a phone line, and provides a user interface complete
with menu driven controls. A toy robot dog has various sensors to detect inputs from its
environment (e.g. bumping into obstacles, being patted on the head, light and dark, voice
commands), and an on board microcontroller actuates motors to mimic actual dog
behavior (e.g. bark, sit, and walk) based on this input. Microcontrollers and the software
running on them control all of these powerful and interesting devices. Figure 6.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

The CPU executes the software stored in ROM and controls all the microcontroller
components. The RAM is used to store settings and values used by an executing program.
The ROM is used to store the program and any permanent data. A designer can have a
program and data permanently stored in ROM by the chip manufacturer, or the ROM can
be in the form of EPROM or EEPROM, which can be reprogrammed by the user. Software
permanently stored in ROM is referred to as firmware.

Microcontroller manufacturers offer programming devices that can download a


compiled machine code file from a PC directly to the EEPROM of the microcontroller,
usually via the PC serial port and special purpose pins on the microcontroller. These pins
can usually be used for other purposes once the device is programmed. Additional
EEPROM may also be available and used by the program to store settings and parameters
generated or modified during execution. The data in EEPROM is non-volatile, which
means the program can access the data when the microcontroller power is turned off and
back on again. The digital I/O ports allow binary data to be transferred to and from the
microcontroller using external pins on the IC. These pins can be used to read the state of
switches and on-off sensors, to interface to external analog-to-digital (ADC) and digital-
to-analog (DAC) converters, to control digital displays, and to control on-off actuators.
The I/O ports can also be used to transmit signals to and from other microcontrollers to
coordinate various functions. The microcontroller can also use a serial port to transmit
data to and from external devices, provided these devices support the same serial
communication protocol.

Examples of such devices include external EEPROM memory ICs that might store
a large block of data for the microcontroller, other microcontrollers that need to share
data, and a host computer that might download a program into the microcontroller's on
board EEPROM. There are various standards or protocols for serial communication
including SPI (serial peripheral interface), I2C (inter-integrated circuit), UART (universal
asynchronous receiver-transmitter), and US ART (universal synchronous asynchronous
receiver-transmitter). The ADC allows the microcontroller to convert an external analog
voltage (e.g. from a sensor) to a digital value that can be processed or stored by the CPU.
The DAC allows the microcontroller to output an analog voltage to a non-digital device
(e.g. a motor amplifier). ADCs and DACs and their applications.

On board timers are usually provided to help create delays or ensure events occur
at precise time intervals (e.g. reading the value of a sensor). Microcontrollers typically
have less than 1 kB to several tens of kilobytes of program memory, compared with
microcomputers where RAM memory is measured in megabytes or gigabytes. Also,
microcontroller clock speeds are slower than those used for microcomputers. For some
applications, a selected microcontroller may not have enough speed or memory to satisfy
the needs of the application. Fortunately, microcontroller manufacturers usually provide
a wide range of products to accommodate different applications. Also, when more
memory, or I/O capability, is required, the functionality of the microcontroller can be
expanded with additional external components (e.g. RAM or EEPROM chips, external
ADCs and DACs, and other microcontrollers).

PIC is a large and diverse family of low-cost microcontrollers manufactured by


Microchip Technology. They vary in physical size, the number of I/O pins available, the
size of the EEPROM and RAM space for storing programs and data, and the availability of
ADCs and DACs. Obviously, the more features and capacity a microcontroller has, the
higher the cost. We first focus specifically on the PIC16F84 device, which is a low-cost 8-
bit microcontroller with EEPROM flash memory for program and data storage. It does not
have a built-in ADC, DAC or serial communication capability, but it supports 13 digital I/O
lines and serves as a good learning platform because of its low cost and ease of
programming. The PIC16F877, which has more enhanced capabilities and was used for
most of the applications presented in the chapter for the case studies of Chapter 20 is
discussed later in this chapter. Once a user knows how to interface and program one
microcontroller, it is easy to extend that knowledge to other microcontrollers with
different features and programming options.

MICROPROCESSOR

Microprocessor is a controlling unit of a micro-computer, fabricated on a small


chip capable of performing ALU (Arithmetic Logical Unit) operations and communicating
with the other devices connected to it.

Microprocessor consists of an ALU, register array, and a control unit. ALU


performs arithmetical and logical operations on the data received from the memory or
an input device. Register array consists of registers identified by letters like B, C, D, E, H,
L and accumulator. The control unit controls the flow of data and instructions within the
computer.
A Microprocessor is an important part of a computer architecture without which
you be able to perform any thing on your computer system. It is a programmable device
that takes in input perform some arithmetic and logical operations over it and produce
desired output. In simple words, a Microprocessor is a digital device on a chip which can
fetch instruction from memory, decode and execute them and give results.

A microprocessor controls all functions of the CPU, or central processing unit, of a


computer or other digital device. The microprocessor functions as an artificial brain. The
entire function of the CPU is controlled by a single integrated circuit. The microprocessor
is programmed to give and receive instructions from other components of the device. The
system can control everything from small devices such as calculators and mobile phones,
to large automobiles.

Basics of Microprocessor –

A Microprocessor takes a bunch of instructions in machine language and executes


them, telling the processor what it has to do. Microprocessor performs three basic things
while executing the instruction:

It performs some basic operations like addition, subtraction, multiplication,


division and some logical operations using its Arithmetic and Logical Unit (ALU). New
Microprocessors also perform operations on floating point numbers also.

Data in Microprocessor can move from one location to another.

It has a Program Counter (PC) register that stores the address of next instruction
based on the value of PC, Microprocessor jumps from one location to another and takes
decision.

Advantages of a Microprocessor

1. Low Cost

Microprocessors are available at low cost due to integrated circuit technology.


Which will reduce the cost of a computer system.

2. High Speed

Microprocessor chips can work at very high speed due to the technology involved
in it. It is capable of executing millions of instructions per second.
3. Small Size

Due to very large scale and ultra large scale integration technology, a
microprocessor is fabricated in a very less footprint. This will reduce the size of the entire
computer system.

4. Versatile
Microprocessors are very versatile, the same chip can be used for a number of
applications by simply changing the program (instructions stored in the memory).

5. Low Power Consumption

Microprocessors are usually manufactured using metal oxide semiconductor


technology, in which MOSFETs (Metal Oxide Semiconductor Field Effect Transistors) are
working in saturation and cut off modes. So the power consumption is very low compared
to others.

6. Less Heat Generation

Compared to vacuum tube devices, semiconductor devices won’t emit that much
heat.

7. Reliable

Microprocessors are very reliable, failure rate is very less as semiconductor


technology is used.

8. Portable

Devices or computer system made with microprocessors can be made portable


due to the small size and low power consumption.

Features

Microprocessors work based on digital logic. The three components that form the
main features of the microprocessor are a set of digital instructions, a certain bandwidth
and clock speed that measures the number of instructions that a microprocessor can
execute. A series of digital machine instructions are received by the microprocessor. The
ALU, or arithmetic logic unit, of the processor does a series of calculations based on the
instructions received. Additionally, the unit moves data from one memory to another and
has the capacity to jump from one set of instructions to another.

Function of Micro processor

The microprocessor functions through two memories. The read only memory, or
ROM, is a program with a fixed set of instructions and is programmed with a fixed set of
bytes. The other memory is the RAM, or random access, memory. The number of bytes in
this memory is variable and lasts for a short term. If power is switched off the RAM is
wiped out. The ROM has a small program within it called the BIOS, or the basic input
output system. The BIOS tests the hardware on the machine when it starts up. It then
fetches another program in the ROM called the boot sector. This boot sector program
executes a series of instructions that helps to utilize the computer effectively.

Considerations

Computers are not merely data processors. Microprocessors should be able to


execute instructions in data, audio and video formats. They should support a range of
multimedia effects. A 32-bit microprocessor is essential to support multimedia software.
With the advent of the internet, microprocessors should have the capacity to support
virtual memory and physical memory. They should be able to work with DSP or digital
signal processors to handle audio video and playback formats. Fast microprocessors do
not require a DSP.

Common Terms used in a Microprocessor

Bus

A bus is a set of conductors intended to transmit data, address or control


information to different elements in a microprocessor. Usually a microprocessor will
have 3 types of buses : Data Bus, Control Bus and Address Bus. An 8-bit processor will be
using 8-bit wide bus.

Instruction Set

Instruction set is the group of commands that a microprocessor can understand.


So instruction set is an interface between hardware and software (program). An
instruction commands the processor to switch relevant transistors for doing some
processing in data. For eg. ADD A, B; is used to add two numbers stored in the register A
and B.

Word Length

Word Length is the number of bits in the internal data bus of a processor or it is
the number of bits a processor can process at a time. For eg. An 8-bit processor will have
an 8-bit data bus, 8-bit registers and will do 8-bit processing at a time. For doing higher
bits (32-bit, 16-bit) operations, it will split that into a series of 8-bit operations.

Cache Memory

Cache memory is a random access memory that is integrated into the processor.
So the processor can access data in the cache memory more quickly than from a regular
RAM. It is also known as CPU Memory. Cache memory is used to store data or instructions
that are frequently referenced by the software or program during the operation. So it will
increase the overall speed of the operation.

Clock Speed

Microprocessors uses a clock signal to control the rate at which instructions are
executed, synchronize other internal components and to control the data transfer
between them. So clock speed refers to the speed at which a microprocessor executes
instructions. It is usually measured in Hertz and are expressed in megahertz (MHz),
gigahertz (GHz) etc.

Classification of Microprocessors

Based on Word Length

Based on the word length of a processor we can have 8-bit, 16-bit, 32-bit and 64-
bit processors.

RISC – Reduced Instruction Set Computer

RISC is a type of microprocessor architecture which uses small, general purpose


and highly optimized instruction set rather than more specialized set of instructions
found in others. RISC offers high performance over its opposing architecture CISC (see
below). In a processor, execution of each instruction require a special circuit to load and
process the data. So by reducing instructions, the processor will be using simple circuits
and faster in operation.

Simple instruction set

Larger program

Consists of large number of registers

Simple processor circuitry (small number of transistors)

More RAM usage

Fixed length instructions

Simple addressing modes

Usually fixed number of clock cycles for executing one instruction

CISC – Complex Instruction Set Computer

CISC is the opposing microprocessor architecture for RISC. It is made to reduce the
number of instructions per program, ignoring the number of cycles per instruction. So
complex instructions are directly made into hardware making the processor complex and
slower in operation.

This architecture is actually designed to reduce the cost of memory by reducing


the program length.

Complex instruction set, Smaller program, Less number of registers, Complex


processor circuitry (more number of transistors), Little RAM usage, Variable length
instructions, Variety of addressing modes, Variable number of clock cycles for each
instructions

Special Purpose Processors

There are some processors which are designed to handle some specific functions.

DSP – Digital Signal Processors

Coprocessors – processors used along with a main processor (8087 math-


coprocessor used with 8086)
Input/Output processors

Transputer – Transistor Computer : Microprocessor with its own local memory

Examples

Intel 4004 – The First Microprocessor, Intel 8085, Intel 8086, Intel Pentium 4, Intel
Core i7, AMD Athlon

Differences between microprocessor and micro controller


PROCESS

Process as used in the terms process control and process industry, refers to the
methods of changing or refining raw materials to create end products. The raw materials,
which either pass through or remain in a liquid, gaseous, or slurry (a mix of solids and
liquids) state during the process, are transferred, measured, mixed, heated or cooled,
filtered, stored, or handled in some other way to produce the end product.

Process control refers to the methods used to maintain the output of process
variables– such as temperature, pressure, flow, or level– within a desired range. Precise
control of these variables is critical in industrial settings as it improves the quality of
products while enabling automation, allowing smaller staffs to monitor and control
complex processes from a central location.

Process control is part of a closed loop system in which a process variable is


measured, compared to a setpoint, and action is taken to correct any deviation from the
setpoint. Closed loop control is feedback-dependent; receiving feedback from sensors
monitoring the process variable and providing feedback to the final control element that
corrects any deviation from the setpoint. By carefully monitoring and correcting process
variables, controllers greatly assist in reducing variability, increasing efficiency, and
ensuring safety. Any equipment that requires constant monitoring of a process variable
can benefit from a process controller.

Process controllers are arranged into control systems (also known as control
loops) that consist of the controller, any associated sensors, a power supply, the final
control element, as well as any necessary load handling devices. Controllers seek to
maintain the measured process variable at a pre-set point.

Sensors provide the input signal to the controller. That signal is based upon a
measurable physical property like temperature, pressure, pH, flow, level, etc. There are a
staggering array of sensors, transmitters, and transducers compatible with process
controllers. Nearly the only limitation is the type of signal a controller is capable of
reading. More sophisticated controllers accept voltage, current, contacts, frequency,
thermocouple/RTD, and other signal types.
The final control element refers to the device that acts upon orders from the
controller. It can be a heater that is activated when the sensor finds a temperature lower
than the set point or a valve that opens when the pressure sensor measures a pressure
higher than the set point.

Process controllers, many (though not all) sensors, and final control elements
require power to operate. A power supply is an integral element to control loops

Control loops regularly feature additional instruments. Transmitters or signal


conditioners are often used to isolate, filter, amplify, or convert a sensor input signal
when conditions dictate it. Control loops also frequently include data acquisition devices
for archiving information related to the process.

A programmable logic controller (PLC) is an industrial solid-state computer that


monitors inputs and outputs, and makes logic-based decisions for automated processes
or machines. A PLC is an industrial-grade digital computer designed to perform control
functions—especially for industrial applications.

The majority of PLCs today are modular, allowing the user to add an assortment
of functionality including discrete control, analog control, PID control, position control,
motor control, serial communication, and high-speed networking. Compared to older
technologies, the PLC is easier to troubleshoot, more reliable, more cost-effective, and far
more versatile.

PLCs were introduced in the late 1960s by inventor Richard Morley to provide the
same functions as relay logic systems. Relay systems at the time tended to fail and create
delays. Technicians then had to troubleshoot an entire wall of relays to fix the problem.

PLCs are robust and can survive harsh conditions including severe heat, cold, dust,
and extreme moisture. Their programming language is easily understood, so they can be
programmed without much difficulty. PLCs are modular so they can be plugged into
various setups. Relays switching under load can cause undesired arcing between
contacts. Arcing generates high temperatures that weld contacts shut and cause
degradation of the contacts in the relays, resulting in device failure. Replacing relays with
PLCs helps prevent overheating of contacts.
PLCs do have disadvantages. They do not perform well when handling complex data.
When dealing with data that requires C++ or Visual Basic, computers are the controllers
of choice. PLCs also cannot display data well, so external monitors are often required.

PLC Hardware Components

A central processing unit (CPU) serves as the brain of the PLC. It is a -16 or -32 bit
microprocessor consisting of a memory chip and integrated circuits for control logic,
monitoring, and communicating. The CPU directs the PLC to execute control instructions,
communicate with other devices, carry out logic and arithmetic operations, and perform
internal diagnostics. The CPU runs memory routines, constantly checking the PLC (PLC
controller is redundant) to avoid programming errors and ensure the memory is
undamaged.

PLCs work with inputs, outputs, a power supply, and external programming devices.

Memory provides permanent storage to the operating system for data used by the CPU.
The system’s read-only memory (ROM) stores data permanently for the operating system
random access memory (RAM) stores status information for input and output devices,
along with values for timers, counters, and internal devices. PLCs require a programming
device, either a computer or console, to upload data onto the CPU.

3. A CPU operating cycle includes the following steps:


a) start scan;
b) internal checks;
c) scan inputs;
d) execute program logic; and
e) update outputs. The program repeats with the updated outputs.

PLCs read signals from different sensors and input devices. These input devices
can be keyboards, switches, or sensors. Inputs can be either in digital or analog form.
Robots and visual systems are intelligent devices that can send signals to PLC input
modules. Output devices such as motors and solenoid valves complete the automated
system.
4. The top image depicts common inputs in a PLC, including push buttons and switches.
Output connections are shown in the bottom image and include signal out (SOL), pilot
light (PL), and motor ignition (MI).
Sinking and sourcing are two important terms when discussing input and output
connections of PLCs. Sinking is the common ground line (-) and sourcing is the common
VCC line (+). VCC stands for the positive supply voltage connection point. Sinking and
sourcing inputs only conduct electricity in one direction. Each input has its own return
line, and several inputs connect to one return line instead of several separate return lines.
These common lines are labeled “COMM.” Sensor outputs mark the size of the signal
given.

Direct current (dc) input modules connect to sourcing or sinking transistor type devices.
Alternating current (ac) input modules are less common than dc inputs because most
sensors have transistor outputs, so if the system uses a sensor input, it will most likely be
dc; ac inputs take longer for PLCs to see compared to dc inputs. A typical ac input is a
mechanical switch used for slow mechanical drives.

Relays are one of the most common output connections. A relay can switch ac or dc
modules because they are non-polarized. A relay is slow, switching and settling at speeds
of 5 to 50 milliseconds (ms), but can switch a large current. For example, a relay can be
used for a low-voltage battery to switch a 230 volt AC main circuit. Transistor connections
are faster than a relay and have a long lifespan. Transistors switch a small current, but
only work with dc. An example of a high-power transistor has a current of 15 amps with
a max voltage of 60V. Triac output (triode for alternating current) connections only
control ac loads. Like a transistor, a triac is faster and handles large ac loads. A triac
output, for example, can handle voltages of 500 to 800 with a current of 12 amps.

PLC Programming Language

Five programming languages are used in PLCs. They are defined by the international
standard IEC 61131. Ladder logic is one of the most commonly used PLC languages. In it,
symbols represent opening and closing relays, counters, timers, shift registers, and
mathematical operations. The symbols are arranged into the desired program routine.
Rules in ladder logic are termed “rungs.” Each rung has a single output, but a single input
can be found in more than one rung.
5. Ladder logic can be scanned by PLCs either in horizontal formats shown here (left to
right starting in the upper left hand corner and progressing to the next line) or in vertical
formats (column by column starting in the upper left hand corner). | | are switches while
( ) is the action command.
Another programming language is function block diagram (FBD). It describes
functions between input and output variables. The function, represented by blocks,
connects input and output variables. FBD is useful in depicting algorithms and logic from
interconnected controls systems.
Structured Text (ST) is a high-level language that uses sentence commands. In ST,
programmers can use “if/then/else,” “SQRT,” or “repeat/until” statements to create
programs.
Instruction list (IL) is a low-level language with functions and variables defined by
a simple list. Program control is done by jump instructions and sub-routines with
optional parameters
Sequential Function Chart (SFC) language is a method of programming complex
control systems. It uses basic building blocks that run their own sub-routines. Program
files are written in other programming languages. SFC divides large and complicated
programming tasks into smaller and more manageable tasks.
6. Function Block Diagrams use elementary blocks to represent functions and receive
inputs from lines entering from the left. Lines exiting to the right represent output results.

PLC Communications

RS-232 is the most common method PLCs use to communicate with external devices. It is
a serial communication standard that uses binary code to transmit data in American
Standard Code of Information Interchange (ASCII) format. ASCII translates letters and
numbers into binary code that computers can read. ASCII is a 7-bit code (a bit being “1”
or “0”) that, when translated, results in 128 characters. PLC serial ports transmit and
receive data as voltages. PLCs can be either data terminal equipment (DTE) or data
communications equipment (DCE). A DTE, for example, can be a computer, while a
modem is a DCE. Typically, PLCs are DTEs and external devices are DCEs. When the PLC
and the external device connected to it are the same equipment (i.e., DTE/DTE or
DCE/DCE), they cannot communicate with each other and a null-modem connection must
be used.

In serial communications, data gets transmitted one bit at time. Data is separated into its
constituent bits for transmission and reassembled when received by an external device.
A “start bit” is the initial signal sent and precedes any other communication bits. It is
considered the “space” or negative voltage. The “stop bit,” the last code sent, is considered
a “Mark” or a positive voltage.

Eight bits make a byte and PLCs are byte-oriented. ASCII is a seven-bit code, so the eighth
(or “parity byte”) checks to see if data has been corrupted. Common forms of parity
include even (1), or odd (0). The total number of 1s in the byte adds up to an even or odd
number. The sending equipment determines if the communication is even or odd and
receiving equipment compares the result of the parity to the eighth bit to ensure they
match. If a device transmits 1001101 and computes it to be an odd value, it will add a 1
to the eighth bit and send 10011011. The receiver decides the bit is odd and verifies an
odd total of 1 characters.

Baud rate is the number of bits per second transmitted from DTE to DCE. An RS232
transmission would appear as baud rate, data bits, and parity-stop bits. For example, the
string 9600-8-1-1 translates to a 9600 baud rate, 8 data bits, a 1 for parity, and a 1 stop
bit to end the transmission.

Software handshaking ensures devices are ready to send and receive data. The receiver
sends the XOFF character when it wants the transmitter to pause sending data. It sends
the XON character when it is ready to receive data again. XOFF is sometimes referred to
as the hold-off character and XON as the release character.

A delimiter is added to the end of messages to tell receivers to process the data just
received. The most common delimiter is the “carriage return” (CR). The PLC or external
device receives the delimiter and takes data from its buffer. The buffer temporarily stores
data before it is processed. The line feed (LF) is sometimes sent with the CR character. If
viewed on a computer, the page moves down a line to start a new line of communication.

PLC Selection Criteria

There are several requirements to keep in mind when choosing PLCs. Is the proposed
system new or an existing one? Either way, ensure the controller works with mating
hardware.
Environmental conditions will affect PLC performance. Typical controllers operate in
temperatures from 0 to 55°C (32°-130°F). The number of discrete devices (On/Off logic
devices) and analog devices determines the number of I/O connections the PLC will need.
If the discrete devices are ac or dc, determine if the PLC can support the required signal.

Determining CPU requirements is important for calculating the amount of RAM needed
for data manipulation and storage. Counters and timers use RAM to store set points,
current values, and other internal flags. If data must be stored over a long period of time,
CPU memory must be sized appropriately.

Program memory or ROM stores program instructions. Analog devices usually require 25
words of memory per device. Examples of analog devices are voltage, current, and
temperature meters or sensors. Simple and sequential applications typically require five
words of memory per I/O device. Complex applications are not as predictable and need
more program memory space.

Serial and Ethernet connection-based I/O hardware are typical choices for remote
connections. Remote devices are needed when the PLC is located separately. Serial
connections have a max distance of 50 feet while Ethernet connections can go to a max of
328 feet. These remote devices are referred to as distributed I/O. Finally, be sure the PLC
understands program instructions. Some PLCs come with proportional integral
derivative functions that eliminate the need for technicians to write specific code for
closed-loop process control.

PLC:

 Operates in industrial enviroment


 PLC is programmed in relay ladder logic
 Has no keyboard, CD drive, monitor, or disk drive
 Has communication ports and terminals for input and output devices

PC:
 Capable of executing several programs simultaneously, in any order.
 Some manufacturer have software and interface card available so that a PC can
do the work of a PLC.
 Speedy information processing
 Easy customization
 Straightforward data exchange with other systems

Potrebbero piacerti anche