PHY 406 - Microprocessor Interfacing
Techniques
Module 5 - More On Digital-to-Analog
In this module we will look more closely at two D/A converters. The 12-bit one in your
LabVIEW board and an 8-bit one on the interface card.
Preparation
You have probably already used most of the VIs that you will use in this module. You might
want a couple from the signal processing set, but I can't predict how you will answer the
questions! You could certainly re-use some bits from previous programs you have written
(assuming you can remember what they did!)
There is a demonstration program - timer_da_test.vi - in the e:\l_view\examples which shows
you roughly how the timer and the d/a converter interface works. It's the same program you used
in module 4. Make sure (by asking if necessary) that you understand the circuit diagram for the
keypad and display interface timer_da.pdf
You must remember that LabVIEW is a "dataflow" language. That means that the program order
of execution is controlled by the availability of data, not the left-to-right order of the modules.
Unless LabVIEW can determine for itself that the action of one element depends upon the output
from another element, then you must put the time dependence in explicitly with a sequence or
something similar.
Equipment
You will need the timer and digital-to-analog converter interface which is kept in the cupboard.
There is some variation in the D/A converters, so you should make a note of the converter
number so that you can use it consistently. You are also asked to try several converters at one
point - please be kind to your fellow students.
Throughout this practical when reference is made to a digital-to-analog converter, or more
commonly "the converter" - the one on the interface card is implied.
Calibrate the Converter
- The first thing to do is to find out how the converter levels are organised, ie What are m and c
in the equation: V = mN + c (V is the output voltage and N is the output count)? You might
want to make a simple sub-VI to establish these parameters for any converter you are using.
You can use the A/D converter Ch0 to measure the voltage coming out of the D/A converter
and thus get the values straight into the computer. (HINT: There is some random noise on the
converters so it might be a good idea to take a number of readings and average them to get a
"quiet" result.) Remember that this will probably be different for each converter in the lab.
What's the Staircase Like?
- Now write a VI which will evaluate the error on every state of the 8-bit converter and plot a
suitable graph. (HINT - I know it's a straight line - so do you - how straight is it and what are
the deviations is the issue at hand)
- Since your VI will be fully automatic and should only take a few seconds to run, try looking at
as many of the converters as you can. (Co-operate, remember!)
- What can you explain from the graphs of the various converters? Please think carefully about
this one - it's important and put in as much detail as you can
- Why is there no point in doing this for the 12-bit converter on your LabVIEW board?
How do the Levels Change?
- Now let us look at the question of how a converter moves between the various levels of
output. Write a VI to output a variable size square wave from the 8-bit converter and
quantitatively sketch the form of the output using the oscilloscope. Pay particular attention to
the "edges" of the square wave which is where all the action is.
- Does it make any difference if the step is large or small?
- From your deductions above, calculate the highest frequency sine wave that can be output
from the converter as a function of it's amplitude, V. (You may assume that I can get as fast a
computer as necessary - ie computer speed is not a limitation)
- Repeat the above three points for the 12-bit converter in your LabVIEW board.
- How do the two converters compare to one another?
Advanced
This section is for the intelligent/bored or otherwise fascinated. There are no marks for this
section - only the satisfaction of solving a problem or two.
- The output of a D/A converter with an alleged sine wave output is evidently not sinusoidal.
What other terms should there be? Can you process the digital input to actually see these
terms?
Notes
This practical talks about two issues.
- Things are never ideal and converters have some favourite places to "go wrong". Note that
these "errors" are within the specification of the converter, they're just not nice.
- I commented earlier in the course that one should be very aware of what converters do when
they move from state-to-state. This module should emphasise that point.