Homework!!!!

This homework is equivalent to a programming assignment. It is worth 100 points. Please work on it alone. NEATNESS and READABILITY count; actually for 40% of your grade.

You will need to watch the PIC training video linked to off of the class web page. Specifically, you will need to view video 2: PICmicro x14 Instruction Set. You will also need to refer to the technical reference manual for the chip.


1) According to the video, how many instructions are there for the x14 chip ?

2) How many bits are there for the opcode for
    a) byte oriented instructions
    b) bit oriented instructions
    c) for the CALL and GOTO instructions

3) How does the chip decode the opcode for a given instruction ? That is, given an instruction, how does the chip figure out if it is a byte oriented, bit oriented, literal or goto/call instruction ? You'll need to refer to the technical reference manual.

4) For byte oriented instructions, what's the difference between specifying a 'w' or 'f' after the operand?

5) What happens if you don't specify a 'w' or 'f' after the operand in a byte oriented instruction ?

6) The 2K range for goto/call instructions is too restrictive. I wish to design to a chip using the x14 instruction set and architecture that can handle bigger programs (for example, up to 8K). Is this possible ? Explain your answer.

7) What flags exist in the 16F628 ? Where are they located ?

8) What is the DC flag used for? Please don't quote the reference manual (0 points); given me a practical application (this will take some thought or research).

9) What is the difference between RETURN and RETLW ?

10) I have written three subroutines: doThis, doThat, doTheOther. I want to call doThis if PORTB pin 3 is set,  otherwise call doThat. I want to cal doTheOther in either case. Write the code fragment to accomplish this.

11) What is a Watch Dog Timer ?

12) What breed is the Watch Dog for the Watch Dog Timer ?

13) PORTA and PORTB each have 8 pins. NOT all of these pins perform I/O . Which ones do not ? What are these pins functions ?

14) You have beem instructed to include the following lines in all your programs:

    movlw    0x07
    movwf    CMCON            ;turn comparators off (make it like a 16F84)
   
Why should you include these lines ? What is a comparator ?