Beruflich Dokumente
Kultur Dokumente
&
Interfacing of
Peripherals
Microcontroller & Microprocessor
5
Features of 8051 Architecture
Timer/Counter
Interrupt RO RAM
M
CPU
P0-P3
8051 Memory Model
FFF
7F FF
7
F
ROM
RA SFR
M
00
80 000
8
Byte Address
1F
Internal RAM Organization
Byte
BANK 3 Address Bit Address Byte Address
R0--R7 7F
2F 7F 78
18
17
BANK 2
R0--R7
10
0F
BANK 1
R0--R7
08
07
BANK 0
R0 -- R7 20 07
00 30
00
Working Registers Bit Addressable General purpose 9
SFR
A B IP IE TMOD TCON
E0 F0 A8
IP B8 89 88
SP
81
DPTR
DPH DPL PC
83 82
16
Interrupt service routine starting
address
External 0 0003h
Timer/Counter 0 000Bh
External 1 0013h
Timer/Counter 1 001Bh
Serial port 0023h
17
Interfacing of Peripherals
18
Switch Interfacing
8051
4.7
4 s
.7kk
w
P0.0
19
l
Led Interfacing
8051
4.7
4
.7kk
Led
Px.x
20
Relay Interfacing
8051
Px.x
21
LCD
LCDInterfacing
Interfacing
LCD
+5
8051 P1.0 D v
Vcc
0
Vee
LCD
Vss
P1.7 D7 Rs R/W
E
P2.0
P
P2.1
2.0
P2.2
22
Embedded C Program for LED blinking
#include<reg51.h>
void main()
{
while(1) {
P1 = 0xFF;
delay();
P1 = 0x00;
delay();
}
}
Void delay(void)
{
unsigned char i;
for(i=0;i<1000;ii++);
}
23
24