Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Take Analog input and convert in digital, send digital input to microprocessor, provide some delay and then send to DAC .
MSB D2
Digital Input D1
LSB D0
Figure shows a block diagram of a 3 bit D/A converter; it has three digital input lines (D2, D1, D0) and one output line for the analog signal. The three input lines can Analog Output assume eight input D/A Conveter combinations from 000 to 111. If the input ranges from 0 to 3 Bit D/A converter 1 V, it can be divided into eight equal parts; each successive input is 1/8V higher than the previous combination
The 3 bit D/A converter has eight input possible combinations. If a converter has n input lines, it can have 2n input combinations. If the full scale analog voltage is 1V, the smallest unit or the LSB is equivalent to 1/2n of 1V. This is defined as resolution. The MSB represents half of the full scale value.
Calculate the values of the LSB and MSB and full scale output for an 8-bit DAC for the 0 to 10V range. LSB 10/256=39mV MSB 10/2 =5 Full scale Output 10-0.0039V= 9.9
MVI A,00H DTOA: OUT FFH MVI B, COUNT DELAY: DCR B JNZ DELAY INR A JMP DTOA This program outputs 00 to FF continuously to the D/A converter. The analog output of the DAC starts at 0 and increase up to 10V as a ramp. When the accumulator contents go to 0, the next cycle begins: thus the ramp signal is generated continuously. The ramp output of the DAC can be observed on as oscilloscope with an external sync. The delay in the program is necessary for two reasons: 1. The time needed for a microprocessor to execute an output loop is likely to be less than the settling time of the DAC. 2. The slope of the ramp can be varied by changing the delay.
Q1. Write a program to generate a triangular wave? Q2. Write a program to generate a square wave of particular frequency? Q3. Write a program to generate a saw tooth wave? Q4. Write a program to generate a ramp wave?