would require a second write access to the same (word) address - which
is not allowed. As a consequence, a write error ("not erased") will be
issued.
To avoid this problem, it is necessary to align all S-Record data
before programming. This can be done using the freely available
Freescale Tool SRECCVT:
SRECCVT -m 0x00000 0xfffff 32 -o <outfile> <infile>
A detailed description of this tool is contained in the SRECCVT
Reference Guide (PDF).
Please note, that it is not possible to program or erase the part of
Flash memory that contains the monitor code. Also, the last 16 bytes of
the EEPROM block are reserved for system use.
Redirected Interrupt Vectors
The interrupt vectors of the HCS12 are located at the end of the
64KB memory address range, which falls within the protected monitor
code space. Therefore, the application program can not modify the
interrupt vectors directly. To provide an alternative way, the monitor
redirects all vectors (except the reset vector) to RAM. The procedure is
similar to how the HC11 behaved in Special Bootstrap Mode.
The application program can set the required interrupt vectors
during runtime (before global interrupt enable!) by placing a jump
instruction into the RAM pseudo vector. The following example shows
the steps to utilizy the IRQ interrupt:
ldaa #$06
; JMP opcode to
staa $3FEE
; IRQ pseudo vector
ldd #isrFunc
; ISR address to
std $3FEF
; IRQ pseudo 1
For a C program, the following sequence could be used:
// install IRQ pseudo vector in RAM
// (if running with TwinPEEKs monitor)
*((unsigned char *)0x3fee) = 0x06;
// JMP opcode
*((void (**)(void))0x3fef) = isrFunc;
User Manual
39