8051 ports
TRANSCRIPT
A Pin of Port 1A Pin of Port 1
8051 IC
D Q
Clk Q
Vcc
Load(L1)
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P1.X pinP1.X
TB1
TB2
P0.x
Writing “1” to Output Pin P1.XWriting “1” to Output Pin P1.X
D Q
Clk Q
Vcc
Load(L1)
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P1.X pinP1.X
8051 IC
2. output pin is Vcc1. write a 1 to the pin
1
0 output 1
TB1
TB2
Writing “0” to Output Pin P1.XWriting “0” to Output Pin P1.X
D Q
Clk Q
Vcc
Load(L1)
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P1.X pinP1.X
8051 IC
2. output pin is ground1. write a 0 to the pin
0
1 output 0
TB1
TB2
Reading “High” at Input PinReading “High” at Input Pin
D Q
Clk Q
Vcc
Load(L1)
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P1.X pin
P1.X
8051 IC
2. MOV A,P1
external pin=High1. write a 1 to the pin MOV
P1,#0FFH
1
0
3. Read pin=1 Read latch=0 Write to latch=1
1
TB1
TB2
Reading “Low” at Input PinReading “Low” at Input Pin
D Q
Clk Q
Vcc
Load(L1)
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P1.X pin
P1.X
8051 IC
2. MOV A,P1
external pin=Low1. write a 1 to the pin
MOV P1,#0FFH
1
0
3. Read pin=1 Read latch=0 Write to latch=1
0
TB1
TB2
A Pin of Port 0A Pin of Port 0
8051 IC
D Q
Clk Q
Read latch
Read pin
Write to latch
Internal CPU bus
M1
P0.X pinP1.X
TB1
TB2
P1.x
Port 0 with Pull-Up ResistorsPort 0 with Pull-Up Resistors
P0.0P0.1P0.2P0.3P0.4P0.5P0.6P0.7
DS5000
8751
8951
Vcc10 K
Port 0
Port 3 Alternate FunctionsPort 3 Alternate Functions
1717RDRDP3.7P3.7
1616WRWRP3.6P3.6
1515T1T1P3.5P3.5
1414T0T0P3.4P3.4
1313INT1INT1P3.3P3.3
1212INT0INT0P3.2P3.2
1111TxDTxDP3.1P3.1
1010RxDRxDP3.0P3.0
PinPinFunctionFunctionP3 BitP3 Bit