EE 308 -- LAB 05
Simple Timer Interrupts

Start with the following program, which is just a do-nothing infinite loop:

             #include <hc11.h>  

             #define TRUE 1

             main()
             {
                 DDRC = 0xff;       /* Make all bits of Port C output */
                 while (TRUE) { }
             }

  1. Add a Timer Overflow Interrupt service routine to increment Port B. Test your program on the simulator. Note the following points:
    1. How long does it take Port B to overflow on the simulator? The EVBU has a 2 MHz clock. What is the approximate `clock rate' on the simulator?
    2. What happens when you fail to clear the TOF flag as part of your TOF interrupt service routine? Check your conjecture by commenting this line out and running on the simulator.

  2. Add a Real Time Interrupt to increment Port C. Set the RTI interrupt period to 8.19 ms. Observe the operation of this program on the simulator. About how long will it take this program to overflow Port C on the EVBU?

  3. Test your TOI and RTI program on the EVBU. Do the Port B and Port C overflow times agree with your predictions?



Bill Rison, <rison@ee.nmt.edu >
Thu Feb 15 1996
© 1996, New Mexico Tech