PROGRAMMABLE PERIPHERAL INTERRUPT PERIPHERAL INPUTS AND OUTPUT – 8255
AIM:
To study the mode 0 and mode 1 Characteristics of 8255 PPI in 8085 MP system using SPDT switches & LED’s
APPARATUS REQUIRED:
1. 8255 – Peripheral input and output board
2. 8085 – Microprocessor kit
3. Flat ribbon cable.
MODE 0:
AIM:
To Initialize the port A as input port and port as output Port in mode 0, to input the data at port A as set by the spit switches and to output the same data as Port B to glow the LED’s
ALGORITHM:
1. Enter the program starting from the user RAM address 4100
2. Set a known data at the SPDT switches
3. Execute the program
1. The data as set by the accumulator and is stored in 4500
2. Please verify whether the data at 4500 is the same as that of set by SPDT switches.
PROGRAM
ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENTS |
4100 | 3E | | MVI A, 90 | IINITIALIZE PORT A AS SPDT |
4101 | 90 | | | |
4102 | D3 | | OUT 0C6H | OUT THE CONTROL PORT |
4103 | C6 | | | |
4104 | DB | | IN OCOH | READ PORT A |
4105 | CO | | | |
4106 | D3 | | OUT OC2H | STORE IT AT 4500 |
4107 | C2 | | | |
4108 | 76 | | HLT | STOP THE PROGRAM |
MODE 1
AIM
To initialize Port A as input port and port B as output port in mode 0,to input the data at Port A as the set by the SPDT switches and to output the same data as port B to glow the LED’s accordingly
ALGORITHM:
1. Enter the program starting from the user RAM address 4100
2. Set a known data at the SPDT switches and executes the program
3. Initialize port A as input port and port B as output port
4.The data as set by SPDT switches setting is input to the accumulator and is outputted to port B
5.Please verify visually that the data output at the LED’s is the same as that set by the SPDT switch setting S.
ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENTS |
4100 | 3E | | MVI A, 90 | MOVE THE DATA 90 TO A REG |
4101 | 90 | | | |
4102 | D3 | | OUT 0C6H | OUT TO CONTROL PORT |
4103 | C6 | | | |
4104 | DB | | IN 0C0DH | READ PORT |
4105 | C0 | | | |
4106 | D3 | | OUT 0C2H | OUT TO CONTROL PORT |
4107 | C2 | | | |
4108 | 76 | | HLT | STOP THE PROGRAM |
ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENTS |
4200 | DB, 00 | INT | IN 000H | READ PORT A |
4202 | 32,00,45 | | STA 4500 | STORE THE RESULT |
4205 | 76 | | HLT | STOP THE PROGRAM |
MODE TWO
To initialize port A as an input port in Mode 1 to enable RST 5.5 interrupt of 8085 CPU and to input the data to the CPU in configuration with the hand shaking signals
ALGORITHM:
1. Enter the main program starting from the user Ram address 4100
2. Enter the ISR starting from user RAM address 4200
3. Enter the jump 4200 op code from location 4010
4. Execute the main program set a known data at the SPDT switches.
5. Input the data by pressing INTI switch
6. The 8255 i/p the data at port A stores the data in its buffer and then interrupts the CPU
PROGRAM:
ADDRESS | OPCEDE | LABEL | MNEMONICS | COMMENTS |
4100 | 3E,B6 | | MVI A, B6 | PORT A AS AN I/P |
4102 | D3, C6 | | OUT 0C6H | PORT IN MODE1 |
4104 | 3E, 09 | | MVI A, 09 | SET THE PC4 BIT |
4106 | F3 | | | ENABLE INTERRUPT |
4107 | 3E, 08 | | MVI A, 08 | ENABLE RST 5.5 |
4109 | 30 | | | |
410A | FB | | E1 | |
410B | 76 | | HLT | STOP THE PROGRAM |
ISR 1 INTERRUPT SERVICE ROUTING
ADDRESS | OPCODE | LABEL | MNEMONICS | COMMENTS |
4200 | DB, 00 | INT | IN 000H | READ PORT A |
4202 | 32,00,45 | | STA 4500 | STORE THE RESULT |
4205 | 76 | | HLT | STOP THE PROGRAM |
RESULT:
Thus the AL program was written to perform the generation square wave using 8255 and executed successfully.
0 comments:
Post a Comment