


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A lab exercise where students build an analog-to-digital (a/d) converter circuit using an avr microcontroller (mcu) and a potentiometer. The goal is to read the digital value of the voltage input from the potentiometer and display the raw value and percentage. Background information on potentiometers, the stk500 development board, and the a/d converter. Students are required to read pre-lab materials, construct the circuit, write a c-routine, and test the circuit. The document also includes pre-lab questions and a parts list.
Typology: Study notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!



This circuit connects a variable voltage to an A/D port on the AVR mcu. Your software running on the AVR mcu will read the digital value and display the percent and raw value of the voltage, VA.
The interface consists of some analog circuitry as well as wiring the analog circuit to the STK500 and running corresponding software on the AVR mcu. Each circuit requires a unique C-routine.
Circuit 2 Input to an A/D Converter via the STK500 (ATmeg16 and AT90S8535 have the same pin layout)
Voltage is measured at the output of the Potentiometer Va. VTG and GND can be obtained from numerous places on the STK 500 board.
Background
A potentiometer can set a variable that is processed and used by the microprocessor. Typical applications include having the potentiometer represent a volume or level of ambient light, although a potentiometer can set just about any reference signal.
There are two basic styles of potentiometers: audio and linear. Audio potentiometers vary logarithmically as the sense of hearing is logarithmic. Recall, the definition of
The potentiometer in Circuit 2 is part of an external circuit that provides an input signal to the STK500. The STK500 development board can house most of the ATMEL RISC processors. There are several sockets on the STK500 for different members of the AVR family of processors, depending on the particular pin-out of the microcontroller. The ATmega16 has an eight channel A/D converter and it resides in socket 3100A5 on the STK 500.
The STK500 provides several variable voltage sources, such as VTG and Aref. Developers can use AVR Studio to set these voltage values without having to wire
external circuitry. The STK500 also allows external voltage references. VTG stands for VTARGET and can be used to power “target” circuits. VTG delivers up to 0.5A. Notice that all of the I/O port sockets have VTG and GND pins.
A program running on the microcontroller uses the A/D converter to sample and derive a digital value from the A/D port. The signal Aref (analog reference) sets the maximum value of the input voltage to the A/D converter. Without Aref the A/D converter would not “know” how to scale the A/D port’s voltage, VA. Aref is an adjustable voltage reference provided by the STK500 board, although external circuitry can set or define Aref. Regardless of whether Aref is set on-board or through external circuitry its voltage must be less than or equal to VTG.
Pre-Lab Assignments
In-Lab Tasks
Pre-Lab Questions Name: __________________________
After completing the other pre-lab tasks answer these questions. Be sure to include your work and show units, as appropriate, on your answers. 2 points each, 10 points possible.