PadhaikoAll subjects

Past exam question: Assignment 3, Q6

Instrumentation · 6 marks

Open in the Padhaiko app

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

Question

What will be the control word for interfacing as shown figure below? Also write the subroutine program to read the digital data from ADC.

Solution

Determining the 8255 Control Word and Port Addresses:

How Conversion and Reading Work in This Circuit: Because of the ADC804 is grounded and its and pins are tied to the system and lines:

  1. Writing any dummy byte to Port A (OUT 00H) asserts low, pulsing the ADC804's pin to start conversion (while the 8255 ignores the write since Port A is configured as Input).
  2. The 8085 polls PC0 (IN 02H, RAR) until (), indicating conversion is complete.
  3. Executing IN 00H asserts low, simultaneously enabling the ADC804 tri-state buffers onto PA7–PA0 and reading Port A into the 8085 accumulator.

8085 Subroutine to Read Digital Data from ADC804:

8085 Subroutine: Read Digital Data from ADC804 via 82558085 ASM
; Assumed port addresses (A7 = 0, A6..A2 = 0):
; Port A = 00H, Port C = 02H, Control Register = 03H

READ_ADC: MVI A, 91H       ; Control word: Mode 0, PA=Input, PCL=Input (PC0=INTR')
          OUT 03H          ; Initialize 8255 Control Register
          OUT 00H          ; Pulse WR' low (with ADC CS'=0) to start ADC conversion
POLL:     IN 02H           ; Read Port C
          RAR              ; Move PC0 (INTR') into Carry flag
          JC POLL          ; If CY = 1 (INTR' high, busy), continue waiting
          IN 00H           ; Assert RD' low to enable ADC data and read Port A into A
          RET              ; Return with 8-bit converted value in Accumulator
Answer:

All past exam questions for Instrumentation