INTERFACING - 8255: Program
INTERFACING - 8255: Program
1.AIM: To initialize port B in output mode and output the data 45 PROGRAM: ADDRESS OPCODE INSTRUCTION ORG 4100 4100 4102 4104 4106 4108 3E 80 D3 C6 3E 45 D3 C2 76 MVI A,80 OUT 0C6H MVI A,45 OUT 0C2H HLT OUTPUT DATA 45 INITIALISE B AS OUTPUT PORT COMMENT
INFERENCE: The leds are glowing as 0100 0101. RESULT: Thus a program to output data through port B has been executed.
2. PORT A AS INPUT PORT AND PORT B AS OUTPUT PORT IN MODE 0: AIM: To initialize port A as input port and port B as output port in mode 0, to input the data as set by the SPDT switches and to output the same data to port B to glow the leds. PROGRAM: ADDRESS OPCODE INSTRUCTION ORG 4100H 4100 4102 3E 90 D3 C6 MVI A,90H OUT 0C6H
DB C0 D3 C2 76
INFERENCE: When a known data is set by the SPDT switches and the program executed , the leds corresponding to the data glow. RESULT: The program to use port A as input and B as output ports in mode 0 has been executed.
3. INITIALISE PORT C AS OUTPUT PORT IN MODE 0: AIM: To initialize port C as output port in mode 0 and to output data in port C accordingly to glow leds. PROGRAM: ADDRESS 4100 4102 4104 4106 4108 OPCODE 3E 90 D3 C6 3E 80 D3 C4 76 INSTRUCTION MVI A,90 OUT 0C6H MVI A,80 OUT 0C4H HALT COMMENT INITIALISE PORT C AS OUTPUT PORT IN MODE 0 SET PC-7 BIT
INFERENCE: The leds glow according to the data output to port c. RESULT: The program to initialize port c as output port and output data to glow leds has been executed.
4. INITIALISE PORT C IN OUTPUT MODE AND EXPLAIN BIT AIM: To write a program to initialize port C as output port in mode 0 and to.. PROGRAM: ADDRESS OPCODE INSTRUCTION ORG 4100H 4100 4102 4104 4106 4108 3E 80 D3 C6 3E 01 D3 C4 3E 07 MVI A,80 OUT 0C6H MVI A,01 OUT 0C4H MVI A,07 SET PC3 BIT WITHOUT RESETTING PCO SET THE PC0 BIT PORT C AS OUTPUT PORT IN MODE 0 COMMENT
D3 C6 76
The program to initialize port c as output port in mode 0 and. Has been executed. 5 .INITIALISE PORT C AS INPUT PORT IN MODE 0 AND TO INPUT USING DEBOUNCE CIRCUITS: AIM: To initialize port C as input port in mode 0 and input data using debounce circuits. PROGRAM: ADDRESS OPCODE INSTRUCTION ORG 4100H 4100 4102 3E 99 D3 C6 MVI A,99 OUT 0C6H
DB C4 32 00 45 76
INFERENCE: In our circuit PC2,PC4,PC6 have been connected to debounce switches. Input the data after pressing any one debounce switch. The data will be stored in location 4500. RESULT: The program to initialize port C as input port in mode 0 and to input data using debounce circuits has been executed. 6 .INITIALISE PORT A AS INPUT PORT IN MODE 0 AND STORE THE DATA IN 4500 AIM: To initialize port A as input port in mode 0 , input data using SPDT switches & store data PROGRAM: ADDRESS OPCODE INSTRUCTION ORG 4100H 4100 4102 4104 4106 4109 3E 90 D3 C6 DB C0 32 00 45 76 MVI A,90 OUT 0C6H IN 0C0H STA 4500 HLT INITIALISE PORT A AS INPUT PORT OUT TO CONTROL PORT READ PORT A STORE IT IN 4500 COMMENT
INFERENCE: Port A is set as input. The data set by SPDT switches is stored in the accumulator and then stored in 4500. RESULT: The program to initialize port A as input port in mode 0 and the store the data in 4500 has been executed.