Homework #3

(Again, these may show up on a quiz !!!)


Wait a second! These look like questions from a previous homework! Yes indeed!!!!

1)   If (Count1==0)
      Then call is_zero
      Else call is_not_zero
      Call   xyz

2)  If (Count1>=Count2)
     Then call Count1_bigger
      Else call Count2_bigger
      Call xyz

3) Polling a pin
    Suppose  pin B0 is set to be an input pin.  It is normally set to zero, but occassionally will go high to 1. When it goes high to 1, we wish to call
    a subroutine called went_high.


    while(true)
    {
       while( pin B0==0);   <---- this is called "polling a pin" . while it is zero, keep checking, when it turns to 1, exit loop
       call went_high;
     }

4) We stated in class that all instructions that don't alter the PC take 1 microsecond to execute, and instructions that do alter the PC
take 2 microseconds. Why is this true ?

5) How many bits is the opcode in a 16F628 instruction ? A visit to the reference manual!! Look at the instruction set reference link
off the class web page.

6) What is a Watch Dog Timer (WDT) ? What breed of dog is the Watch Dog Timer ?