this is the slide of control word of microprocessor
Size: 1.62 MB
Language: en
Added: Aug 19, 2018
Slides: 12 pages
Slide Content
Submitted By Tahsinur Rahman ID : 161001015 Department of EEE Course Teacher Muhammad Mahmudul Hasan Tareq Lecturer Department of EEE Welcome to my presentation
Presentation on Control Word
Control Word How can we tell microprocessor that which port of 8255 we use as input or output ? A port can be programmed to act as an input port or an output port. To tell about that we generate a bit pattern or we may say a word which is called control word. A control word is, therefore, to be formed for programming the ports of 8255A .
Type There are two control words for an 8255A IC Mode Control Word: It is used to tell the device what mode we want the ports to operate in. Bit Set/Reset Control Word: It is used when we want to set/reset the output on a pin of PORT C or when we want to enable the interrupt output signal for handshake data transfer. Both control words are sent to the control register address of the 8255A
Mode Control Word
Example Suppose that we want to initialize an 8255A as follows : PORT B as mode 1 input PORT A as mode 0 output PORT C upper as inputs PORT C bit 3 as output Assume that the base address is FFFEH
Solution To send Mode-Set Control Word : MOV AL, 8E MOV DX, FFFEH OUT DX, AL OUT DX, AL States that, To operate the system AL has been sent into DL Constructing the mode-set control word: D0= 0; port A lower as output D1=1; port B as input D2=1; port B mode 1 D3=1; port A as input D4= 0; port B as input D5=0; port A mode 0 D6=0; port A mode 0 D7=1; Mode set control word Final Mode: 10001110= 8EH
IN & OUT Instruction IN instruction is used to read data from a port . OUT instruction is used to write data to a port . These instructions does not affect flags There are two types of port format for these instructions. Fixed port format Variable port format
Fixed Port Format IN Instruction: IN AL, ADDR_PORT; for 8-bit IN AX, ADDR_PORT; for 16-bit OUT Instruction: OUT ADDR_PORT, AL; for 8-bit port OUT ADDR_PORT, AX; for 16-bit port
Variable port format IN Instruction: IN AL, DX; for 8-bit IN AX, DX; for 16-bit OUT Instruction: OUT DX, AL; for 8-bit port OUT DX, AX; for 16-bit port