Presentation is loading. Please wait.

Presentation is loading. Please wait.

Example: Addressing modes

Similar presentations


Presentation on theme: "Example: Addressing modes"— Presentation transcript:

1 Example: Addressing modes
Write code to send 55H to ports P1 and P2, using (a) their names (b) their addresses Solution : (a) MOV A,#55H ; A=55H MOV P1,A ; P1=55H MOV P2,A ; P2=55H (b) P1 address=90H; P2 address=A0H MOV A,#55H ; A=55H MOV 90H,A ; P1=55H MOV 0A0H,A ; P2=55H 23-Nov-18 Micro 8051

2 Hardware Structure of I/O Pin
D Q Clk Q Vcc Internal Pull-Up Read latch Read pin Write to latch Internal CPU bus M1 P1.X pin P1.X B1 B2 23-Nov-18 Micro 8051

3 Hardware Structure of I/O Pin
Each pin of I/O ports Internally connected to CPU bus A D latch store the value of this pin Write to latch=1:write data into the D latch 2 Tri-state buffer: B1: controlled by “Read pin” Read pin=1:really read the data present at the pin B2: controlled by “Read latch” Read latch=1:read value from internal latch A transistor M1 gate Gate=0: open Gate=1: close 23-Nov-18 Micro 8051

4 Port-3 Alternate I/O 23-Nov-18 Micro 8051

5 23-Nov-18 Micro 8051


Download ppt "Example: Addressing modes"

Similar presentations


Ads by Google