lab three

lab three - UNIVERSITY OF CONNECTICUT ECE 3411:...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
UNIVERSITY OF CONNECTICUT Fall 2011 ECE 3411: Microprocessor Application Laboratory Lab 3 - Sep. 26 th , 2011, Due Oct 3 lab. 1 Lab 3: AVR Analog-to-Digital Conversion 1. Objectives Understand the steps to perform ADCs with the ATmega644. Program the ATmega644 to perform ADC in different modes. Design systems using the interacting features of the serial communication interface and the ADC system. 2. Important formulas Single-ended conversion: Differential channels are used: 3. Associated registers:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
UNIVERSITY OF CONNECTICUT Fall 2011 ECE 3411: Microprocessor Application Laboratory Lab 3 - Sep. 26 th , 2011, Due Oct 3 lab. 2 4. Sample code Initialize ADC and read ADC. //************************************************************************* //InitADC: initialize analog-to-digital converter //************************************************************************* void InitADC( void) { ADMUX = 0; //Select channel 0 ADCSRA = 0xC3; //Enable ADC & start 1st dummy conversion //Set ADC module prescalar to 8 //critical for accurate ADC results // this is equivalent to ADCSRA = (1<<ADEN) | //(1<<ADSC)|(3<<ADPS0) while (!(ADCSRA & 0x10)); //Check if conversation is ready ADCSRA |= 0x10; //Clear conv rdy flag - set the bit } //************************************************************************* //ReadADC: read analog voltage from analog-to-digital converter - the
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/21/2011 for the course ECE 3411 taught by Professor Park during the Fall '11 term at UConn.

Page1 / 3

lab three - UNIVERSITY OF CONNECTICUT ECE 3411:...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online