PadhaikoAll subjects

Past exam question: Assignment 3, Q4(b)

Instrumentation · 3 marks

Open in the Padhaiko app

Topic: Microprocessor and microcontroller and their selection criteria, and…

Question

8255 PPI is mapped at base address of 7F00H using memory mapped I/O is used to control operation of lathe. The microcomputer reads instruction code from tape reader on handshake basis and sends appropriate control words to lathe. b) How do you initialize 8255A in correct mode for this application? Write down necessary control word to initialize mode as well as enable interrupt.

Solution

Selecting the Operating Mode and Port Directions:

Mode Initialization Control Word (B4H):

BSR Control Words to Enable Interrupts ( and ): In Mode 1, internal interrupt enable flip-flops are controlled via BSR mode ():

  1. Enable Port A Input Interrupt (): Controlled by setting (bit 4 = 100):
  1. Enable Port B Output Interrupt (): Controlled by setting (bit 2 = 010):

8085 initialization instructions (writing to CWR at 7F03H using memory-mapped STA):

8085 Initialization Sequence (Memory-Mapped at 7F03H)8085 ASM
MVI A, B4H      ; Port A = Mode 1 Input, Port B = Mode 1 Output
STA 7F03H       ; Write mode control word to CWR
MVI A, 09H      ; BSR word: Set PC4 to enable INTE_A
STA 7F03H       ; Enable Port A interrupt
MVI A, 05H      ; BSR word: Set PC2 to enable INTE_B
STA 7F03H       ; Enable Port B interrupt
Answer:

Initialize 8255A in Mode 1 with Port A as strobed input (tape reader) and Port B as strobed output (lathe):

All past exam questions for Instrumentation