Professional Documents
Culture Documents
8051
Micro controller
Basics
What are Micro controller's ? Why the name Micro controller ?
Basically used for control actions.It is used to control the operation of machine using fixed program that is stored in ROM/EPROM and that does not change over the life time.
What is MCS 51 ?
Y.H.Dandawate
Features of 8051
8 bit ALU. 16 bit PC and DPTR. 8 bit stack pointer and 8 bit PSW. 4K internal ROM 128 bytes of Internal RAM. 32 bits arranged as four,8 bit ports P0-P3. Two 16 bit timer/counters, T0 & T1. Full duplex serial Port.
August 28, 2008 Y.H.Dandawate 4
Features contd
Control Registers TCON,TMOD,SCON,PCON,IP,IE etc (SFRs). Two External and three internal interrupt sources. 0-12 MHz clock. 40 pin DIP package. Works in Power Down and Idle mode. Powerful Instruction set.
August 28, 2008 Y.H.Dandawate 5
Y.H.Dandawate
Y.H.Dandawate
Y.H.Dandawate
10
Y.H.Dandawate
12
Y.H.Dandawate
13
Y.H.Dandawate
14
Tin = N * 12 / Clk.Freq
Y.H.Dandawate
15
6
AC
5
F0
0
P
Y.H.Dandawate
16
Y.H.Dandawate
17
Y.H.Dandawate
18
Y.H.Dandawate
19
Y.H.Dandawate
20
Y.H.Dandawate
21
6
TR1
5
TF0
4
TR0
3
IE 1
2
IT1
1
IE0
0
IT 0
TF1 :Vector location 001B H. TF 0: Vector location 000B H IE 1 : Vector location 0013 H IE 0: Vector location 0003 H
August 28, 2008 Y.H.Dandawate 22
6
C/T
5
M1
4
M0
3
Gate
2
C/T
1
M1
0
M0
Timer 1
Timer 0
Y.H.Dandawate
23
Modes of Timer/Counter
Mode Mode Mode Mode 0 1 2 3 : : : : 5 bit prescaler (13 bit ) 16 bit timer 8 bit Auto reload TL 0 and TH0 are independent but TH0 controlled by TR1 and TF1.
Y.H.Dandawate
24
Serial Input/Output
Registers used are SCON and SBUFF. There are physically two SBUFF registers having same address i.e 99 H. Interrupt is generated whenever data is transmitted and received. Controller goes to execute ISR for serial communication from 0023h.
August 28, 2008 Y.H.Dandawate 25
1
RB8
0
TI RI
SM1 SM2
REN TB8
SMO SM1 0 0 0 1 1
August 28, 2008
1 0 1
Shift register mode baud=1/12 8 bit UART baud=variable 9 bit UART baud= f/32 or f/64 9 bit UART baud = variable
Y.H.Dandawate 26
6
-
5
-
3
GF1
2
GF0
1
PD
0
IDL
IDLE Mode :The internal clock is gated off to the CPU,but not to the timer,serial port and all registers maintain the data. POWER DOWN :On chip oscillator is stopped.But RAM and SFRs are held.
August 28, 2008 Y.H.Dandawate 27
Y.H.Dandawate
28
6
--
5
ET2
4
ES
3
ET1
2
EX1
1
ET0
0
EX0
Y.H.Dandawate
29
6
--
5
PT2
4
PS
3
PT1
2
PX1
1
PT0
0
PX0
Y.H.Dandawate
30
THANK YOU