AnsweredAssumed Answered

How to use timer overflow interrupt

Question asked by Danny Scheres on Sep 26, 2008
Latest reply on Sep 26, 2008 by stanish

Hi I’m new using codewarrior and the HCS12 T-board, onboard is the mc9s12dp512 chip.


I want to use the timer to count 1 millisecond till a overflow occurs. When a overflow occurs I want to use an interrupt to call a sub routine.


Here is a bit of my code. This interrupt implementation doesn’t work. What am I doing wrong?


void SetTimer(void)


  TCNT = 0xE0C0;

  TSCR1 = 0x90;



interrupt 16 void TimerCount(void)


  ms++;            //global variable 


  TCNT = 0xE0C0;



when I built my project I’ll get the following error message.


Link error:    L1907: fixup overflow in _Vector_16, TimerCount type 1, at offset 0x0


Could anyone help me with this problem?


Greetings dan23