Program to generate following waveforms 

  1. Ramp waveform 
  2. Square waveform 
  3. Step waveform 
  4. Triangle waveform

Aim:

Program to generate following waveforms    

  1. Ramp waveform
  2. Square waveform
  3. Step waveform
  4. Triangle waveform

Apparatus:

  1. ADS-SDA-86-STA kit
  2. 8255 Study card
  3. Adapter, Keyboard, Cables, CRO Etc...

Procedure:

1. Connect 8086 kit PC using RS232 cable.
2. Connect Power supply to 8086 kit and 8255 interfacing kit(only blue( 5v) and black(0v) lines   Power cable to power supply)
3. Connect 8255  to CN4 of 8086 using 26  pin bus.
4. Connect the CRO probe to JP3 of 8255 kit
5. Keep the DIP switch in 1 & 7 on (8086 kit), open TALK, and go to options select target device as 8086 and Connect.
6. Change dip switch into 1 & 5on, once reset 8086 kit.
7. Go to file Download hex file 
8. G-5000(on system keyboard), we can observe the output on 8086 kit and CRO.

Program:

Ramp Waveform Generation

.OUTPUT 2500AD
CONTROL    EQU FFC6H       ;control port address for 8255
PORTA EQU FFC0H    ;porta address for 8255
PORTB EQU FFC2H    ;portb address for 8255
PORTC EQU FFC4H    ;portc address for 8255

DSEG SEGMENT
ORG 0000: 4000H
      MSG    DB' Dac mode    ',0h
      MSG1    DB    'Ramp wave output',0h
      DSEG    ENDS
    
CSEG    SEGMENT
    ORG 0000 : 5000H
    ASSUME CS : CSEG, DS : DSEG
    START:
    MOV DX, CONTROL    
    MOV AL, 80H        ;initialise all ports as output
    OUT DX, AL        ;ports
                        ;displaying message on LCD
    Call far f800 : 4bb1h    ;clear display
    Mov di, 80h    ;display in upper line
    MOV SI, offset MSG    
    CALL FAR f800 : 4FC0h    ;display output routine
    MOV DI, C0H    ;display in lower line
    MOV SI, OFFSET MSG1    
    CALL FAR F800 : 4FC0H    ;display output routine
    ;ramp wave form generation
    MOV BL, 00H        
RAMP: MOV DX, PORTB
    MOV AL, BL    ;increment the digital code
    OUT DX, AL    ;and output it on to PORTB
    INC BL
            ;check to see if a NMI-INTR
    JNZ RAMP

    MOV BL, 00H
    JMP RAMP
CSEGENDS
END
SQUARE WAVEFORM:            
DA00: MOV DX, PORTB
      MOV AL, 00H        ;outport 00 for 0V level
      CALL OUTPUT
      MOV AL, 0FFH        
      CALL OUTPUT        
      JMP DA00
    ;routine to output digital value
OUTPUT: OUT DX, AL
    CALL DELAY
    RET
DELAY: MOV CX,0FFH     ;to vary the frequency alter the delay count
LUP1: LOOP LUP1
      RET
STEP WAVEFORM:
DA00: MOV DX, PORTB
      MOV AL, 00H    ;outport 00 for 0V level
      CALL OUTPUT
      MOV AL, 7FH    ;outport 7F for 2.5V level
      CALL OUTPUT
      MOV AL, FFH    ;outport FF for 5V level
      CALL OUTPUT
            ;look for NMI-INTR if user
     JMP DA00    ;switch to ramp w/f generation

    ;routine to output digital value
    
OUTPUT: OUT DX, AL
    MOV CX, FFH
DELAY: LOOP DELAY
    RET

TRIANGULAR WAVEFORM:
        
DA00: MOV DX, PORTB
      MOV AL, 00H    ;outport 00 for 0V level
UP: CALL OUTPUT
    INC AL
    CMP AL, 00H
    JNZ UP
    MOV AL, 0FFH       ;to change amplitude change count
UP1: CALL OUTPUT
     DEC AL
     CMP AL, 0FFH
     JNZ UP1
     JMP DA00
;routine to output digital value
OUTPUT: OUT DX, AL
    CALL DELAY
    RET
DELAY: MOV CX, 07H    ;to vary the frequency alter the delay count
LUP1: LOOP LUP1
      RET

Step waveform:

DA00: MOV DX, PORTB
      MOV AL, 00H    ;outport 00 for 0V level
      CALL OUTPUT
      MOV AL, 7FH    ;outport 7F for 2.5V level
      CALL OUTPUT
      MOV AL, FFH    ;outport FF for 5V level
      CALL OUTPUT
            ;look for NMI-INTR if user
      JMP DA00    ;switch to ramp w/f generation
            ;routine to output digital value
OUTPUT: OUT DX, AL
    MOV CX, FFH
DELAY: LOOP DELAY
       RET

Triangular waveform:

DA00: MOV DX, PORTB
      MOV AL, 00H    ;outport 00 for 0V level
UP: CALL OUTPUT
    INC AL
    CMP AL, 00H
    JNZ UP
    MOV AL, 0FFH       ;to change amplitude change count
UP1: CALL OUTPUT
     DEC AL
     CMP AL, 0FFH
     JNZ UP1    
     JMP DA00
;routine to output digital value
OUTPUT:    OUT DX, AL
    CALL DELAY
        RET
DELAY: MOV CX, 07H    ;to vary the frequency alter the delay count
LUP1: LOOP LUP1
      RET

Result:

The waveforms are generated by interfacing PPI to 8086 kit and observed on CRO.

Viva-voce questions:

  1. Expand PPI?
  2. Where do we prefer the serial communication?
  3. What is the function of instruction pointer (IP) register?
  4. What is the difference between IN and OUT instructions?
  5. What is MODEM?