ME 462 - Lab 3 - A DIGITAL VOLTMETER

Goal

Interface TTL circuits and a serial A/D converter, learn to use Atom28 internal A/D converter

TTL circuits

Custom digital logic circuits are easy to build. All you need is a smart lab partner, or in lieu of that, a good TTL data book, and an open mind. Odds are that someone else has already done the same thing you want to do, and has developed a special digital chip for that purpose.

Although TTL circuits are simple in concept, they can easily become large and complicated. A suggested procedure to stay organized while breadboarding is to:

a) draw the circuit diagram first including pin numbers of all devices;

b) place components in your drawing in similar positions to where you will put them on the breadboard;

c) layout your circuit and build it like the diagram;

d) as you wire the circuit, make a checkmark on the schematic at each connection you have made;

e) if you find any mistakes in the circuit as you are wiring, update the diagram immediately; and,

f) keep wires neat and short, and use different colors (e.g. red for +5, black for GND).

ADC0831 A/D Converter

It is often necessary to digitize an analog voltage such as the output of a sensor. This is an easy task using an analog to digital (A/D) converter provided that the voltage levels are compatible, the converter is fast enough, and the converter has sufficient resolution.

The performance characteristics of the ADC0831 A/D converter used in this lab are

Type: Successive Approximation

Resolution: 8 bits (1 part in 256)

Conversion Time: 32 msec typical

Input Voltage: 0 to 5 V

Interface: serial TTL

Procedure

1) Connect two 7-segment LED numeric displays to the Atom28 using TTL decoder chips (7447 or 7448)

as shown at the end of this document and verify their operation.

2) Build a simple potentiometer voltage divider circuit to produce an analog voltage between 0 and +5 V. Test this circuit with your DVM.

3) Interface an ADC0831 8-bit serial A/D chip to your Atom28 using the circuit diagram and MBASIC code as shown below. Replace the symbols x y and z with numbers from 0 through 15.

You may wish to review the SHIFTIN command syntax in the online Atom help manual and the ADC0831 spec sheet on the class web page.

ADres var byte ' one byte variable for A/D result

CS con x ' chip select on pin x

AData con y ' data shifted on pin y

CLK con z ' clock to shift data on pin z

high CS ' deselect A/D

Again:

low CS ' start A/D conversion

shiftin AData, CLK, msbpost, [ADres\10] ' shift in data

high CS ' deactivate A/D

debug [ DEC ADres, 13 ] ' display result on PC

pause 1000 ' wait 1000 msec

GOTO Again ' repeat

3) Develop a simple linear equation to compute analog voltage measurements from the 8-bit A/D variable in your program.

equation ______

4) What is the minimum quantifiable voltage difference corresponding to one bit that your ADC0831 could digitize based on your equation?

______

5) Create your own digital voltmeter by continuously displaying the analog voltage reading from your ADC0831 on the two digit LED readout. Blank the readout if the analog voltage goes over 4.5 V. Demonstrate correct operation to the TA.

6) Disconnect your potentiometer output from the ADC0831 and connect it to one of the Atom28 internal 10-bit A/D converters using the following code. The Atom28 A/D pin connections are on the black SIP header adjacent to the white pin field on the Atom28 development board. Substitute the following symbols for QQQ depending on which Atom28 A/D pin you use.

QQQ = AXO, connect to pin P28

AX1, connect to pin P29

AX2, connect to pin P30

AX3, connect to pin P31

t var word

Top_of_Loop:

adin QQQ, 2, AD_RON, t

DEBUG [ DEC t, 13 ]

GOTO Top_of_Loop

7) Develop a simple linear equation to compute analog voltage measurements from the 10-bit A/D variable in your program.

equation ______

8) What is the minimum quantifiable voltage difference corresponding to one bit that your internal A/D could digitize based on your equation?

______

9) Create a second digital voltmeter by continuously displaying the analog voltage reading from your internal A/D on the black plastic LCD box. Demonstrate simultaneous operation of both voltmeters to the TA.

10) Hand in this sheet with questions answered and blanks filled in and demo the lab to the TA. Attach a circuit diagram and a printout of your code.


7447 common anode decoder

The 7447 activates a segment by pulling its output pin to LO, thus providing a path to sink current. Current limiting resistors must be used between the driver chip and the display.

lt: Lamp Test: When lt is pulled low, all of the segments should be lit

bi: Blanking Input: When bi is pulled low, all of the segments should be off

rbi: Ripple Blanking Input: When rbi is low AND all of the data inputs are zero (display 0), then all of the segments are turned off. This allows the blanking of leading zeros for multiple digit displays.

7448 common cathode decoder

The 7448 chip provides HI output lines to light the segments but they cannot source much current. Therefore, external pull-up resistors from all output lines to +5V are required. These resistors limit current to the LED's when on and to the 7448 when off.