EE 308 - Homework 6
Due February 28, 2001

For the homework problems which follow assume you have included the file hc12.h in your C program. Thus, you can refer to PORTB when you want to access a byte at address 0x0001. Where I ask for some code just write that part of a C program which will do the task. Where I ask for a program write a complete program, include the #include "hc12.h" line, the declaration of variables, the main() function, etc.

  1. Write some assembly code which will enable the timer subsystem, set the timer overflow rate to 65.536 ms, and enable the timer overflow interrupt.

  2. Write some C code which will enable the timer subsystem, set the timer overflow rate to 65.536 ms, and enable the timer overflow interrupt.

  3. An HC12 has the following in its memory:
    0 1 2 3 4 5 6 7 8 9 A B C D E F
    FFC0 CC 05 9F CD 99 03 84 9C 01 9B CC 90 66 FC 93 30
    FFD0 7E E3 4B 7E E5 38 21 54 05 83 09 34 2A 38 3C 03
    FFE0 41 38 66 F2 7C 13 37 0C 25 F2 0C 38 5F 1B 42 1A
    FFF0 7A 26 21 13 6A AA 20 1F 4B 38 33 38 45 38 10 20


    1. What happens to the program counter when the HC12 is powered up or reset? What is the address of the first instruction the HC12 will execute after a reset?

    2. What is the address of the first instruction the HC12 will execute when it receives a Timer Overflow interrupt?

    3. What is the address of the first instruction the HC12 will execute when it receives a SPI interrupt?

    4. What is the address of the first instruction the HC12 will execute when it receives a Real Time interrupt?


  4. Write an assembly language program to implement Lab 6.



Bill Rison
2001-02-23