Professional Documents
Culture Documents
On
OF
IN
Submitted to
Submitted by:
Name Roll no PRN no
Amitkumar Hasmukhbhai Patel 259 2019033800134933
Supriya Kumari 260 2019033800133454
THE MAHARAJA SAYAJIRAO UNIVERSITY OF BARODA, VADODRA
Affiliated
2020
CERTIFICATE
This is to certify that a project report, submitted along with the Domain entitled
“INTERFACE DAC AND SERIAL COMMUNICATION AND GENERATE WAVEFORM WITH
REQUIRED FREQUENCY BEING RECEIVED FROM REMOTE PC “has been carried out by
following students under my guidance in partial fulfilment for the degree of Master in
Engineering in AUTOMATIC CONTROL & ROBOTICS, Electrical Department of The
Maharaja Sayajirao University of Baroda during the academic year 2019-20.
Submitted by:
We would like to express our sincere gratitude to our supervisors Mr. Hiren Sir and Farah
Ma’am for providing their invaluable guidance, comments, suggestions and constant
support throughout this project.
We also thank our HOD for his permission and the golden opportunity to do this wonderful
project on the topic “Interface DAC and serial communication and generate waveform with
required frequency being received from remote PC”, which also helped us in doing a lot of
research and we came to know about so many new things.
Secondly we would also like to thank our friends and eneryone who helped us a lot in
completing this project within the limited time frame.
ABSTRACT
Sr. no Title
1 Introduction
2 Hardware Units Requirement
2.1 AT89C51 Microcontroller(8051 family)
2.2 DAC0808
2.3 MAX232 IC
2.4 LF351 OPAMP
2.5 Resistors
2.6 Capacitors
2.7 Crystal Oscillator
2.8 DB9 connector
2.9 Transformer
2.10 5v Power Supply Circuit
2.11 Personal Computer
3 Software tools requirement
3.1 Keil μvision
3.2 Proteus Design Suite
4 Circuit connection diagram
5 Design & connections details
6 Waveform generation using DAC and 8051 microcontroller
7 Simulation program
8 Results
9 Conclusion
10 References
1. INTRODUCTION
2.5 Resistors
A resistor is a passive two-terminal electrical component that implements electrical
resistance as a circuit element. In electronic circuits, resistors are used to reduce current
flow, adjust signal levels, to divide voltages, bias active elements, and terminate
transmission lines, among other uses.
2.6 Capacitors
A capacitor is a two terminal passive device which behaves as a charge storage device in
electric circuit. The most basic construction of a capacitor consists of two parallel
conductors (usually metallic plates) separated by a dielectric material. When we connect a
voltage source across the capacitor, the conductor (capacitor plate) attached to the positive
terminal of the source becomes positively charged, and the conductor (capacitor plate)
connected to the negative terminal of the source becomes negatively charged. Because of
the presence of dielectric in between the conductors, ideally, no charge can migrate from
one plate to other.
2.7 Crystal Oscillator
A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a
vibrating crystal of piezoelectric material to create an electrical signal with a precise
frequency
2.9 Transformer
• The centre-tapped transformer also known as two phase three wire transformer is
normally used for rectifier circuits.
• When a digital project has to work with AC mains a Transformer is used to step-down
the voltage and then convert it to DC by using a rectifier circuit.
• In a center-tapped transformer the peak inverse voltage is twice as in bridge rectifier
hence this transformer is commonly used in full wave rectifier circuits.
Features:
• AT89C51 microcontroller has 4 ports P0, P1, P2, P3. Each port has 8 pins (0-7).
• Port 2 is connected to DAC0808. DAC0808 is 16 pin IC where both sides lower 4 -4pins
are used for 8 bit data input, where pin 5 holds MSB of the digital data input and pin 12
holds LSB of the digital data input.
• Vref(+) at pin 14 is connected to 5V through 5K resistor. Vee(-) at pin 3 is connected to -
12V.
• In DAC0808 chip the digital inputs are converted to current. The output current is
known as Iout
• The total current provided by the Iout pin is basically a function of the binary numbers
at the input pins D0 - D7 (D0 is the LSB and D7 is the MSB) of DAC0808 and the
reference current Iref. The following formula is showing the function of Iout
• The Iref is the input current, must be provided into the pin 14. 2.0mA is used as Iref
• The output is taken from pin 4, which gives output in form of current. But the
requirement is of voltage, which is obtained by connecting a 5K resistor with it.
• We connect the Iout pin to the resistor to convert the current to voltage. But in real life
it may cause inaccuracy since the input resistance of the load will also affect the output
voltage. So practically Iref current input is isolated by connecting it to an Op-Amp with
Rf = 5KΩ as feedback resistor. The feedback resistor value can be changed as per
requirement. But the voltage obtained is of very low level, so as to amplify that IC LF351
is used.
• Port 3 is connected to MAX232 through pin P3.0 (RXD) and P3.1 (TXD) and DB9
connector is connected to it.
• As RS232 is not compatible with the microcontroller, a line driver is needed to convert
RS232’s signals to TTL voltage levels that is acceptable to 8051’s pins, so one of the
such converter is MAX232 is used. MAX 232 converts from RS232 voltage levels to TTL
voltage levels and vice versa.
Program:
ORG 0000H
MOV DPTR,#LOOKUP //address of look-up table
REPEAT: MOV R1,#18
CLR A
NEXT: MOV R3,A // save A
MOVC A,@A+DPTR // fetch the value in look-up table
MOV P2,A //send to DAC
MOV A, 3 //retrieve A
INC A // next entry in the look-up table
DJNZ R1,NEXT
CLR A
MOV R2, #18 //negative cycle 180 to 360
NEXT1 : MOV R3,A //save A
MOVC A,@A+DPTR //fetch the value in look-up table
CLR C //clear carry before Subtraction
MOV R4,A // find negative value
MOV A,#0FFH
SUBB A,R4
MOV P2,A // send to DAC
MOV A, R3
INC A //next entry in look-up table
DJNZ R2, NEXT1
SJMP REPEAT // repeat cycle forever
After serial communication when we give input to DAC , we get different waveforms at
different frequencies. For sine wave below output we received for look up table values
128,150,171,191,209,225,238,247,252,255,253,247,238,225,209,191,171,150
9. CONCLUSION
A device for DAC interfacing and serial communication and generate waveform with
required frequency being received from remote PC using 8051 microcontroller is designed
and built. The experimental results show that variable waveform of acceptable accuracy
could be obtained with a high degree of flexibility, small size and a small number of
components. The upper frequency range is limited by the switching frequency of the
microcontroller. Thus, the future work may include the multiprocessor or
multimicrocontroller implementation of the microcontroller-based function generator.
.
REFERENCES