458
CHAPTER 22 ROM CORRECTION
<2> Develop an initialization routine in advance such as the one shown in Figure 22-6, so that the program can
be corrected.
Figure 22-6. Initialization Routine
Note
Whether ROM correction is used is determined by the input level of a port. For example, “if the
input level of P20 is high, ROM correction is used; if it is low, ROM correction is not used”.
<3> After reset, store the contents of an external non-volatile memory to the internal extension RAM by using the
user’s initialization routine for ROM correction (refer to
Figure 22-6
).
Also put the first address of the instruction to be corrected in CORAD0 or CORAD1, and set bits 1 and 3
(COREN0 and COREN1) of the correction control register (CORCN) to 1.
<4> Place the whole-address-space branch instruction (BR !addr16) at the specific address (F7FDH) in the
internal extension RAM by using the main program.
<5> After the main program has been started, the comparator in the ROM correction circuit always compares the
value in CORAD0 or CORAD1 with the fetch address value. When the two address values coincide, a
correction branch processing request signal is generated. At the same time, the correction status flags
(CORST0 and CORST1) are set to 1.
<6> Execution branches to address F7FDH by the correction branch processing request signal.
<7> The whole-address-space branch instruction at address F7FDH causes execution to branch to the address
in the internal extension RAM set by the main program.
<8> If only one place is to be corrected, execute the correction program.
If two places must be corrected, check the correction status flag by operation of the branch destination
identification program, and then branch to the correction program.
Initialization
ROM correction used
Note
· Store contents of external non-volatile memory to
internal extension RAM
· Set correction address register (s)
· Enable ROM correction operation
Yes
Main program
ROM correction
No