Technical information
AN2216/D
CodeWarrior Linker
MOTOROLA MC9S12DP256 Software Development Using Metrowerkâs Codewarrior 15
lower two bits in the security byte in which the part remains unsecured. Figure
15 shows an example linker commant for the placement of the flash security
and protection data.
SECTIONS
/* flash, RAM, EEPROM etc */
FLASH_PROT_AREA = READ_ONLY 0xFF00 TO 0xFF0F;
END
PLACEMENT
/* Placement of code */
FLASH_PROT INTO FLASH_PROT_AREA; /* Placement of Flash Protection Registers */
END
Figure 15. Flash Protection Register Placement
Interrupt Vectors The reset and interrupt vector table for all M68HC12 family devices consists of
a 128 byte memory area that begins at $FF80. Because each vector occupies
two bytes, a total of 64 unique vectors are supported. The MC9S12DP256
implements 58 of the 64 vectors beginning at $FF8C. There are two methods
of creating the address constants for the interrupt vector table. Either the
interrupt vector table can be created manually or the linker can generate the
interrupt vector table automatically.
An example of a manually created vector table for the MC9S12DP256 is shown
in Figure 16. This shows an array of constant pointers to functions within a
segment called VECTORS.
#ifndef NULL
#define NULL 0
#endif
extern void _Startup(); /* startup routine */
extern void CAN0_WakeupISR();
extern void CAN0_ReceiveISR();
extern void CAN0_TransmitISR();
#pragma CONST_SEG VECTORS
void (* const vector_table[])() = {
NULL, /* $FF8C:8D PWM Emergency Shutdown */
NULL, /* $FF8E:8F Port P Interrupt */
NULL, /* $FF90:91 MSCAN 4 transmit */
NULL, /* $FF92:93 MSCAN 4 receive */
NULL, /* $FF94:95 MSCAN 4 errors */
NULL, /* $FF96:97 MSCAN 4 wake- up */
NULL, /* $FF98:99 MSCAN 3 transmit */
NULL, /* $FF9A:9B MSCAN 3 receive */