Kai Kin So

Need help in setting interrupt rountine in DG128B

Discussion created by Kai Kin So on Jun 6, 2006
Latest reply on Jun 7, 2006 by CrasyCat
  I am now using MC9S12DG128B with Metrowerks CodeWarrior IDE ver. 5.5
 
  I tried methods mentioned in Help and Books, but I kept gettin Link Error in setting interrupt routines. I had got stuck at this trouble for almost a week. Really hope someone could enlighten me.

The Linker Map P&E_ICD.map is originally:
*********************************************************************************************
SECTION-ALLOCATION SECTION
Section Name                    Size  Type     From       To       Segment
---------------------------------------------------------------------------------------------
.init                             18     R     0xC000     0xC011   ROM_C000
.startData                        30     R     0xC012     0xC02F   ROM_C000
.(skipped...)
.abs_section_44                    2   N/I       0x44       0x45   .absSeg335
.bss                               6   R/W     0x2000     0x2005   RAM
.stack                             1   R/W     0x3F00     0x3F00   .stackSeg
  When I wrote in main.c
void interrupt 22 ATD_isr(void) {
}

  , I got Link Error.
Link Error: L1907: Fixup overflow in _Vector_22, to ATD_isr type 1, at offset 0x0
  And Linker map becomes:
.abs_section_44                    2   N/I       0x44       0x45   .absSeg335
.abs_section_ffd2                  2     R     0xFFD2     0xFFD3   .absSeg336
.stack                             1   R/W     0x3F00     0x3F00   .stackSeg
.vectSeg337_vect                   2     R     0xFFFE     0xFFFF   .vectSeg337
  When I wrote in main.c
#pragma TRAP_PROC
void _ATD_complete(void);

  , and in P&E_ICD_linker.prm bottom
VECTOR ADDRESS 0xFFD2 _ATD_complete (or VECTOR 22 _ATD_complete)
  , I also got Link Error.
Link Error: L1108: Initializing of Vector _ATD_complete failed because of over- or underflow of vector value
  And Linker map becomes:
.abs_section_44                    2   N/I       0x44       0x45   .absSeg335
.bss                               6   R/W     0x2000     0x2005   RAM
.stack                             1   R/W     0x3F00     0x3F00   .stackSeg
.vectSeg336_vect                   2     R     0xFFD2     0xFFD3   .vectSeg336
.vectSeg337_vect                   2     R     0xFFFE     0xFFFF   .vectSeg337
.(skipped...)
*********************************************************************************************
VECTOR-ALLOCATION SECTION
    Address     InitValue   InitFunction
---------------------------------------------------------------------------------------------
     0xFFD2      0x38800C   _ATD_complete
     0xFFFE        0xC000   _Startup
...

  Could anyone tell me how can I solve the problem? Many thanks.

Outcomes