cay) refer to the PIC16F1S17 program shown below. Assume any necessary header fi
ID: 2292839 • Letter: C
Question
cay) refer to the PIC16F1S17 program shown below. Assume any necessary header files and compiler directives have been included, and that the microprocessor is running with a 4 MHz clock so that each machine instruction is 1 ? void main) i anselb 0b00000000; anselc 0b00000000; tr?sb 0b00001111; trisc 0b11110000; portb 0 portc-0 while (1) portc portb 2; a) Suppose pin RB0 were tied to SV, and you monitored pin RC0 on the scope. The output would be (a) always high (b) always low (c) a pulse train Suppose pin RBI were grounded, and you monitored pin RC1 on the scope. The output would be (a) always high (b) always low (c)a pulse train do Suppose pin RC7 were tied to 5V, and you monilored pin RB7 on the scope. The output would be (a) always high (b) always low (c) a pulse train The anselb command is used to (a) set Port B pins as digital (b) set Port B pins as outputs (c) set Port B pins as low (d) set Port B pins as offExplanation / Answer
Explanation- portb is assigned to portc and portb+2 in next statement. But RB0 is tied to 5V, and hence same RB0 will be assigned to portc RC0 pin.
2. Suppose pin RB1 were grounded and you monitored pin RC1 on the scope. The output would be
(c) a pulse train
Explanation – first statement in while loop will assign RC1 = 0 and second statement will cause RC1 = 1 as portb +2 will cause RB1 = 1
3. Suppose RC7 were tied to 5V and you monitored pin RB7 on the scope. The output would be
(b) Always low
Explanation – portb value is assigned on portc. Hence if RC7 is tied to 5V will not cause any impact on RB7 and it will remain at its initial value 0.
4. The anselb command is used to
(a) Set Port B pins as digital
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.