1. Field of the Invention
The present invention relates to a microcomputer including a flash ROM rewritable on a chip by chip basis, a boot ROM storing a boot program, and a RAM, and particularly to a microcomputer that transfers, by using the boot program, a program from an outside source to the RAM, and rewrites the flash ROM using that program.
2. Description of Related Art
In a common microcomputer, interrupt vectors usable by a user are set in a memory area opened to the user (which is called "user open area" from now on). Accordingly, an interrupt taking place during execution of a user's program is treated by an interrupt handler the user prepared in the user open area. Thus, the user program generally forms a closed system on the microcomputer.
Consider under such a condition a case in which an erase/write program (referred to as "E/W program" from now on), which is prepared by a user for rewriting data in a flash ROM by a CPU, is transferred from an outside source to a RAM using a boot program a maker created and stored in a boot ROM.
In this case, all interrupt vectors are present on the boot ROM including a boot program to be initially activated, and the boot program itself requires interrupt processing which is also included in the boot program. Thus, the E/W program transferred from the outside source to the RAM cannot handle the interrupt. Even if it could handle the interrupt, it can execute only the interrupt handler the maker created, which restricts the user in creating the E/W program.
Furthermore, even if the microcomputer has a function to move the entire interrupt vectors to the RAM by carrying out a mode switching using some means so that the E/W program can achieve the interrupt processing after it has been transferred to the RAM, the mode switching must be carried out again to restart the boot program if it is required to run the boot program due to an error or the like occurring during the execution of the E/W program. Thus, it is probable that the mode must be switched a number of times during debugging of the E/W program.
Matters relevant to such a conventional microcomputer are disclosed in Japanese patent application laid-open Nos. 4-205047/1992, 2-114293/1990 and 2-66664/1990 among others. The first document '047 discloses a technique applied to a multi-processor system, in which a main processor loads into a dual-port RAM a program and interrupt vectors used by a sub-processor so that the sub-processor executes it. The second document '293 discloses an example in which a download program is downloaded into a common memory including a reset vector area, and the third one '664 discloses an example that prepares a register for holding an initial program and interrupt address. However, they do not refer to the E/W program of the flash ROM or its equivalent.
In summary, since the conventional microcomputer has a configuration as described above, the E/W program transferred from the outside source to the RAM cannot handle the interrupt. Even if it could handle the interrupt, the user has a problem of being restricted in creating it. In addition, moving the entire interrupt vectors to the RAM after carrying out the mode switching by some means presents another problem in that it is likely that the mode must be changed many times during the debugging of the E/W program.