Section: Hardware Interfacing Experiments
Aim:
- To write an assembly language program for digital to analog conversion.
- To convert digital inputs into analog outputs & to generate different waveforms.
Apparatus Required:
- 8085 Microprocessor kit – 1
- Power Supply (+5 V dc, +12 V dc) – 1
- DAC Interface board – 1
- Cathode Ray Oscilloscope (CRO)
Algorithm:
-
Measurement of Analog Voltage:
- Send the digital value to the DAC.
- Read the corresponding analog value at its output.
-
Square Waveform Generation:
- Send low value (
00H) to the DAC. - Introduce a suitable delay.
- Send high value (
0FH/FFH) to the DAC. - Introduce delay.
- Repeat the above procedure continuously.
- Send low value (
-
Saw-tooth Waveform Generation:
- Load low value (
00H) to accumulator. - Send this value to DAC.
- Increment the accumulator.
- Repeat steps 2 and 3 until accumulator value reaches
FFH. - Repeat the procedure from step 1.
- Load low value (
-
Triangular Waveform Generation:
- Load low value (
00H) in accumulator. - Send accumulator content to DAC.
- Increment the accumulator.
- Repeat steps 2 and 3 until accumulator reaches
FFH. - Decrement the accumulator and send accumulator contents to DAC.
- Repeat step 5 until accumulator reaches
00H, then repeat from step 1.
- Load low value (
Program:
- 1. Square Wave Program:
| Address | Label | Mnemonics | Operand | Comment |
|---|---|---|---|---|
| 4100 | START | MVI | A, 00H | Load 00 in accumulator |
| 4102 | OUT | C8 | Send through output port | |
| 4103 | CALL | DELAY | Give a delay | |
| 4105 | MVI | A, 0FH | Load 0F in accumulator | |
| 4107 | OUT | C8 | Send through output port | |
| 4108 | CALL | DELAY | Give a delay | |
| 4109 | JMP | START | Go to starting location | |
| 410A | DELAY | MVI | B, 05 | Load count value 05 in B reg |
| 410B | L1 | MVI | C, 0F | Load count value 0F in C reg |
| 410C | L2 | DCR | C | Decrement C register |
| 410E | JNZ | L2 | Loop until C is 0 | |
| 410F | DCR | B | Decrement B register | |
| 4110 | JNZ | L1 | Loop until B is 0 | |
| 4112 | RET | Return to main program |
- 2. Saw-tooth Wave Program:
| Address | Label | Mnemonics | Operand | Comment |
|---|---|---|---|---|
| 4100 | START | MVI | A, 00H | Load 00 in accumulator |
| 4102 | L1 | OUT | C0 | Send through output port |
| 4103 | INR | A | Increment contents of accumulator | |
| 4104 | JNZ | L1 | Send through output port until FF | |
| 4107 | JMP | START | Go to starting location |
- 3. Triangular Wave Program:
| Address | Label | Mnemonics | Operand | Comment |
|---|---|---|---|---|
| 4100 | START | MVI | L, 00H | Load 00 in L register |
| 4102 | L1 | MOV | A, L | Move contents of L to A |
| 4103 | OUT | C8 | Send through output port | |
| 4104 | INR | L | Increment contents of L | |
| 4105 | JNZ | L1 | Send through output port until FF | |
| 4108 | MVI | L, FFH | Load FF in L register | |
| 4109 | L2 | MOV | A, L | Move contents of L to A |
| 410A | OUT | C8 | Send through output port | |
| 410B | DCR | L | Decrement contents of L | |
| 410C | JNZ | L2 | Send through output port until 00 | |
| 410F | JMP | START | Go to starting location |
Observation:
- Measurement of Analog Voltage:
| Digital Data | Analog Voltage |
|---|---|
FF | 5V |
00 | 0V |
Result: Thus digital to analog conversion is done and different waveforms such as square wave, sawtooth wave, and triangular wave are generated by interfacing DAC with 8085.
Viva Questions:
1. DAC (Digital to Analog Converter) finds application in what types of control systems?
2. Which device is connected between OUT1 and OUT2 of AD7523 to save DAC from negative transients?
3. What is the function of an operational amplifier connected at the output of AD7523?
4. What is the settling time of DAC 0800?
5. What is meant by the instruction `OUT C8`?
6. Give examples of various DAC ICs.
For all 2026 published articles list: click here:
…till the next post, bye-bye & take care