PHY 406 - Microprocessor Interfacing Techniques

Module 1 - Simple Analog Input and Output

Objective

In this module we will examine the basic ideas of analog input and output using a LabVIEW system. We will use single point and multi-point methods of input and output to see the relative merits of each type.

There are three parts to this module: Analog Output, Analog Input and Advanced. The Advanced section is optional and carries no marks.

Preparation

You should have worked your way through the LabVIEW tutorial and have a basic understanding of how to run a Microprocessor Laboratory computer and the LabVIEW system.

We will be using functions from the Functions>>Data Acquisition>>Analog Input and Functions>>Data Acquisition>>Analog Output pallettes.

You will need the following Vis

If you stick with channel 0 as the input and output channels, you can use the default values for the device and channel. You can also ignore the "limits" inputs.

Remember that Ctrl-h brings up help on any VI

Equipment

Analog Output

Using the example VI E:\l_view\examples\anlg_ot1 compute and output a sine wave of 100 points, one sample at a time. You will need to add a timing control to this VI so that you know what the sample rate is.
  1. What is the largest size of sine wave you can produce?
  2. How does this relate to the fact that this is a 12-bit digital-to-analog converter?
  3. What is the highest frequency of sine wave which you can produce which looks "reasonable"?
  4. If an output is to be produced at fixed sample rate such that every state of the converter is to be used, what is the maximum output frequency as a function of the sample output rate?

Using the example VI E:\l_view\examples\anlg_ot2:

  1. Replace the constant update rate with a variable number (ie a control).
  2. Repeat the above exercise with a multi-point output variable output rate.
  3. How do your conclusions for 1, 2, 3 and 4 above change or not with this new configuration?
  4. Why doesn't the output sine wave look like a sine wave at high frequencies even if there are enough points per cycle?

Analog Input

Construct a similar VI to the examples above to measure the voltage on channel 0 of the A/D converter one point at a time using the VI

Functions>>Data Acquisition>>Analog Input>>AI Sample Channel

and display the result as a chart on the front panel. You should include a control to vary the rate at which the samples are taken. You can use the signal generator as an input.

  1. Your chart is in volts, but the A/D converter is described as a 12-bit converter. If the maximum range of the converter is 10V, what is the smallest theoretical change in input which can be detected? - Can you devise any practical test to see if this is in fact the case?
  2. What is the fastest rate of input that you can get?
  3. What is the highest frequency of sine wave that you can realistically examine at any given sampling rate? - (ie how many samples/cycle of the sine wave are required)
  4. If it is required that the input changes less than the smallest measurable change (ie changing a single bit), what is the relationship between the sampling frequency, bit resolution, sine wave amplitude and sine wave frequency?

Change your VI to get an array of 100 points using the multi-point input VI and show it on a graph and then repeat the process. (You will need to adjust the sampling rate input of the multi-point VI).

  1. How do your conclusions for 1, 2, 3 and 4 above change or not with this new configuration?

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.

Notes

The reference to a 12-bit converter means that the output of the converter can be represented by a binary number with 12 "bits" - the equivalent of "digits" in decimal. This means that the converter can represent 2^12 different numbers, but this includes the sign, so that half these numbers are positive and half negative. Thus it is more precise to say that this is an "11-bit + sign" converter.