0% found this document useful (0 votes)
8 views

Ex NO _ 7

The document outlines an experiment to interface a DAC 0808 module with an 8051 Microcontroller to generate various waveforms including square, sawtooth, triangular, and sinusoidal. It details the required apparatus, problem description, formulas, algorithms for each waveform, and assembly language program (ALP) structures. The experiment concludes with the successful generation of the specified waveforms and includes a marks allocation section for evaluation.

Uploaded by

fsind726
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Ex NO _ 7

The document outlines an experiment to interface a DAC 0808 module with an 8051 Microcontroller to generate various waveforms including square, sawtooth, triangular, and sinusoidal. It details the required apparatus, problem description, formulas, algorithms for each waveform, and assembly language program (ALP) structures. The experiment concludes with the successful generation of the specified waveforms and includes a marks allocation section for evaluation.

Uploaded by

fsind726
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

EX NO : 7

DATE :

DAC INTERFACING WITH 8051 MICROCONTROLLER

Aim:
To interface the given DAC 0808 module with 8051 Microcontroller and to generate the
following waveforms : (i) Square wave (ii) Sawtooth wave (iii) Triangular wave (iv) Sinusoidal
wave.

Apparatus Required:

1. 8051 trainer kit


2. Power Supply
3. Key board
4. DAC0808 module
5. Interface cord
6. CRO

Problem Description:

To connect the Digital input of DAC to Port 1 of Microcontroller and to send Digital

values corresponding to the desired output voltage through Port 1 of 8051 Microcontroller so as
to generate any given waveform.

Formula :
𝑛
𝐷 =
2 −1
+ −
⎡⎢𝑉 − 𝑉− ⎤⎥
𝑉𝑟𝑒𝑓− 𝑉𝑟𝑒𝑓 ⎣ 𝑖𝑛 𝑟𝑒𝑓⎦

where,
D = Decimal equivalent of Digital input corresponding to analog output Vo
Vref+ and Vref- - reference voltages [ +5V and 0V respectively]
Algorithm:
a) Square Waveform:

1. Load digital value corresponding to maximum output voltage into Accumulator.


2. Send Accumulator value to Port 1.
3. Call delay subroutine for required ON time duration.
4. Load Digital value corresponding to minimum output voltage into Accumulator.
5. Call delay subroutine of required OFF time duration.
6. Go step 1.

b) Sawtooth Waveform:

1. Load Accumulator with 00H.


2. Send Accumulator value to Port 1.
3. Increment accumulator contents.
4. Go to step 2.

c) Triangular Waveform :

1. Load Accumulator with 00H.


2. Send Accumulator value to Port 1.
3. Increment Accumulator contents.
4. If accumulator content is less than 0FFH, go to step 2.
5. Decrement Accumulator content.
6. Send Accumulator value to Port 1.
7. If the accumulator value is greater than or equal to zero, goto step 5.
8. Go to step 1.

d) Sinusoidal Waveform :

1. Store digital values corresponding to angles 00,150,300,……,3300 in code memory.


2. Initialize R0 to point code memory address.
3. Initialize R1 to set initial count i.e number of data.
4. Get data from code memory into Accumulator.
5. Send Accumulator value to Port 1.
6. Increment count, increment memory pointer R0.
7. If count is greater than no of data stored, go to step 4.
8. Go to step 2.

ALP:
Square Waveform:

RAM LABEL OPCODE OPERAND COMMENTS


ADDRESS

Triangular Waveform:

RAM LABEL OPCODE OPERAND COMMENTS


ADDRESS
Sinusoidal Waveform:

RAM LABEL OPCODE OPERAND COMMENTS


ADDRESS

Model Calculation:

Vref + = +5V ; V ref – =0V ;


1) Let max o/p voltage for square wave = 4V then
D=
2) For sinusoidal waveform,
V0 at 150 = Vm sin 150 = 5 sin 150

D=

Connection Diagram of DAC Module :


Analog Output

Digital Inputs
Result and Inference:

Assembly Language Program to interface DAC with 8051 Microcontroller is written and
executed. Square, triangular and sinusoidal waveforms were generated.

The following observations were made:

Marks Allocation

Preparation (5)
Program (5)

Viva (5)
Execution (5)

Record (5)

You might also like