Erik Lee

RTI problem - mc9s12dt256b

Discussion created by Erik Lee on Dec 18, 2007
Latest reply on Dec 21, 2007 by Jim Donelson
I am trying to setup a basic interrupt.  I have it working successfully using processor expert but am having issues setting it up myself.  I believe the problem is with the vector addressing, which is a bit unclear to me.  Using processor expert I see that the vector address is set to 0xFFF0, but when I try this with my program it will not compile.  I have posted the code below.  Any tips or code examples showing how to using vector addressing would help.  Thanks in advance.

#include <hidef.h>      /* common defines and macros */
#include <mc9s12dt256.h>     /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12dt256b"

VECTOR ADDRESS 0xFFF0 MY_Int; 

#pragma TRAP_PROC
void 0xFFF0 MY_Int(void){
  CRGFLG = 128;
    DDRB=0xF0; //sets to output
    if (PORTB == 0x10){
      PORTB = 0;
    }else{
      PORTB = 0x10;
    }
}


void main(void) {
  /* put your own code here */
 
  RTICTL=63;
  CRGFLG=128;
  CRGINT=128;
  //INTCR=191;
  EnableInterrupts;
  for(;:smileywink:{
  }
 
 
                      /* Enable interrupt */
  //EnableInterrupts;

  for(;:smileywink: {} /* wait forever */
  /* please make sure that you never leave this function */
}
 
Added p/n to subject.


Message Edited by NLFSJ on 2007-12-18 11:30 AM

Outcomes