PIC LAB-1
Test-5


Page 18
INDEX

Answer the following questions  .   .   .  JavaScript is required!
More questions on programming .  .  .
The best way to learn a topic is with questions. We have proven this. It's similar to reverse learning or reverse engineering and is called Mitchellism. The author has coined this word through a wave of success. You can learn five times faster though mistakes than slowly plodding through the front door. 
These questions and answers produce more thought than lines and pages of text. 
Try them out . . .

1. Drag the correct instructions and place them in the program:  


;Load 6C into W
;Output to PortB
MOVWF 6Ch  MOVLW 6Ch  MOVWF 05  MOVWF 06  MOVF 05  MOVF 06
Mouseover for answer

2. Drag the correct instructions and place them in the program: 


;DECrement file 1A
;GOTO Count if not Zero
DECFSZ 1A,0   DECF 1A,1   GOTO Count2   GOTO Count   DECFSZ 1A,1  
Mouseover for answer

3. Drag the correct instructions and place them in the program: 


;Load W with 1A
;Copy W to file 1A
;Decrement file 1A 
;Copy file 1A to W
   MOVF 1A,1   MOVLW 1A,1   MOVWF 1A   DECF 1A,0  
   MOVF 1A,0   DECF 1A,1   MOVLW 1A   MOVWF 1A,1
Mouseover for answer
4. Drag the correct instruction to the program: 


GOTO Rise
GOTO Fall
;Test bit 10h in file10h
;GOTO Rise if SET
;GOTO Fall if CLEAR
   BTFSS 10h,3   BTFSS 10h,4   BTFSC 10h,10h   BTFSC 10h,3   BTFSC 10h,4 
Mouseover for answer

5. Name the input/output bits for Port B:
Mouseover for answer

6. Name the fault in this routine:
Delay
NOP
DECFSZ 1A
GOTO Delay
RETURN
 
Mouseover for answer

7. Write the instruction to move 44h from W to file 1A?
Mouseover for answer

8. Drag the correct instructions to the program: 


;Test switch
;GOTO Switch if pushed
;Increment file 0C
;Copy 0C to W
   BTFSS 1A,3   BTFSS 6,4   MOVF 0C,0   BTFSC 6,0   GOTO Switch  
   INCF 0Ch,1   MOVF 0C,1   INCF 0Ch,0
Mouseover for answer
9. Write the instructions to make bit 3 of TRIS 06 an INPUT
Mouseover for answer
10. Write the instructions to make bit 3 of Port B  HIGH
Mouseover for answer
11. Describe the main difference between: GOTO Tester and CALL Tester.
Mouseover for answer
12. Drag the correct instructions to the program:


;Detect end of Table
;XOR with file 06
;Test zero bit
;RETURN
;Increment file 12h
   MOVLW 0FFh   RETURN   XORWF 06,0   BTFSC 6,0   BTFSC 03,2  
   INCF 12h,0   MOVF 12h,1   INCF 12h,1
Mouseover for answer
13. Describe, in words, the following instruction:  DECFSZ 1A,1
Mouseover for answer

14.  Write the two instructions to carry out the following:  Put 8E into file 1C 
Mouseover for answer
15. Drag the correct instructions to the program:


;Put 5 into W
;XOR file 0F with W
;Test zero bit
;GOTO Comp
;RETURN
   MOVWL 05   RETURN   BTFSS 03,2   MOVLW 05   BTFSS 03,0  
   GOTO Comp   XORWF 0F,0  
Mouseover for answer
16. Name the lines of input/output Port A:
Mouseover for answer

17. What value will be contained in file 1A after the instruction: BSF 1A,4
Mouseover for answer

18. File 1B holds the value 0000 1100.  After the following instruction:  BSF 1B,6  the file will
         contain:
Mouseover for answer

19. Name the fault in this routine:

BTFSS 05,0
CLRF 1F
GOTO String
BSF 05,0
INCF 1F,1
;Test button"A" (Button is active HIGH)
;Clear file 1F
;Goto String
;Set bit 0
Increment file 1F
Mouseover for answer

20. The TRISB file is loaded with 0011 1011. Name the output line(s) created by this value.
Mouseover for answer

21. Name the lowest in/out line for Port B: 
Mouseover for answer

22.  Write in words the instruction: BCF 06,0
Mouseover for answer

23. Name the highest in/out line for a PIC16F84:
Mouseover for answer

24. Write the "bit set file" instruction for the 8 output lines of Port B for a PIC16F84:
Mouseover for answer
25. What does "bit manipulation" mean?
Mouseover for answer

NEXT