Task 3b -- Multitasking exercise

Task 3b has four stages


Other tasks to do after completing Task 3b

  1. Task 3c -- Pretend that your interrupt service routine is "time critical". Using the user manual, determine how long the interrupt instructions take to execute. Don't forget to include the interrupt"overhead" -- the time for the processor to actually enter and leave the routine. This would include the time for things such as stack operations during the "return-from-interrupt" instruction.

    If you increase the rate at which the timer interrupt occurs, you will reach a rate where as fast as you service one interrupt service routine then another interrupt occurs. In real life, the time between interrupts should be close to your calculated time for Task 3c. Try comparing the expected theoretical time with the actual time measured on the simulator under the following circumstances

    1. The ISR simply writes to 10 "normal" memory locations -- say in the range 0x7800 -- 0x7900
    2. The ISR simply writes to 10 "virtual device" register locations.

    Note that the SDS simulator "timer" does not count processor clock cycles. Instead it counts instructions executed.

  2. Task 3d -- Task 3b is rather irrelevant, why would you sort numbers when making coffee! Modify the array so so that it sorts the different names of coffee placed in an an array of string variables into alphabetical order (Ha! Ha!).
  3. Task 3e -- A real multi-tasking job would be to run the COFFEEPOT, model TRAIN and the JUMBO-TRON TV virtual devices all as simultaneous ISRs. Yes it is possible if you treat the ISR using the ROUND ROBIN approach discussed in the "Full Companion or in any good operating system book. You might also like to look up Jean Labrosse's book "uC/OS" (microC -- Operating System) which discusses operating systems with a mixed assembly language and "C" approach.

Have fun!

 



Last modified: July 22, 1996 01:48 PM by M. Smith.
Copyright -- M. R. Smith