Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the information on the following pages for ADMUX and ADCSRA. complete the

ID: 2082217 • Letter: U

Question

Using the information on the following pages for ADMUX and ADCSRA. complete the five requested parts (labeled 1 to 5) in the following code as marked in the comments. #define F. CPU 4000000 UL int main () {unsigned char x: unsigned int result: AEMUX = ...;//(1) choose channel 3, left adjust, ref = AREF ADCSRA = ...://(2) enable ADC. divide, clock by 32 while (1) {ADCSRA = ...;//(3) make it start conversion. do {x= ADCSRA & ...://(4) detect the end of conversion} while(x==0); result = ADC; result = ........://(5) As in the lab, take only the most//significant 8 bits//and throw the least significant two bits, //the rest of the. code is ommitted.}}

Explanation / Answer

ADMUX = ADMUX & 0x23;

ADCSRA = ADCSRA & 0x85;

ADCSRA = ADCSRA & 0x40;

x = ADCSRA & 0x10;

result = result >> 8;