Download Generating triangular and sinewave using the AT89S52

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Valve audio amplifier technical specification wikipedia , lookup

Transcript
Generating triangular and sine wave using the AT89S52.
(Range 2nd exercises)
Assignment:
1. Create a triangular generator (using cycles) with the D/A converter. The result appears
on the oscilloscope and the board with LEDs.
2. Create a generator of sine wave (using tables) with the D/A converter. The result
appears on the oscilloscope.
Theory:
Schematic of a connection of a 8-bit D / A converter
D/A converters ensure the transfer of input digital information (data word) to an output analog
signal, usually the corresponding value of voltage (lower power). Basic applications of D/A
converters are work with a microprocessor i.e. generating different values respectively
different output voltage waveforms. Connection diagram of D/A converter (DAC08), who
works as bipolar (the output voltage range is from ±5V) is shown in the picture above. If we
know the extent of n-bit converter and its input data word N (appoints in decimal), we can
calculate the output analog signal:
S S
U vyst  N max n min  S min
2 1
This means that the analog output voltage, if the range is ± 5V, and its input is a binary
number 10010011 (147 decimal) is equal.
U vyst  N
S max  S min
5  (5)
 S min  147 8
 (5)  0,76V
n
2 1
2 1
From the definition and an example can be inferred that the voltage 0V corresponds to the
input word (N) 128. 5V corresponds to the full by 255. If we want a triangular wave, we must
cyclically increase the value of the input word (N) in the range of numbers 128 to 255.
Triangular wave
If we want to realize sinusoidal wave, we must D/A converter connected as bipolar (the
output voltage will have range ± 5V). Then it should be divided sinusoidal sample below.
Sinusoidal wave
It is necessary to generate a table that will include replicating the course of voltage sine
functions and data word N calculated using the formula for Uvyst. The program will upload
cyclically output D / A converter value of the sine function.