Sie sind auf Seite 1von 65

MODULE 4

INTRODUCTION TO
MICROCONTROLLERS
Microprocessor
• Microprocessor is a multipurpose programmable logic
device that reads binary instruction from a storage
device memory and accept binary data as input and
processes the instruction for execution.
Intel 1st 4004 Microprocessor
• µp is made up of semiconductor device is
called Integrated Circuit (IC)
• IC is used for manufacturing process of
IC’s microprocessor and other IC’s.

Classification of IC’s

Bipolar IC’s Unipolar IC’


Parts of Microprocessor
Microprocessor is divided into the three parts:-
• Arithmetic Logic Unit (ALU)
• Register
• Control Unit.
What is Bus?
A bus in computer terms, is simply a channel
over which information flows between two or
more devices.
There are three types of bus:-
1. Address bus
2. Data bus
3. Control bus
System Bus

 System bus is a combination of data bus ,


address bus and control bus.
Microcontroller
• It is a Computer on a chip
• It includes Processor, Memory (RAM and ROM),
Timers/Counters, Clock circuits, Serial
communication interface, Interrupt mechanism and
I/O ports
• It is designed to perform specific task
• It is widely used in Digital Cameras, CD and DVD
players, Washing machine etc.
Memory
Memory is one of the most important factor in the
microprocessor.
Used to store the data or information in a binary
format.

Microprocessor memory
Cache Memory: A cache memory used by the central
processing unit of a computer to reduce the average
time to access memory.
The cache is a smaller, faster memory which stores
copies of the data from the most frequently used main
memory locations.
Memory Types
• Memory is a storage part of the microcontroller used
to save the programs and data.
• Memories are classified as:
 RAM
 ROM
 Flash Memory
Random Access Memory (RAM)
• It is a physical hardware used to store data
temporarily
• It is a volatile memory which means that information
stored in RAM is lost when the power is switched off.
• Two types of RAM are
 Static RAM
 Dynamic RAM
Static RAM
• It holds data in static form
• A static memory cell takes a lot more space on a
chip
• It stores a single bit of data using transistor
• It doesn't need to be periodically refreshed
• It is more expensive than Dynamic RAM
• It operates at high speed than Dynamic RAM
• Access time is 10 nano-seconds
• Used in CD’s, printers, Modems, DVD’s and digital
cameras
Dynamic RAM

• Data is stored in cells


• Each cell consists of one capacitor and one
transistor, and can store exactly single bit
• It requires periodic refreshment to maintain the
charge in the capacitors
• It’s structure is simpler than static RAM
• Access time is about 60 nanoseconds
• It is smaller in size and consume less power as
compared to static RAM
Read Only Memory (ROM)
• It is a type of storage medium used to store data
permanently on personal computers
• It is non-volatile which means it retains the content
stored even when the power is turned off.
• ROMs are used extensively
in calculators and peripheral devices such as laser
printers
• The various types of ROM are
 PROM (Programmable ROM)
 EPROM (Erasable Programmable ROM)
 EEPROM (Electrically Erasable Programmable
ROM)
PROM
• It is Programmable Read Only Memory
• It is a user-programmable memory
• A PROM burner is required in order to write data
onto a PROM chip
• It is programmed by blowing the fuses
• The stored data cannot be modified
• It can be executed at a very high speed
• It is also referred to as One Time Programmable
EPROM
• It is Erasable Programmable Read Only Memory
• It can be erased and reprogrammed
• The reprogramming is performed using ultra-violet
light
• It is only reprogrammed by manufacturers
• It is programmed with the use of very high voltages
and exposed to approximately 20 minutes of intense
ultraviolet (UV) light.
EEPROM
• It is Electrically Erasable Programmable Read Only
Memory
• It can be erased and reprogrammed with special
electric pulses
• It is used in many older computer BIOS chips
• It can be reprogrammed using software.
• It does not require physical removal of the memory
chip from its socket.
Flash Memory
• It is a non-volatile and semi-conductor memory
type used for electronic data storage
• Programming is similar to the standard EPROM
• It can be erased electrically and reprogrammed
• It is higher cost per bit than hard drives
• Old data should be erased before writing new data
• It has limited number of write/erase cycles
• Two basic types of flash memory are
 NAND flash memory
 NOR flash memory
Peripheral Devices
• It is an internal or external device which are
connected directly to the computer
• The various peripheral devices are
 Keyboard
 Mouse
 Printer
 Scanner
 I/O ports
 Timers/Counters
 ADC and DAC
IC8051 Microcontroller (8-bit)
• It is developed by Intel in the year 1980
• Widely used in automobiles, energy management,
smart phones and medical devices
• Intel’s original MCS-51 family was developed using
NMOS technology, but later it is modified with
CMOS technology
Features of IC8051
• 8-bit Microcontroller
• 4 KB on-chip program memory (ROM)
• 128 bytes on-chip data memory (RAM)
• 8-bit bi-directional data bus
• 16-bit unidirectional address bus
• 32 general purpose registers each of 8-bit
• Two 16-bit Timers
• Three internal and two external interrupts
• Four 8-bit I/O ports
• 40-pin DIP IC
• 16-bit Program Counter and Data pointer
• 8-bit Stack Pointer
• On-chip Clock Oscillator
• 1 Microsecond instruction cycle with 12 MHz Crystal
• Operating frequency is 24MHz – 33MHz
• Full duplex UART
• It has 21 Special Function Registers (SFRs)
• Bit and Byte addressable
• Four register banks
• Operates on +5V Regulated DC Power Supply
Architecture of IC8051 Microcontroller
• The architecture of IC8051 microcontroller includes
 Processor Core
 Memory (RAM and EEPROM)
 Timer/Counter module
 Digital I/O module
 Analog module
 Interrupt Controller
IC8051 Microcontroller Architecture
Processor Core
• It is the heart of the microcontroller
• It contains
 Arithmetic Logic Unit (ALU)
 Accumulator
 Control unit
 Stack pointer
 Program Counter
 Register file
Memory
• It is used to store the user programs and data during execution
• IC8051 has two types of memories
 Program Memory (ROM)
 Data Memory (RAM)
Timer/Counter Module
• IC8051 has two programmable 16-bit Timers/Counters
• The 8051 has two counters/timers which can be used either as timer to
generate a time delay or as counter to count events happening outside the
microcontroller.
• The 8051 has two timers: timer0 and timer1. They can be used either as
timers or as counters. Since the 8051 has an 8-bit architecture, each 16-bit is
accessed as two separate registers of low byte and high byte.
• Timer0 registers is a 16 bits register and accessed as low byte and high byte.
The low byte is referred as a TL0 and the high byte is referred as TH0. These
registers can be accessed like any other registers.
• Timer1 registers is also a 16 bits register and is split into two bytes, referred
to as TL1 and TH1.
• A timer uses the frequency of the internal clock, and generates delay.
A counter uses an external signal to count pulses. Primarily they are the same
hardware peripheral delivering different functionality depending upon the
configuration
Digital I/O module
• It is used to interface peripherals such as printers,
external memories, LEDs and LCDs to the
microcontroller.
• Digital to Analog Converter (DAC) is required to
convert the output of IC8051 into analog signal in
order to control the process
• The I/O ports are multiplexed with alternate functions
for the peripheral devices on the microcontroller.
Analog module
• It uses Analog to Digital Converter (ADC) to convert
an analog signals from sensors into an equivalent
digital data.
• ADC IC0804 is used which is an 8-bit successive
approximation type
• The features of ADC0804 are
 Differential analogue voltage inputs
 0-5V input voltage range
 No zero adjustment
 Built in clock generator
 Provision for adjusting reference voltage to convert
smaller analogue voltage externally
Interrupts
• These are the events that temporarily suspend the
main program and transfer the control to the interrupt
service routine to execute the task
• After execution, the program control return back to
the main program where the interrupt is called.
• The IC8051 has five interrupt signals which are
 External Interrupt0 (INT0)
 External Interrupt1 (INT1)
 Timer Interrupt0 (TF0)
 Timer Intrerrupt1 (TF1)
 Serial Port Interrupt (TI/RI)
Graphics Processing Unit (GPU)
• It is a computer chip that performs fast mathematical
calculations, primarily for the purpose of rendering
images
• Rendering is a process of converting polygonal
coordinates into bitmaps
• It includes both 2D and 3D calculations
• The primary purpose is to render 3D graphics, which
are comprised of polygons
• The core handles data processing
• GPUs use thousands of cores to process tasks in
parallel.
Interfacing DAC with IC8051
• Digital to Analog Converter (DAC) is used to
interface the 8051 to the external devices in order to
measure and control the physical quantities
• The features of DAC IC0808 are
 8-bit DAC
 Fast settling time: 150 ns
 TTL and CMOS compatible
 Power Supply: 4.5 to 18 V (Positive or Negative)
 Low Power Consumption: 33 mW
 Accuracy: 0.19 (Positive or Negative)
Interfacing DAC IC0808 with IC8051
ADC Interfacing with IC8051
• It is used to interface the external analog signals from sensors
to IC8051
• ADC IC0808/IC0809 is used which is an 8-bit ADC
• The features of ADC IC0808 are
 8-analog channels with multiplexer
 Three address lines
 Three Control signals – SOC (Start of Conversion), EOC (End
of Conversion) and OE (Output Enable)
 The frequency of clock signal determines the conversion speed
 Zero or full scale adjustment is not required
 0 to 5V input voltage range with a single polarity 5V supply
 TTL compatible output
 Low conversion time (100 micro-second)
Interfacing ADC IC0808 with IC8051
Interfacing Seven Segment Display with
IC8051
• It is used to display digits from 0 to 9 and few
characters
• It consists of eight LED’s out of which seven LED’s
are used to indicate the digits and single LED is used
for indicating decimal point.
• Two types of 7 segment displays are
 Common Anode
 Common Cathode
Seven Segment Display
• In common cathode connection, all the cathode
connections of the LED segments are joined together
to logic “0” or ground.
• In common anode connection, all the anode
connections of the LED segments are joined together
to logic “1”.
Interfacing Seven Segment Display
with IC8051
Applications of Seven Segment Display
• Digital watches
• Display speed of automobile in cars,
• Weight Lift
• Washing machines
• Electrical panels
Introduction to PLC
• PLC stands for Programmable Logic Controller.
• It is introduced in the late 1960’s.
• It is a specialized computer used to control the
industrial processes.
• It is developed to replace hard wired logic relays at a
large scale.
• It performs many functions, providing an interface
between analog and digital input and output.
Block Diagram of PLC
PLC Operation
• The functions of a PLC input circuit is to convert the
input signals provided by sensors and switches into
logic signals that can be used by the CPU.
• The program instructions are written onto the
programming device through mnemonics and stored
in the user memory.
• The CPU fetches these instructions from the memory
and executes the input signals by manipulating,
computing, processing them to control the output.
Input Devices of PLC
• Switches and Push buttons
• Sensing devices
• Proximity sensors
• Photoelectric sensors
• Temperature switches
• Level switches
• Pressure switches
• Limit switches
• Condition sensors
• Vacuum switches
Output Devices of PLC
• Valves
• Motors
• Relays
• Alarms
• Pumps
• Fans
• Printers
Applications of PLC
• Chemical industries
• Cement industries
• Food industries
• Paper industries
• Process Valve Control
• Robotic Arm in Car manufacturing
• Air compressors
• Vacuum Pump System
Advantages of PLC
• Very fast
• Easy to change logic i.e. flexibility
• Reliable due to absence of moving parts
• Low power consumption
• Easy maintenance due to modular assembly
• Facilities in fault finding and diagnostic
• Capable of handling of very complicated logic operations
• Good documentation facilities
• Easy to couple with the process computers
• Analog signal handling and close loop control programming
• Counter, timer and comparator can be programmed
PID Controller
• PID stands for Proportional Integral Derivative
Controller.
• PID controller maintains the output such that there is
zero error between process variable and set point by
closed loop operations.
• The tuning of PID controller is based on the error
signal which is the difference between the setpoint
and process variable.
• The output of PID controller is given to the process in
order to maintain the steady state.
• The process output is measured by suitable sensor
which is feedback to the input to generate the error
signal.
Block Diagram of Closed Loop Control
System
• The output of the PID controller output is
given by

where u – Controller output


Kp – Proportional gain
Ki – Integral gain
Kd – Derivative gain
e – Error signal
Proportional Controller
• The output of the proportional controller is the
product of gain and measured error.
• The higher gain value of proportional control causes
repeatedly overshoot the setpoint, leading to
oscillation.
• It provides stable operation but always maintains the
steady state error.
• When the proportional constant increases, the speed
of response is increased.
• It can be used to obtain fast response systems with a
large transmission coefficient.
Advantages of Proportional Controller
 It reduces rise time
 It reduces peak error
Disadvantages of Proportional Controller
 It produces steady state error
 It increases the maximum overshoot of the system
Integral Controller
• It overcomes the drawback of proportional controller.
• It eliminates the steady state error by the process of
integration.
• It integrates the error over a period of time until error
value reaches to zero.
• When the negative error occurs, the output of the
integral control will decrease.
• It limits the speed of response and affects stability of
the system.
• By reducing the integral gain, the speed of the
response can be increased.
Advantages of Integral Controller
It eliminates offset
It reduces integrated error
Disadvantages of Integral Controller
It produces overshoot
It has integral wind-up problem
Derivative Controller
• Integral controller does not have the capability
to predict the future behavior of error.
• Derivative controller overcomes this problem
be anticipating future behavior of the error.
• It provides an output which is proportional to
the rate of change of the error with respect to
time.
• It is used to prevent overshoot and undershoot
of the setpoint and to restore the process value
rapidly to the setpoint.
Advantages of Derivative Controller
It improves the transient response of the
system
It makes the loop more stable
It reduces rise time
It reduces peak error
It is used to make the control action faster
Output is proportional to rate of change of
deviation
Disadvantages of Derivative Controller
It amplifies the noise
Proportional Integral Controller
• It eliminates the offset and produces quick response.
• It is widely used in process industries for controlling
parameters like pressure, level, flow etc.
• The drawback of PI controller is it produces slow
response to disturbance.
• It is required for non-integrating processes, which
means that any process that eventually returns to the
same output given the same set of inputs and
disturbances.
Advantages of PI Controller
• It eliminates the offset (Steady State error)
• It provides simplicity
• It has good transient response
• It stabilizes the controller gain
Disadvantages of PI Controller
• The integral action causes a overshoot of the error
and output before settling to the operating point
• It takes more time to stabilize the controller gain
Proportional Derivative Controller
• It is a combination of proportional and a derivative
controller.
• The output is equals to the summation of proportional
and derivative of the error signal.
• It is effective for systems having large number of
time constants.
• It has the capability to predict future of error, hence
the effect of additional dead time is reduced.
Advantages of PD Controller
• The overall stability of system is improved
• It is capable of handle processes with time lag
• It reduces settling time by improving damping and
reducing overshoot
Disadvantages of PD Controller
• It is not suitable for fast responding systems which
are usually lightly damped or initially unstable.
• It amplifies noise at higher frequencies which result
in improper handling of actuators.
• It does not eliminate steady state error
Proportional Integral Derivative Controller
• PID controller is a combination of proportional,
integral and derivative modes
• It is found in a wide range of applications for
industrial process control.
• It maintains the output such that there is zero error
between process variable and set point by closed loop
operations.
• It removes steady-state error
• It decreases system settling time while maintaining a
reasonable transient response
Advantages of PID Controller
• It has better transient and steady state responses
• It is process independent
• It provides good stability, rapid response and
relatively stable
Disadvantages of PID Controller
• It can be unstable unless tuned properly
• Derivative noise amplification is produced
• It is not dependent on the process

Das könnte Ihnen auch gefallen