ANSFB - E C E 4 1 7 5 B F in a l 1 2 -8 -0 9 N IN E P R O B...

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

View Full Document Right Arrow Icon
ECE 4175B Final 12-8-09 Page 1 of 4 High 100 NINE PROBLEMS Upper quarter 85 Open book, open notes Median 75 Lower quarter 59 Low 35 1. [ ] I have completed the CIOS course evaluation. [5%] [ ] I have not completed the CIOS course evaluation. 2. Board by powering it up, carrying out an ADC conversion, powering it down and then reading the ADRESH [10%] register and displayed the result between 000 and 255. When you did this, you might have occasionally seen some jitter of the value on the display as the pot sat at an angular position right on the threshold between two values (e.g., 119 and 120). a. Using a global unsigned char variable called ADC, show the code to update the output, ADC, as follows: If ADRESH > ADC+1, then ADC = ADRESH ! 1 Alternatively, if ADRESH < ADC ! 1, then ADC = ADRESH+1 Otherwise don’t change ADC if (ADRESH > ADC+1){ ADC = ADRESH-1; } else if (ADRESH < ADC-1){ ADC = ADRESH+1; } b. Consider what this algorithm does as ADRESH vascillates around 119/120. Do this by writing the value of ADC beneath each value of ADRESH below ADRESH = 119 , 119 , 120 , 121 , 120 , 120 , 119 , 118 , 120 , 119 , 120,. . ADC = 119 119 119 120 120 120 120 119 119 119 119 c. Does this algorithm produce an ADC output that tracks ADRESH within one count? [ x ] Yes [ ] No d. Does the output, ADC, change at all if the input vascillates between only two adjacent values (like 119 and 120)? [ ] Yes [ x ] No 3. transducer into the sixteen-bit analog-to-digital converter register, ADRES (ranging from 0 to 1023). [15%] Each increment of ADRES corresponds to 0.1°F and a value of ADRES = 0x0000 corresponds to 000.0°F. Write a Temperature function to form LCDSTRING[] and then to display 99 DDD.D°F on the starburst display, where 9 represents a blank character that has already been initialized into the string. Use the ASCII4 function of page 81 to break out the digits and the Display function of page 68 to update the LCD. Void Temperature(){ BIGNUM = ADRES; ASCII4(); LCDSTRING[2] = THOUSANDS; LCDSTRING[3] = HUNDREDS; LCDSTRING[4] = TENS; LCDSTRING[6] = ONES; /* The following lines might be loaded once only, initially LCDSTRING[0] = ' '; LCDSTRING[1] = ' '; LCDSTRING[5] = '.'; LCDSTRING[7] = '?'; // Produce a degree symbol (see Figure 5-4b) LCDSTRING[8] = 'F'; */ Display(); } 4.a. Write a PBpressed function that will return a value of 1 if the pushbutton associated with the RPG on your [15%]
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/08/2011 for the course ECE 4175 taught by Professor Peatman during the Fall '08 term at Georgia Institute of Technology.

Page1 / 4

ANSFB - E C E 4 1 7 5 B F in a l 1 2 -8 -0 9 N IN E P R O B...

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

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