Contents
Introduction Parameters
Introduction
Automation
The
control of an industrial process (e.g manufacturing, production etc) by automatic rather that manual means is often called automation can be defined as a technology that uses programmed commands to operate a given process
Automation
Appliances
Sensors/ Transducers
Level
Flow
Pressure Temperature Humidity
Controllable applications
Motors
Solenoid
Display
Input
Controller
Takes
Input Verifies the conditions Controls the equipment & Displays the output
Microcontrollers
The prime use of a microcontroller :
To control the operation of a machine using a fixed program that is stored in ROM and that does not change over the lifetime of the system
Typical Microcontrollers
The
bit. 4-bit are used in high volume very low cost applications 16 & 32 bit are used in high-end applications. Typical clock frequencies are 12 - 24 MHz
speed, the amount of ROM and RAM, the number of I/O ports and timers, size, packaging, power consumption easy to upgrade cost per unit
meeting the computing needs of the task efficiently and cost effectively
Hardware:
Software:
Test case:
8051
RAM ROM
A single chip
Serial Timer COM Port
History of 8051
1981,
Intel MCS-51 The 8051 became popular after Intel allowed other manufacturers to make and market an flavor of the 8051.
different speed, amount of on-chip ROM code-compatible with the original 8051 form a 8051 family
Block Diagram
External interrupts On-chip ROM for program code
Timer/Counter
Interrupt Control
On-chip RAM
Timer 1 Timer 0
Counter Inputs
OSC
Bus Control
4 I/O Ports
P0 P2 P1 P3
TxD RxD
Address/Data
8051 (8031)
Function
RxD TxD INT0 INT1 T0 T1 WR RD
Pin
10 11 12 13 14 15 16 17
A Pin of Port 1
Read latch
TB2
Vcc
Load(L1)
P1.X
Clk Q
P1.X pin M1
P0.x
8051 IC
Read latch
TB2
Vcc
Load(L1) 2. output pin is
Vcc 1 0
M1
P1.X
Clk Q
P1.X pin
output 1
8051 IC
Vcc
Load(L1) 2. output pin is
ground 0 1
M1
P1.X
Clk Q
P1.X pin
output 0
8051 IC
Vcc
Q
P1.X
P1.X pin
Write to latch
Clk
M1
TB1 Read pin 3. Read pin=1 Read latch=0 Write to latch=1 8051 IC
Vcc
Q
P1.X
P1.X pin
Write to latch
Clk
M1
TB1 Read pin 3. Read pin=1 Read latch=0 Write to latch=1 8051 IC
8051 Family
Mask OTP
programmable
User Programmable
Reprogrammable
User Reprogrammable
ROM type 8031 no ROM ; requires external Rom 80xx mask ROM 87xx EPROM 89xx Flash EEPROM 89xx 8951 8952 8953 8955 898252 891051 892051 Example (AT89C51,AT89LV51) AT= ATMEL(Manufacture) C = CMOS technology LV= Low Power(3.0v)
Registers
A
B
R0 R1 R2 R3 R4 R5 R6 R7 Some 8-bitt Registers of the 8051 Some 8051 16-bit Register DPTR DPH DPL
PC
PC
8k
0000H
7FFFH
30H 2FH Bit-Addressable RAM 20H 1FH 18H 17H 10H 0FH 08H 07H 00H Register Bank 2 Register Bank 1 Register Bank 3
Register Bank 0
8051uc
Why Microcontroller
hundreds
Tens
Units
Decoder
Decoder
Decoder
Decoder
Counter
Counter
Counter
Counter
Clk input
C 1
3 3 p F
C 2
3 3 p F
X 1
1 9 C R Y S T A L
U 1
X T A L 1 P 0 . 0 / A D 0 P 0 . 1 / A D 1 P 0 . 2 / A D 2 P 0 . 3 / A D 3 P 0 . 4 / A D 4 P 0 . 5 / A D 5 P 0 . 6 / A D 6 P 0 . 7 / A D 7 P 2 . 0 / A 8 P 2 . 1 / A 9 P 2 . 2 / A 1 0 P 2 . 3 / A 1 1 P 2 . 4 / A 1 2 P 2 . 5 / A 1 3 P 2 . 6 / A 1 4 P 2 . 7 / A 1 5 P 3 . 0 / R X D P 3 . 1 / T X D P 3 . 2 / I N T 0 P 3 . 3 / I N T 1 P 3 . 4 / T 0 P 3 . 5 / T 1 P 3 . 6 / W R P 3 . 7 / R D 3 9 3 8 3 7 3 6 3 5 3 4 3 3 3 2 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7
1 8
R 1 C 3
1 0 u F 1 0 k 9
X T A L 2
R S T
Q 1
2 N 2 9 0 7
2 9 3 0 3 1
P S E N A L E E A
Q 2
2 N 2 9 0 7
1 2 3 4 5 6 7 8
P 1 . 0 P 1 . 1 P 1 . 2 P 1 . 3 P 1 . 4 P 1 . 5 P 1 . 6 P 1 . 7 A T 8 9 C 5 1
Q 3
2 N 2 9 0 7
Q 4
2 N 2 9 0 7
Controller
Fixed Universal controllers
Universal controllers
Input in form 4 ~ 20mA 0 ~20mA
of 0 ~5v
Applications of microcontroller
Personal
information products: Cell phone, pager, watch, pocket recorder, calculator Laptop components: mouse, keyboard, modem, fax card, sound card, battery charger Home appliances: door lock, alarm clock, thermostat, air conditioner, TV remote, VCR, small refrigerator, exercise equipment, washer/dryer, microwave oven Industrial equipment: Temperature/pressure controllers, Counters, timers, RPM Controllers Toys: video games, cars, dolls, etc.
Microcontroller Applications
Sample projects
Car parking gate control
; wait for enter into parking ; if inside goto here subroutine ; wait for leave parking ; if leave parking goto here1 ; start motor1 for open d gate ; start motor1 until it strikes to limit switch ; after defined time stop d motor ; wait for input when the car cross the entering door ; when gate crossed start motor1 in revese direction to close d gate ; start motor1 in reverse direction until it strikes to the other limit ; after closing the door now stop motor1 ; start counter to count number of cars on seven segment display ; display result on port 0 'use decoder' ; return from subroutine ; start motor2 for open d gate ; start motor2 until it strikes to the other limit ; after defined time stop d motor ;wait for input when the car cross the exit door ; when gate crossed start motor2 in revese direction to close d gate ; start motor2 until it strikes to the other limit ; after closing the door now stop motor2 ; count down ; display result on port 0 ; restart