Abstract:
A microcomputer which is desired to be small and lightweight comprises an EPROM for storing an operation program for the microcomputer, a selection circuit which opens a gate connected to the ERPOM through the input of an address allocated to the EPROM, and another selection circuit which opens a gate connected to a circuit for storing a fixed value through the input of another address, thus eliminating a verification error which often occurs at the time of writing a program into the EPROM.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a microcomputer having a rewritable involatile memory. 
     2. Description of the Prior Art 
     FIG. 3 shows the configurations of a microcomputer having a conventional EPROM (erasable programmable read-only memory), a rewritable involatile memory and its peripherals. In the figure, numeral 1 is a central processing unit (CPU), 2 internal bus, 3 RAM for storing data, 4 ROM, 5 EPROM, 6c buffer gate, 7 control line, 8 output bus and 9 microcomputer. The microcomputer 9 is connected to a programmer 11 and a host computer 12 via an external bus 10 for initialization. The programmer 11 comprises a RAM 13 which consists of a program area 14 for storing data and an unused empty area 15 having no data. 
     The EPROM 5 stores an operation program for the CPU 1 and the RAM 3 retains data in process of operation. The programmer 11 is used to write programs into the EPROM 5 and the programs are supplied from the host computer 12 as occasion demands. When the capacity of the RAM 13 of programmer 11 is 32 K bytes, for instance, the capacity of the EPROM 5 is 16 K bytes. Generally speaking, the RAM 13 is two times or more the capacity of the EPROM 5. This is because the built-in EPROM 5 is molded as small as possible in order to reduce the size and weight of the microcomputer 9. 
     The programmer 11 stores created programs (or programs supplied from the host computer 12) in the internal RAM 13 and write them into the EPROM 5 of the microcomputer 9. 
     A blank check is first made on the EPROM 5 as a preliminary step toward the processing of this writing. Then, actual writing is carried out. Finally, a verification check is made to see whether programs are written into EPROM 5 or not. Before writing, the contents of the EPROM 5 are &#34;FF&#34;, which is verified by the blank check. The contents of the EPROM 5 before writing and after old programs are erased are always &#34;FF&#34;. 
     The EPROM 5, an involatile memory, generally changes its internal memory data from &#34;1&#34; to &#34;0&#34; for writing, but cannot change from &#34;0&#34; to &#34;1&#34;. &#34;FF&#34; of the EPROM 5 means that all area bit data are set (blank=possible to write). 
     After the blank check, the programmer 11 writes program data stored in the RAM 13 into the EPROM 5, At this time, an address must be set so as to write data stored in the program area 14 of the RAM 13 into the EPROM 5. 
     After all data stored in the program area 14 are written into the EPROM 5, a verification check is made to see if data within the program area 14 coincide with data within the EPROM 5. When they do not coincide with each other, an error occurs, and accordingly, a fail stop is given to the microcomputer. 
     In the example of FIG. 3, data are written into the EPROM 5 in 256 mode by the programmer 11 with a memory capacity of 32 K bytes, two times that of the RAM. 
     In the address area of this programmer 11, program data within the program area 14 with an address of OH to 3FFFH are set so as to write the data into the EPROM 5 for a verification check. 
     The conventional microcomputer 9 has such a drawback that when the programmer 11 might read the empty area 15 of the RAM 13 and compare the read data with the contents of the EPROM 5 at the time of a verification check before writing data into the EPROM 5, the two data do not coincide with each other and the output of microcomputer becomes unstable, resulting in a fail stop. 
     That is, the contents of the empty area 15 of the RAM 13 are all &#34;FF&#34;, while the contents of the EPROM 5 are program data and not always &#34;FF&#34;. Accordingly, these two data sometimes do not coincide with each other, thus causing an error. 
     To prevent area setting errors, it is always necessary to set the programmer 11 so that writing processing (blank check, writing and verification check) is conducted only for the program area 14 of the RAM 13. The specification of the program area (part) of the RAM 13 requires an extra program, which has been difficult for the microcomputer 9 because of size limitations. 
     SUMMARY OF THE INVENTION 
     It is therefore an object of the invention to eliminate the need for the programmer 11 to set a specific partial area of the RAM 13, simplify the writing processing of the RAM 13 into the small-capacity EPROM 5, and enable users to identify the contents of programs very easily. 
     According to the invention, the microcomputer 9 comprises a recording area selection circuit which outputs a detection signal through the input of an address allocated to the built-in EPROM 5, and an empty area selection circuit which outputs the other detection signal through the input of other addresses. 
     The above and other objects, features, and advantages of the invention will become more apparent from the following description when taken in conjunction with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 a conceptional diagram of a microcomputer and its peripherals according to an embodiment of the invention, 
     FIG. 2 is a diagram showing an example of an area selection circuit, and 
     FIG. 3 is a conceptional diagram of a conventional microcomputer and its peripherals. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     The invention will be described in detail, referring to FIG. 1. 
     In FIG. 1, numeral 1 is a central processing unit (CPU), 2 internal bus, 3 RAM for storing data, 4 ROM, 5 EPROM, 6a and 6b are buffer gates, 7a and 7b control lines, 8 output bus, 9 microcomputer, 16 address information line, 17a empty area selection circuit which outputs a signal to turn on the buffer gate 6a upon the reading of the address of the empty area, and 17b recording area selection circuit which outputs a signal to turn on the buffer gate 6b upon the reading of an address allocated to the EPROM area (program area). Numeral 18 is an &#34;FF&#34; output circuit which outputs data &#34;FF&#34; to the bus when 6a is turned on. Numeral 10 indicates an external bus, 11 programmer, 12 host computer 13 RAM within the programmer 11, 14 program area and 15 empty area. 
     The capacity of the EPROM 5 is generally made as small as possible to reduce the size and weight of the microcomputer 9. In this case, the external programmer 11 which writes programs into this EPROM 5 is not subject to size limitations, and accordingly, its RAM 13 has a relatively large capacity. Therefore, addresses allocated to the RAM 13 consist of addresses allocated to the small capacity EPROM 5 and the addresses of wide areas. The recording area selection circuit 17b outputs a detection signal through the input of an address allocated to the EPROM 5, while the empty area selection circuit 17a outputs the other detection signal through the input of other addresses. The same address allocated to the EPROM 5 is allocated to part of the memory area of the RAM 13 of the programmer 11. In this embodiment, lower addresses of 0000H to 3FFFH are allocated to the EPROM 5 and the RAM 13 has the same address area as the EPROM. An area with an address from 0000H to 3FFFH within the RAM 13 is the recording (program) area 14. 
     The operation of the microcomputer will be described next. 
     For the writing processing into the EPROM 5, a blank check is made on the EPROM 5 and actual writing is conducted. Finally, a verification check is made to see if data are written properly. The purpose of the verification check is to see if programs in the program area 14 within the RAM 13 of the programmer 11 are transferred to the EPROM 5 accurately. The CPU 1 is used to check if the contents of the program area and the EPROM 5 coincide with each other. When the CPU 1 reads data in the program area 14 within the RAM 13 of the programmer 11, the address signal is given to the selection circuits 17a and 17b via the address information line 16. 
     The recording area selection circuit 17b outputs a control signal via the control line 7b to turn on the buffer gate 6b. Then, a program stored in the ERPOM 5 is read and compared with the contents of the program area 14 of the programmer 11. Unless a special error occurs, these values coincide with each other and a verification check is completed with the output of a stable signal. 
     When the CPU 1 reads the empty area 15 within the RAM 13 of the programmer 11, this address signal is also given to the selection circuits 17a and 17b via the address information line 16. Then, the empty area selection circuit 17a outputs a control signal via the control line 7a to turn on the buffer gate 6a. &#34;FF&#34;, the contents of the &#34;FF&#34; output circuit 18 is read and compared with the value of the empty area 15 within the programmer 11. Since the contents of empty area 15 are all &#34;FF&#34;, these values coincide with each other and a verification check is completed with the output of a stable signal. 
     In this manner, in case that the capacity of the RAM 13 of the programmer 11 is larger than that of the ERPOM 5, a fail stop does not occur and a program is written into the EPROM 5 stably. Therefore, there is no need to specify the program area 14 within the RAM 13 and to provide an extra program and an additional circuit for the specification. 
     The empty area selection circuit 17a and the recording area selection circuit 17b are such that they can output an signal to identify the both areas. For instance, as shown in FIG. 2, a partial NOR circuit may constitute the empty area selection circuit 17a, while a three-input NOR circuit may constitute the recording area selection circuit 17b, and address signals A 14 to A00 may be given to the address information line 16 so as to identify the both areas with chip enable CE and output enable OE. As for the &#34;FF&#34; output circuit, a circuit having the above function other than the circuit of this embodiment obtains the effects of the invention. In place of the ERPOM, other involatile memories may be used. A three-state buffer gate can be used as a buffer gate. 
     According to the invention, when a programmer without an exclusive writing mode is used to read an empty area for the processing of writing, &#34;FF&#34; is output. This eliminates the occurrence of a verification error and simplifies writing processing. In case that the capacity of a memory built into a microcomputer is smaller than that of a programmer, there is no need to specify a program area for a programmer.