Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTON1 If 3.6V applied to input channel, which one is correct? A-)ADC10MEM will be equal to old_value B-)P1.0 will be HIGH C-)P1.6 will be LOW

image text in transcribed

QUESTON1

If 3.6V applied to input channel, which one is correct?

A-)ADC10MEM will be equal to "old_value"

B-)P1.0 will be HIGH

C-)P1.6 will be LOW

D-)"old_value" variable will not be updated

-----------------------------------------------------------------------

QUESTION 2

The state of the output pins won't change if input voltage level stays between

A. -/+ 10 mV of the previous voltage

B. is smaller than 1.8V

C. is larger than 1.8V

D. -/+ 35 mV of the previous voltage

Code Analysis - "ADC" 23 1 #include 16 #pragma vector = ADC10_VECTOR 2 volatile unsigned long old_value = 512; 17 _interrupt void compare(void) 3 int main(void) 18 19 if (ADC10MEM > (old_value + 10) 5 WDTCTL = WDTPW + WDTHOLD; 20 { 6 ADC1OCTLO = ADC10SHT_2 + ADC100N + ADC10IE; 21 P10UT - BIT6; 7 ADC1ECTL1 - INCH_1 + ADC18DIV_7; 22 PLOUT & -BITO; 8 ADC10AE - BITI; } 24 else if (ADC1OMEM 10 PIDIR |- BITO BIT6; 25 { 11 P1OUT &= m(BITO BIT6); 26 P10UT & BIT6; 12 27 P1OUT |- BITO; 13 ADC10CTLO I = ENC + ADC1OSC; 28 } 14 _BIS_SR(CPUOFF + GIE); if ((ADC10MEM > 10) & (ADC10MEM 15 ) 30 old_value = ADC1EMEM; ADC1OCTLO |= ADC18SC; 33} (old_value) 29 31 32 Code Analysis - "ADC" 23 1 #include 16 #pragma vector = ADC10_VECTOR 2 volatile unsigned long old_value = 512; 17 _interrupt void compare(void) 3 int main(void) 18 19 if (ADC10MEM > (old_value + 10) 5 WDTCTL = WDTPW + WDTHOLD; 20 { 6 ADC1OCTLO = ADC10SHT_2 + ADC100N + ADC10IE; 21 P10UT - BIT6; 7 ADC1ECTL1 - INCH_1 + ADC18DIV_7; 22 PLOUT & -BITO; 8 ADC10AE - BITI; } 24 else if (ADC1OMEM 10 PIDIR |- BITO BIT6; 25 { 11 P1OUT &= m(BITO BIT6); 26 P10UT & BIT6; 12 27 P1OUT |- BITO; 13 ADC10CTLO I = ENC + ADC1OSC; 28 } 14 _BIS_SR(CPUOFF + GIE); if ((ADC10MEM > 10) & (ADC10MEM 15 ) 30 old_value = ADC1EMEM; ADC1OCTLO |= ADC18SC; 33} (old_value) 29 31 32

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago