PadhaikoAll subjects

Past exam question: Assignment 3, Q8

Instrumentation · 4 marks

Open in the Padhaiko app

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

Question

Write a program for the 8085 µp to generate a square wave signal at the output of DAC.

Solution

Operating Principle and Assumptions:

8085 Assembly Language Program:

8085 ALP: Square Wave Generation at DAC Output8085 ASM
        MVI A, 80H      ; Mode 0: Configure Port A as Output
        OUT 83H         ; Initialize 8255A Control Register (83H)

LOOP:   MVI A, 00H      ; Load digital value for LOW level (0V)
        OUT 80H         ; Send to DAC via Port A (80H)
        CALL DELAY      ; Hold LOW state for half period (T/2)

        MVI A, FFH      ; Load digital value for HIGH level (+V_FS)
        OUT 80H         ; Send to DAC via Port A (80H)
        CALL DELAY      ; Hold HIGH state for half period (T/2)

        JMP LOOP        ; Repeat continuously

; --- Half-Period Delay Subroutine ---
DELAY:  MVI C, FFH      ; Load delay count (adjust for desired frequency)
D_LOOP: DCR C
        JNZ D_LOOP
        RET
Answer:

The 8085 program configures 8255 Port A (80H) as Mode 0 output using control word 80H at 83H, then alternates outputting 00H (LOW) and FFH (HIGH) to the DAC with an equal DELAY subroutine after each level to produce a continuous duty-cycle square wave.

All past exam questions for Instrumentation