KR100341424B1 - Microcomputer - Google Patents

Microcomputer Download PDF

Info

Publication number
KR100341424B1
KR100341424B1 KR1019990010376A KR19990010376A KR100341424B1 KR 100341424 B1 KR100341424 B1 KR 100341424B1 KR 1019990010376 A KR1019990010376 A KR 1019990010376A KR 19990010376 A KR19990010376 A KR 19990010376A KR 100341424 B1 KR100341424 B1 KR 100341424B1
Authority
KR
South Korea
Prior art keywords
flash memory
address area
data
rewrite
signal
Prior art date
Application number
KR1019990010376A
Other languages
Korean (ko)
Other versions
KR19990078265A (en
Inventor
와타나베도루
Original Assignee
다카노 야스아키
산요 덴키 가부시키가이샤
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 다카노 야스아키, 산요 덴키 가부시키가이샤 filed Critical 다카노 야스아키
Publication of KR19990078265A publication Critical patent/KR19990078265A/en
Application granted granted Critical
Publication of KR100341424B1 publication Critical patent/KR100341424B1/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/22Safety or protection circuits preventing unauthorised or accidental access to memory cells

Abstract

보호 데이타가 정확한 경우에만, 플래시 메모리의 제2 기억 영역의 재기록 명령에 의한 제1 기억 영역의 프로그램 명령의 재기록을 허가한다. 플래시 메모리(9)의 어드레스 영역 B의 재기록 명령의 해독 결과에 따라 어드레스 영역 A의 프로그램 명령을 재기록할 때, 온보드 신호 OB가 항상 논리값「1」로 된다. 따라서, 보호 데이타를 사용하지 않은 경우에는 보호 데이타 식별 회로(16)가 논리값「0」을 출력함에 따라, 페이지 버퍼(14)가 128 워드의 프로그램 데이타를 기억한 시점에서 제어 신호 WRT가 하강하여 플래시 메모리(9)는 기록 금지 상태로 된다. 따라서, 플래시 메모리(9)는 보호 데이타가 정확한 경우에만 기록 허가 상태로 된다.Only when the protected data is correct, the rewrite of the program command of the first storage area by the rewrite command of the second storage area of the flash memory is permitted. When the program command in the address area A is rewritten in accordance with the result of the decoding of the rewrite command in the address area B of the flash memory 9, the onboard signal OB always becomes the logical value "1". Therefore, when the protection data is not used, as the protection data identification circuit 16 outputs a logic value "0", the control signal WRT falls when the page buffer 14 stores 128 words of program data. The flash memory 9 is in a write inhibit state. Therefore, the flash memory 9 enters the write permission state only when the protected data is correct.

Description

마이크로컴퓨터{MICROCOMPUTER}Microcomputers {MICROCOMPUTER}

본 발명은 데이타의 일괄 또는 부분적인 전기 소거 및 데이타의 기록 판독이 가능한 특성을 갖는 불휘발성 메모리(플래시 메모리)를 내장한 마이크로컴퓨터에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer incorporating a nonvolatile memory (flash memory) having characteristics capable of bulk or partial electric erasing of data and recording and reading of data.

도 9는 플래시 메모리 장치를 나타낸 블럭도로서, 마이크로컴퓨터에 내장되어 기능하는 것이다.9 is a block diagram showing a flash memory device, which is built in and functions in a microcomputer.

도 9에 있어서, 참조 번호(1)는 플래시 메모리이고, 데이타를 일괄 또는 부분적(예를 들면 페이지(128워드) 단위)으로 전기 소거할 수 있고 또한 데이타를 반복하여 기록 및 판독할 수 있는 불휘발성의 특성을 갖는다. 플래시 메모리(1)는 마이크로컴퓨터의 프로그램 메모리로서 기능하고, 어드레스 영역 A의 내부 셀에는 각종 논리 연산을 실행시키기 위한 프로그램 명령이 기억되고, 어드레스 영역 B의 내부 셀에는 어드레스 영역 A의 프로그램 명령을 재기록하기 위한 재기록 명령이기억되어 있다. 플래시 메모리(1)는 통상은 어드레스 영역 A가 지정되고, 어드레스 영역 A의 프로그램 내용을 재기록하기 위한 인터럽트 요구가 발생될 때에만 어드레스 영역 B가 지정되도록 어드레스 영역 A로부터 점프한다. 마이크로컴퓨터는 플래시 메모리(1)의 어드레스 영역 A로부터 판독된 프로그램 명령의 해독 결과에 따라 각종 논리 연산 동작을 실행하고, 한편, 플래시 메모리(1)의 어드레스 영역 B로부터 판독된 재기록 명령의 해독 결과에 따라서, 어드레스 영역 A의 내용의 재기록 동작을 실행한다. 또, 플래시 메모리(1)의 어드레스 영역 A의 재기록 데이타는 마이크로컴퓨터의 내부에 사전 준비하는 방법(마스크 ROM을 별도 설치하여 테이블 데이타로서 기억하는 방법 등), 또는, 마이크로컴퓨터의 외부로부터 공급하는 방법(PROM 기록기로부터 공급하는 방법 등) 중 어느 것이어도 좋다.In Fig. 9, reference numeral 1 denotes a flash memory, which is nonvolatile capable of electrically erasing data in batches or parts (for example, in units of pages 128 words) and repeatedly recording and reading data. Has the characteristics of. The flash memory 1 functions as a program memory of a microcomputer, and program instructions for executing various logical operations are stored in the internal cells of the address area A, and the program commands of the address area A are rewritten in the internal cells of the address area B. It is remembered that the rewrite command to do so. The flash memory 1 normally jumps from the address area A so that the address area A is designated and the address area B is designated only when an interrupt request for rewriting the program contents of the address area A is generated. The microcomputer executes various logical arithmetic operations in accordance with the decoding result of the program command read out from the address area A of the flash memory 1, while the microcomputer performs the decoding result of the rewrite command read out from the address area B of the flash memory 1; Therefore, the rewrite operation of the contents of the address area A is executed. The rewrite data in the address area A of the flash memory 1 is preliminarily prepared in the microcomputer (method of separately installing a mask ROM and stored as table data) or supplied from the outside of the microcomputer. (Method of supplying from a PROM recorder, etc.) may be sufficient.

참조 번호(2)는 어드레스 디코더로서, 플래시 메모리(1)를 어드레스 지정하기 위한 어드레스 데이타를 해독하는 것이다. 참조 번호(3)는 검출 회로로서, 플래시 메모리(1)의 어드레스 영역 A의 프로그램 명령이 사용자의 의사에 반하여 정확하지 않게 재기록되는 문제점을 방지하는 것이다. 상세히 기술하자면, 검출 회로(3)는 복수의 레지스터 (4) 및 디코더(5)를 포함한다. 복수의 레지스터(4)는 플래시 메모리(2)의 어드레스 영역 A의 프로그램 명령(페이지 단위)을 재기록하고자 하는 전 단계에서, 사용자가 미리 준비한 보호 데이타(AAH, 55H 등)를 기억하는 것이다. 디코더(5)는 복수의 레지스터(4)의 값이 사용자가 의도하는 값인지의 여부를 해독하고, 복수의 레지스터(4)의 모든 값이 정확한 경우는 플래시 메모리(1)의 재기록 동작을 허가하고, 복수의 레지스터(4)의 값이 1개라도 잘못되어 있는 경우에는 플래시 메모리(1)의 재기록 동작을 금지하도록 한 논리 구조로 되어 있다. 참조 번호(6)는 페이지 버퍼(스태틱 RAM 등의 휘발성 메모리)로서, 플래시 메모리(1)의 어드레스 영역 A의 프로그램 명령을 1페이지 단위로 재기록하기 위한 128워드의 기억 용량을 갖는다. 페이지 버퍼(6)는 자신을 어드레스 지정하기 위한 인크리멘트 기능을 갖는다. 재기록 데이타는 페이지 버퍼(6)에 일단 기억된 후, 플래시 메모리(1)의 어드레스 영역 A의 지정 페이지에 기록된다.Reference numeral 2 is an address decoder which decodes address data for addressing the flash memory 1. Reference numeral 3 denotes a detection circuit, which prevents the problem that the program command in the address area A of the flash memory 1 is incorrectly rewritten against the user's intention. In detail, the detection circuit 3 comprises a plurality of registers 4 and a decoder 5. The plurality of registers 4 store the protection data (AAH, 55H, etc.) prepared in advance by the user in the previous step of rewriting the program command (page unit) of the address area A of the flash memory 2. The decoder 5 decodes whether or not the values of the plurality of registers 4 are intended by the user, and if all the values of the plurality of registers 4 are correct, permits the rewrite operation of the flash memory 1 and In the case where one value of the plurality of registers 4 is wrong, the logical structure is configured to prohibit the rewrite operation of the flash memory 1. Reference numeral 6 is a page buffer (volatile memory such as a static RAM) and has a storage capacity of 128 words for rewriting the program command in the address area A of the flash memory 1 in units of one page. The page buffer 6 has an increment function for addressing itself. The rewrite data is once stored in the page buffer 6 and then written to the designated page of the address area A of the flash memory 1.

플래시 메모리(1)의 어드레스 영역 A의 프로그램 명령의 재기록 방법은, PROM 기록기를 이용하는 외부 제어 방법, 플래시 메모리(1)의 어드레스 영역 B의 재기록 명령을 이용하는 내부 제어 방법이 생각된다.As a method for rewriting a program command in the address area A of the flash memory 1, an external control method using a PROM writer and an internal control method using a rewrite command in the address area B of the flash memory 1 can be considered.

여기서, 플래시 메모리(1)는 어드레스 영역 A 및 어드레스 영역 B의 내부 셀 외에, 보호 데이타의 필요와 불필요를 판별하기 위한 보호용 셀(7)을 갖고 있다. 보호용 셀(7)은 1비트면 된다. 검출 회로(3)는 보호용 셀(7)의 값에 따라서 제어된다. 즉, 검출 회로(3)는 보호용 셀(7)의 내용이 논리값 「0」(리셋트 상태)일 때, 보호 데이타의 존재의 유무에 상관 없이 플래시 메모리(1)의 어드레스 영역 A의 재기록 동작을 허가하기 위한 신호를 출력한다. 한편, 검출 회로(3)는 보호용 셀(7)의 내용이 논리값 「1」(셋트 상태)일 때, 보호 데이타가 존재하지않은 경우에는 플래시 메모리(1)의 어드레스 영역 A의 재기록 동작을 금지하고, 보호 데이타가 존재하며 또한 정확한 경우에만 플래시 메모리(1)의 어드레스 영역 A의 재기록 동작을 허가한다.Here, in addition to the internal cells of the address area A and the address area B, the flash memory 1 has a protection cell 7 for discriminating the need and the need of the protection data. The protective cell 7 may be 1 bit. The detection circuit 3 is controlled in accordance with the value of the protective cell 7. That is, the detection circuit 3 rewrites the address area A of the flash memory 1 regardless of the presence or absence of protected data when the content of the protective cell 7 is a logic value "0" (reset state). Outputs a signal to allow. On the other hand, the detection circuit 3 prohibits the rewrite operation of the address area A of the flash memory 1 when the protection data does not exist when the content of the protective cell 7 is a logic value "1" (set state). The rewrite operation of the address area A of the flash memory 1 is allowed only when the protected data exists and is correct.

전자의 PROM 기록기를 이용하는 외부 제어 방법의 경우, 마이크로컴퓨터의동작을 정지시킨 상태에서, 보호용 셀(7)에 논리값 「0」 또는 논리값 「1」을 기억하고, 보호 데이타의 필요와 불필요를 선택할 수 있도록 되어 있다. 예를 들면, PROM 기록기는 고정의 보호 데이타를 미리 준비해 두고, PROM 기록기가 다른 2개의 마이크로컴퓨터에 대해 상기 보호 데이타를 공급하면, 어느 한쪽의 마이크로컴퓨터밖에 상기 보호 데이타를 인식할 수 없는 경우가 있다. 그래서, PROM 기록기 및 각종 마이크로컴퓨터 사이에서 항상 호환성을 갖게 하고 싶은 경우에는, 보호용 셀(7)에 논리값 「0」을 기억시키면 된다. 이에 따라, 검출 회로(3)는 보호 데이타의 존재 및 상태에 상관 없이 플래시 메모리(1)의 어드레스 영역 A의 재기록 동작을 허가한다. 즉, 상기 호환성이 보호 데이타의 필요와 불필요를 선택할 수 있도록 한 주 요인이다. PROM 기록기는 플래시 메모리(1)의 어드레스 영역 A 중, 재기록 대상이 되는 128워드의 프로그램 명령을 페이지 버퍼(6)에 공급하고, 그 후, 플래시 메모리(1)의 어드레스 영역 A의 재기록 대상으로 되어 있는 페이지 단위의 어드레스 데이타를 어드레스 디코더(2)로 순차 공급한다. 따라서, 플래시 메모리(1)의 어드레스 영역 A의 지정 페이지에 페이지 버퍼(6)의 내용이 기록되어 재기록 동작이 종료한다.In the case of the external control method using the former PROM recorder, the logic value "0" or the logic value "1" is stored in the protective cell 7 in a state where the operation of the microcomputer is stopped. You can choose. For example, when the PROM recorder prepares fixed protected data in advance, and the PROM recorder supplies the protected data to two different microcomputers, only one of the microcomputers may recognize the protected data. . Therefore, when it is desired to always make compatibility between the PROM recorder and various microcomputers, the logical value "0" may be stored in the protective cell 7. Accordingly, the detection circuit 3 permits the rewrite operation of the address area A of the flash memory 1 regardless of the presence and state of the protected data. In other words, the compatibility is the main factor that allows the selection of the need and need of the protected data. The PROM writer supplies the page buffer 6 with a 128-word program command to be rewritten among the address areas A of the flash memory 1, and then becomes a rewrite target of the address area A of the flash memory 1. Address data in units of pages is sequentially supplied to the address decoder 2. Therefore, the contents of the page buffer 6 are written to the designated page of the address area A of the flash memory 1, and the rewrite operation is completed.

후자의 플래시 메모리(1)의 어드레스 영역 B의 재기록 명령을 이용하는 내부제어 방법의 경우, 종래에는 보호용 셀(7)의 내용을 제어할 수 없었다. 상세히 기술하자면, 플래시 메모리(1)의 어드레스 영역 A의 재기록은 보호용 셀(7)의 초기 상태(통상은 리셋트 상태) 또는 PROM 기록기를 이용하여 외부 제어를 행한 후의 보호용 셀(7)의 상태 중 어느 한쪽에 의존하고 있었다. 후자의 내부 제어 방법의 경우, 다른 마이크로컴퓨터와 호환성을 갖을 필요가 없기 때문에, 오기록 방지용의 보호 데이타를 사용하는 것이 바람직하다. 그러나, 사용자의 의사에 반하여, 보호용 셀(7)에 논리값「0」이 기억되어 있으면, 재기록 명령의 해독 결과에 따라서 재기록 동작을 실행할 때, 프로그램 처리의 폭주에 따라 보호 데이타가 잘못된 상태로 레지스터(4)에 셋트된 경우라도, 어드레스 영역 A의 프로그램 명령의 재기록을 실행하여, 이에 따라, 어드레스 영역 A의 프로그램 명령을 정확하게 재기록할 수 없게 되는 문제가 있었다.In the case of the internal control method using the rewrite command in the address area B of the latter flash memory 1, the contents of the protective cell 7 cannot be controlled conventionally. In detail, the rewriting of the address area A of the flash memory 1 is performed either in the initial state of the protective cell 7 (usually in the reset state) or in the state of the protective cell 7 after external control is performed using the PROM writer. I was dependent on either side. In the latter internal control method, since it is not necessary to be compatible with other microcomputers, it is preferable to use protected data for prevention of miswriting. However, if the logical value "0" is stored in the protective cell 7 against the user's intention, when the rewrite operation is executed in accordance with the result of the decoding of the rewrite command, the protected data is registered in the wrong state due to the congestion of the program processing. Even in the case of (4), there was a problem that the program command in the address area A was rewritten, whereby the program command in the address area A could not be rewritten correctly.

그래서, 본 발명은 불휘발성 메모리의 제2 기억 영역의 재기록 명령을 이용하여 제1 기억 영역의 프로그램 명령을 재기록할 때, 보호 데이타가 정확한 경우에만 재기록 동작을 허가할 수 있도록 하는 것을 목적으로 한다.Therefore, an object of the present invention is to enable a rewrite operation only when the protected data is correct when rewriting a program command of the first storage area using the rewrite command of the second storage area of the nonvolatile memory.

본 발명은 상기 문제점을 해결하기 위해 이루어진 것으로, 데이타를 일괄 또는 부분적으로 전기 소거할 수 있고 또한 데이타를 기록 및 판독할 수 있는 특성을 지니고, 제1 기억 영역에 각종 논리 연산을 실행시키기 위한 프로그램 명령이 기억되고, 제2 기억 영역에 상기 제1 기억 영역의 내용을 재기록하기 위한 재기록 명령이 기억된 불휘발성 메모리, 상기 불휘발성 메모리의 제1 기억 영역의 잘못된 재기록을 방지하기 위한 보호 데이타가 셋트되는 레지스터, 상기 레지스터의 값을 해독하여 해독 결과에 따라 상기 불휘발성 메모리의 제1 기억 영역의 재기록을 허가 또는 금지하는 디코더를 갖는 마이크로컴퓨터에 있어서, 상기 불휘발성 메모리의 제2 기억 영역의 재기록 명령을 이용하여 제1 기억 영역의 프로그램 명령을 재기록할때, 상기 레지스터에 정확한 보호 데이타가 셋트된 경우에만, 상기 불휘발성 메모리의 제1 기억 영역의 재기록을 허가하는 수단을 설치한 것을 특징으로 한다.SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and has a characteristic of being able to erase or collectively erase data, and to record and read data, and to execute program instructions for executing various logical operations on the first storage area. Is stored, a nonvolatile memory in which a rewrite command for rewriting the contents of the first storage area is stored in a second storage area, and protection data for preventing erroneous rewriting of the first storage area of the nonvolatile memory is set. A microcomputer having a register and a decoder for decoding a value of the register to permit or prohibit rewriting of a first storage area of the nonvolatile memory in accordance with a decoding result, wherein the rewrite command of the second storage area of the nonvolatile memory is issued. The register when rewriting the program command of the first storage area by using the Only when the correct protection of data sets, characterized in that a means for permitting a rewriting of the first storage area of the nonvolatile memory.

도 1은 본 발명의 마이크로컴퓨터를 나타낸 회로 블럭도.1 is a circuit block diagram showing a microcomputer of the present invention.

도 2는 각 파형의 상대 관계를 나타낸 타임차트.2 is a time chart showing the relative relationship of each waveform;

도3은 PROM 기록기(writer)를 이용하여 보호용 셀을 리셋트한 상태에서 보호 데이타를 사용하는 경우의 동작을 나타낸 타임차트.Fig. 3 is a time chart showing an operation in the case of using protected data in a state in which a protective cell is reset using a PROM writer.

도 4는 PROM 기록기를 이용하여 보호용 셀을 리셋트한 상태에서 보호 데이타를 사용하지 않은 경우의 동작을 나타낸 타임차트.Fig. 4 is a time chart showing an operation when no protection data is used in a state in which a protection cell is reset using a PROM writer.

도 5는 PROM 기록기를 이용하여 보호용 셀을 셋트한 상태에서 보호 데이타를 사용하는 경우의 동작을 나타낸 타임차트.Fig. 5 is a time chart showing an operation in the case of using protected data in a state where a protective cell is set using a PROM recorder.

도 6은 PROM 기록기를 이용하여 보호용 셀을 셋트한 상태에서 보호 데이타를 사용하지 않은 경우의 동작을 나타낸 타임차트.Fig. 6 is a time chart showing an operation when no protection data is used in a state in which a protection cell is set using a PROM recorder.

도 7은 플래시 메모리의 어드레스 영역 B의 재기록 명령을 이용하여 보호 데이타를 사용하는 경우의 동작을 나타낸 타임차트.Fig. 7 is a time chart showing an operation when protection data is used by using a rewrite command in the address area B of the flash memory.

도 8은 플래시 메모리의 어드레스 영역 B의 재기록 명령을 이용하여 보호 데이타를 사용하지 않은 경우의 동작을 나타낸 타임차트.Fig. 8 is a time chart showing an operation when protection data is not used by using a rewrite command in the address area B of the flash memory.

도 9는 종래의 플래시 메모리 장치를 나타낸 블럭도.9 is a block diagram showing a conventional flash memory device.

〈도면의 주요 부분에 대한 부호의 설명〉<Explanation of symbols for main parts of drawing>

9 : 플래시 메모리9: flash memory

12 : 레지스터12: register

13 : 디코더13: decoder

14 : 페이지 버퍼14: page buffer

15 : 보호용 셀15: protective cell

28 : CPU28: CPU

본 발명의 상세를 도면에 따라 구체적으로 설명하기로 한다.Details of the present invention will be described in detail with reference to the drawings.

도 1은 본 발명의 마이크로컴퓨터를 나타낸 회로 블럭도이다.1 is a circuit block diagram showing a microcomputer of the present invention.

도 1에 있어서, 참조 번호(8)는 클럭 발생기로서, 발진 회로(수정, 세라믹 등의 발진 진동자를 설치한 자주(自走)또는 타주他走) 중 어느 것이어도 좋다)의 발진 클럭이 공급되고, 발진 클럭에 분주 등의 논리 처리를 행여 각종 논리 연산을 실행하기 위한 시스템 클럭을 발생하는 것이다.In Fig. 1, reference numeral 8 denotes a clock generator, which is supplied with an oscillation clock of an oscillation circuit (either self or other oscillation provided with an oscillation oscillator such as crystal or ceramic). In this case, a system clock for executing various logic operations is generated by performing logic processing such as division into the oscillation clock.

참조 번호(9)는 플래시 메모리(불휘발성 메모리)로서, 데이타를 일괄 또는 부분적(예를 들면 페이지(128워드) 단위)으로 전기 소거할 수 있고 또한 데이타를 반복 기록 및 판독할 수 있는 불휘발성의 특성을 갖는다. 플래시 메모리(9)는 마이크로컴퓨터의 프로그램 메모리로서 기능하고, 어드레스 영역 A의 내부 셀에는 각종 논리 연산을 실행시키기 위한 프로그램 명령이 기억되고, 어드레스 영역 B의 내부 셀에는 어드레스 영역 A의 프로그램 명령을 재기록하기 위한 재기록 명령이 기억되어 있다. 플래시 메모리(9)는 통상은 어드레스 영역 A가 지정되고, 어드레스 영역 A의 프로그램 내용을 재기록하기 위한 인터럽트 요구가 발생될 때에만 어드레스 영역 B가 지정되도록 어드레스 영역 A로부터 점프한다. 마이크로컴퓨터는, 플래시 메모리(9)의 어드레스 영역 A로부터 판독된 프로그램 명령의 해독 결과에 따라 각종 논리 연산 동작을 실행하고, 한편, 플래시 메모리(9)의 어드레스 영역 B로부터 판독된 재기록 명령의 해독 결과에 따라 어드레스 영역 A의 내용의 재기록 동작을 실행한다. 또, 플래시 메모리(9)의 어드레스 영역 A의 재기록 데이타는 마이크로컴퓨터의 내부에 사전 준비하는 방법(마스크 ROM을 별도 설치하여 테이블 데이타로서 기억하는 방법 등), 또는, 마이크로컴퓨터의 외부로부터 공급하는 방법(PROM 기록기로부터 공급하는 방법 등) 중 어느 것이어도 좋다.Reference numeral 9 denotes a flash memory (non-volatile memory), which is a nonvolatile memory capable of electrically erasing data in batches or partially (for example, in pages (128 words)) and repeatedly recording and reading data. Has characteristics. The flash memory 9 functions as a program memory of a microcomputer, and program instructions for executing various logical operations are stored in the internal cells of the address area A, and the program commands of the address area A are rewritten in the internal cells of the address area B. The rewrite command for storing is stored. The flash memory 9 usually jumps from the address area A so that the address area A is designated and the address area B is designated only when an interrupt request for rewriting the program contents of the address area A is generated. The microcomputer executes various logical arithmetic operations in accordance with the decoding result of the program command read from the address area A of the flash memory 9, while the decoding result of the rewrite command read from the address area B of the flash memory 9 is executed. In accordance with this, the rewrite operation of the contents of the address area A is executed. In addition, the rewrite data of the address area A of the flash memory 9 is prepared in advance in the microcomputer (method of separately installing a mask ROM and storing it as table data), or is supplied from the outside of the microcomputer. (Method of supplying from a PROM recorder, etc.) may be sufficient.

플래시 메모리(9)는 데이타 기억용 내부 셀 외에, 이하의 주변 회로를 포함한다. 참조 번호(10)는 어드레스 디코더로서, 플래시 메모리(9)를 어드레스 지정하기 위한 어드레스 데이타(m 비트)를 해독하는 것이다. 참조 번호(11)는 검출 회로로서, 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령이 사용자의 의사에 반하여 잘못 재기록되는 문제점을 방지하는 것이다. 상세히 기술하자면, 검출 회로(11)는 복수의 레지스터(12) 및 디코더(13)를 포함한다. 복수의 레지스터(12)는 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령(페이지 단위)를 재기록하고자 하는 전 단계에서, 사용자가 미리 준비한 보호 데이타(AAH, 55H 등)를 기억하는것이다. 디코더(13)는 복수의 레지스터(12)의 값이 사용자가 의도하는 값인지의 여부를 해독하고, 복수의 레지스터(12)의 모든 값이 정확한 경우에는 플래시 메모리(9)의 재기록 동작을 허가하고, 복수의 레지스터(12)의 값이 1개라도 잘못되어 있는 경우에는 플래시 메모리(9)의 재기록 동작을 금지시키도록 한 논리 구조로 되어 있다. 참조 번호(14)는 페이지 버퍼(스태틱 RAM 등의 휘발성 메모리)로서, 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령을 1페이지 단위로 재기록하기 위한 128워드의 기억 용량을 갖는다. 페이지 버퍼(14)는 자신을 어드레스 지정하기 위한 인크리멘트 기능을 갖는다. 재기록 데이타는 페이지 버퍼(14)에 일단 기억된 후, 플래시 메모리(9)의 어드레스 영역 A의 지정 페이지에 기록된다.The flash memory 9 includes the following peripheral circuits in addition to the internal cells for data storage. Reference numeral 10 denotes an address decoder which decodes address data (m bits) for addressing the flash memory 9. Reference numeral 11 is a detection circuit to prevent a problem that a program command in the address area A of the flash memory 9 is incorrectly rewritten against the user's intention. In detail, the detection circuit 11 includes a plurality of registers 12 and a decoder 13. The plurality of registers 12 store the protection data (AAH, 55H, etc.) prepared in advance by the user in the previous step of rewriting the program command (page unit) of the address area A of the flash memory 9. The decoder 13 decodes whether or not the values of the plurality of registers 12 are values intended by the user, and if all the values of the plurality of registers 12 are correct, the decoder 13 permits the rewrite operation of the flash memory 9. In the case where any one of the plurality of registers 12 is wrong, the logical structure is configured to prohibit the rewrite operation of the flash memory 9. Reference numeral 14 is a page buffer (volatile memory such as a static RAM) and has a storage capacity of 128 words for rewriting the program command in the address area A of the flash memory 9 in units of one page. The page buffer 14 has an increment function for addressing itself. The rewrite data is once stored in the page buffer 14 and then written to the designated page of the address area A of the flash memory 9.

참조 번호(15)는 보호용 셀로서, PROM 기록기를 이용하여 어드레스 영역 A의 프로그램 명령을 재기록할 때, PROM 기록기의 제어 지시에 따라서 논리값「0」또는 논리값「1」이 기억되는 것이다. 보호용 셀(15)이 논리값「0」(리셋트 상태)일 때, 검출 회로(11)는 어드레스 영역 A에 대한 오기록 방지용의 보호 데이타의 유무에 상관 없이 플래시 메모리(9)를 재기록 허가 상태로 한다. 한편, 보호용 셀(15)이 논리값 「1」(셋트 상태)일 때, 검출 회로(11)는 보호 데이타가 존재하고 또한 정확한 경우에만, 플래시 메모리(9)를 재기록 허가 상태로 한다.Reference numeral 15 is a protective cell, and when a program command in the address area A is rewritten using a PROM writer, a logical value "0" or a logical value "1" is stored in accordance with the control instruction of the PROM writer. When the protective cell 15 is at a logic value "0" (reset state), the detection circuit 11 rewrites the flash memory 9 in a state of allowing rewrite of the flash memory 9 irrespective of the presence or absence of protection data for preventing the miswriting of the address area A. Shall be. On the other hand, when the protective cell 15 is at the logic value "1" (set state), the detection circuit 11 sets the flash memory 9 to the rewrite permission state only when the protection data exists and is correct.

참조 번호(16)는 보호 데이타 식별 회로로서, 복수의 레지스터(12)에 보호 데이타가 셋트될 때, 논리값「1」을 출력하는 것이다. 여기서, 후술하는 CPU는 플래시 메모리(9)의 어드레스 영역 B의 재기록 명령을 이용하여 어드레스 영역 A의 프로그램 명령을 재기록할 때, 논리값「1」의 온보드 신호 OB를 출력한다. 보호용 셀(15)의 값 및 온보드 신호 OB는 NOR 게이트(17)에 공급된다. 즉, 보호용 셀(15)의 값이 논리값「0」일 때, NOR 게이트(17)의 출력은 온보드 신호 OB의 값에 따라서 변화한다. 또한, 보호 데이타 식별 회로(16)의 값 및 NOR 게이트(17)의 출력 논리값은 NOR 게이트(18)에 공급된다. 즉, 보호용 셀(15)의 값 또는 온보드 신호 OB가 논리값 「1」일 때, NOR 게이트(18)의 출력은 보호 데이타 식별 회로(16)의 값에 따라서 변화한다. D형 플립플롭(19)은 복수의 레지스터(12)의 값의 해독 결과에 따라서 플래시 메모리(9)가 기록 동작 허가 상태로 된 후, 페이지 버퍼(14)가1페이지 단위의 프로그램 명령을 기억한 직후에 발생하는 클럭 CLK2에 동기하여, NOR 게이트(19)의 출력 논리값을 유지하는 것이다.Reference numeral 16 is a protection data identification circuit that outputs a logical value "1" when protection data is set in the plurality of registers 12. Here, the CPU described later outputs the onboard signal OB having the logic value "1" when rewriting the program command in the address area A using the rewrite command in the address area B of the flash memory 9. The value of the protective cell 15 and the onboard signal OB are supplied to the NOR gate 17. That is, when the value of the protective cell 15 is a logic value "0", the output of the NOR gate 17 changes according to the value of the onboard signal OB. In addition, the value of the protection data identification circuit 16 and the output logic value of the NOR gate 17 are supplied to the NOR gate 18. That is, when the value of the protective cell 15 or the onboard signal OB is a logic value "1", the output of the NOR gate 18 changes in accordance with the value of the protection data identification circuit 16. In the D-type flip-flop 19, after the flash memory 9 enters the write operation permission state in accordance with the result of reading the values of the plurality of registers 12, the page buffer 14 stores a program instruction in units of one page. In synchronism with the clock CLK2 generated immediately after, the output logic value of the NOR gate 19 is held.

참조 번호(20)는 제어 회로로서, 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령의 해독 결과에 따라서 동작하고, 플래시 메모리(9)에 대해 동작 허가 신호 *CE, 기록 허가 신호 *WE, 판독 허가 신호 *OE, 기록 금지 신호 WI, 기록 종료 신호 EOW를 공급하는 것이다.Reference numeral 20 is a control circuit, which operates in accordance with the result of the decoding of the program command in the address area A of the flash memory 9, and reads the operation permission signal * CE, the write permission signal * WE, and reads the flash memory 9. It supplies the grant signal * OE, the record prohibition signal WI, and the record end signal EOW.

참조 번호(21)는 식별 회로로서, 동작 허가 신호 *CE 및 기록 허가 신호 *WE의 하강에 동기하여 논리값「1」을 출력하는 것이다. D형 플립플롭(19)의 출력 논리값, 기록 금지 신호 WI, 기록 종료 신호 EOW는 OR 게이트(22)에 공급된다. 참조 번호(25)는 NOR 게이트(23, 24)로 이루어지는 RS형 플립플롭로서, 식별 회로(21)의 출력 논리값이 NOR 게이트(23)의 한쪽 입력 단자(셋트 단자)에 공급되고, OR 게이트(22)의 출력 논리값이 NOR 게이트(24)의 한쪽 입력 단자(리셋트 단자)에 공급되고, 플래시 메모리 (9)의 어드레스 영역 A의 내부 셀을 기록 가능 상태로 하기 위한 제어 신호 WRT를 출력하는 것이다. 상세히 기술하자면, 제어 신호 WRT는 식별 회로(21)의 값이 논리값「1」로 될 때에 상승하고, D형 플립플롭(19)의 값, 기록 금지 신호 WI, 기록 종료 신호 EOW 중 어느 1개가 논리값「1」로 될 때에 하강한다. 제어 신호 WRT는 하이액티브(high active)로 한다. 또한, 도 2는 동작 허가 신호 *CE, 기록 허가 신호 *WE, 판독 허가 신호 *OE, 기록 금지 신호 WI의 상대 관계를 나타낸 타임차트이다. 기록 금지 신호 WI는 플래시 메모리(9)의 어드레스 영역 B의 재기록 명령의 해독 결과에 따라서, 동작 허가 신호 *CE 및 기록 허가 신호*WE가 로우 레벨로 변화한 후 일정 시간 후에 발생한다. 상세히 기술하자면, 기록 금지 신호 WI는 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하이 레벨로 변화한 직후부터 동작 허가 신호 *CE 및 판독 허가 신호 *OE가 로우 레벨로 변화할 때까지의 기간 동안 발생한다.Reference numeral 21 is an identification circuit that outputs a logic value "1" in synchronization with the falling of the operation permission signal * CE and the write permission signal * WE. The output logic value, the write prohibition signal WI, and the write end signal EOW of the D flip-flop 19 are supplied to the OR gate 22. Reference numeral 25 is an RS flip-flop composed of NOR gates 23 and 24, and the output logic value of the identification circuit 21 is supplied to one input terminal (set terminal) of the NOR gate 23, and the OR gate is provided. An output logic value of 22 is supplied to one input terminal (reset terminal) of the NOR gate 24, and outputs a control signal WRT for making an internal cell in the address area A of the flash memory 9 writable. It is. In detail, the control signal WRT rises when the value of the identification circuit 21 becomes the logical value &quot; 1 &quot;, and any one of the value of the D flip-flop 19, the write prohibition signal WI, and the write end signal EOW It descends when the logic value is "1". The control signal WRT is made high active. 2 is a time chart showing the relative relationship between the operation permission signal * CE, the write permission signal * WE, the read permission signal * OE and the write prohibition signal WI. The write prohibition signal WI occurs after a predetermined time after the operation permission signal * CE and the write permission signal * WE change to the low level in accordance with the result of the decoding of the rewrite command in the address area B of the flash memory 9. In detail, the write prohibition signal WI is used for a period from immediately after the operation enable signal * CE and the write enable signal * WE change to the high level until the operation enable signal * CE and the read enable signal * OE change to the low level. Occurs.

제어 회로(20)는 플래그(26)를 포함한다. 플래그(26)는 제어 신호 WRT의 상태에 상관 없이 플래시 메모리(9)를 강제적으로 기록 가능 상태로 설정하기 위한 강제 설정 신호 PL이, 플래시 메모리(9)의 어드레스 영역 B의 재기록 명령의 해독결과에 따라서 설정되는 것이다. 플래그(26)는 페이지 버퍼(14)로부터 어드레스 영역 A로의 기록이 종료한 시점의 제어 신호 WRT의 하강 WRTDOWN에 따라서 리셋트된다. 제어 신호 WRT 및 강제 설정 신호 PL은 OR 게이트(27)를 통해 검출 회로(11)의 리셋트 단자에 공급되고, 복수의 레지스터(5)의 값은 OR 게이트(27)의 출력이 로우 레벨로 변화한 때에 리셋트된다. 강제 설정 신호 PL의 작용 효과로서, 제어 신호 WRT가 하강하여도 복수의 레지스터(12)의 값이 리셋트되지 않기 때문에, 검출 회로(11)는 보호 데이타의 옳고 그름을 확실하게 검출할 수 있다.The control circuit 20 includes a flag 26. The flag 26 indicates that the forced setting signal PL for forcibly setting the flash memory 9 to the writable state irrespective of the state of the control signal WRT is determined by the decoding result of the rewrite command in the address area B of the flash memory 9. Therefore, it is set. The flag 26 is reset in accordance with the falling WRTDOWN of the control signal WRT at the time when writing from the page buffer 14 to the address area A is finished. The control signal WRT and the force setting signal PL are supplied to the reset terminal of the detection circuit 11 through the OR gate 27, and the values of the plurality of registers 5 change the output of the OR gate 27 to a low level. It is reset at one time. As an effect of the forced setting signal PL, since the values of the plurality of registers 12 are not reset even when the control signal WRT falls, the detection circuit 11 can reliably detect the right and wrong of the protected data.

참조 번호(28)는 CPU로서, 플래시 메모리(9)의 어드레스 영역 A, B로부터 판독된 명령의 해독 결과에 따라서 각종 논리 연산 동작을 실행하는 것이고, ALU, ACC, 각종 레지스터 등을 포함한다. 참조 번호(29)는 프로그램 카운터로서, 플래시 메모리(9)를 어드레스 지정하기 위한 어드레스 데이타(m 비트)를 발생하는 것이다. 프로그램 카운터(29)는 플래시 메모리(9)로부터 명령을 판독할 때에 사용한다. 참조 번호(30)는 m개의 래치 회로로서, 플래시 메모리(9)의 어드레스 영역 B로부터 판독된 재기록 명령의 해독 결과에 따라서, CPU(28)가 발생하는 어드레스 영역 A의 일부 영역을 지정하기 위한 어드레스 데이타(m 비트)를 클럭 CK0에 동기하여 래치하는 것이다. 마찬가지로, 참조 번호(31)는 n개의 래치 회로로서, 플래시 메모리(9)의 어드레스 영역 A의 재기록용의 신규 프로그램 데이타(n 비트)를 클럭 CK1에 동기하여 래치하는 것이다. 래치 회로(30, 31)는 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령을 재기록할 때에 사용한다. AND 게이트(32, 33) 및 OR 게이트(34)로 이루어지는 전환 회로는 프로그램 카운터(29) 또는 래치 회로(30) 중 어느 한쪽의 어드레스 데이타를 플래시 메모리(9)로 전환 출력하는 것이다. 참조 번호(35)는 선택 회로로서, 상기 전환 회로에 어드레스 데이타의 전환을 지시하기 위한 선택 신호 SELECT를 공급하는 것이다. 즉, 선택 신호 SELECT는 프로그램 카운터(29)의 값을 플래시 메모리(9)에 공급할 때에 하이 레벨로 되고, 래치 회로(30)의 값을 플래시 메모리(9)에 공급할 때에 로우 레벨이 된다. 상기 전환 회로로부터 전환 출력되는 어드레스 데이타는 플래시 메모리(9)를 어드레스 지정하기 위해 어드레스 디코더(10)에 공급되고 또한 복수의 레지스터(12)를 선택하기 위해 검출 회로(11)에도 공급되지만, 어드레스 디코더(10) 및 검출 회로(11)의 동시 동작은 있을 수 없기 때문에, 아무런 문제가 없다. 래치 회로(31)로부터 출력되는 프로그램 데이타는 복수의 레지스터(12) 및 페이지 버퍼(14)에 공급된다.Reference numeral 28 denotes a CPU which executes various logical arithmetic operations in accordance with the decoding result of the instruction read from the address areas A and B of the flash memory 9, and includes ALUs, ACCs, various registers, and the like. Reference numeral 29 is a program counter that generates address data (m bits) for addressing the flash memory 9. The program counter 29 is used to read a command from the flash memory 9. Reference numeral 30 denotes m latch circuits and addresses for designating a partial region of the address region A generated by the CPU 28 according to the result of the decoding of the rewrite command read from the address region B of the flash memory 9. The data (m bits) is latched in synchronization with the clock CK0. Similarly, reference numeral 31 denotes n latch circuits for latching new program data (n bits) for rewriting in the address area A of the flash memory 9 in synchronization with the clock CK1. The latch circuits 30 and 31 are used to rewrite the program command in the address area A of the flash memory 9. The switching circuit composed of the AND gates 32 and 33 and the OR gate 34 converts and outputs address data of either the program counter 29 or the latch circuit 30 to the flash memory 9. Reference numeral 35 denotes a selection circuit, which supplies a selection signal SELECT for instructing the switching of address data to the switching circuit. That is, the selection signal SELECT is at the high level when the value of the program counter 29 is supplied to the flash memory 9, and is at the low level when the value of the latch circuit 30 is supplied to the flash memory 9. The address data switched from the switching circuit are supplied to the address decoder 10 for addressing the flash memory 9 and also to the detection circuit 11 for selecting the plurality of registers 12, but the address decoder Since there cannot be simultaneous operation of the 10 and the detection circuit 11, there is no problem. Program data output from the latch circuit 31 is supplied to the plurality of registers 12 and the page buffer 14.

CPU(28)는 플래시 메모리(9)의 어드레스 영역 B의 재기록 명령을 이용하여 어드레스 영역 A의 프로그램 명령을 재기록할 때, 하이 레벨의 온보드 신호 OB를 출력하고, 보호용 셀(15)의 값과 함께 NOR 게이트(17)에 공급한다.When the CPU 28 rewrites the program command in the address area A using the rewrite command in the address area B of the flash memory 9, the CPU 28 outputs a high level on-board signal OB, together with the value of the protective cell 15. It is supplied to the NOR gate 17.

우선, PROM 기록기를 이용하여 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령을 재기록하는 경우에 대해 설명하기로 한다.First, a case of rewriting the program command in the address area A of the flash memory 9 using the PROM writer will be described.

도 3은 보호용 셀(15)을 리셋트하고, 보호 데이타를 공급하는 경우의 동작을 나타낸 타임차트이다.3 is a time chart showing an operation in the case where the protective cell 15 is reset and protection data is supplied.

마이크로컴퓨터의 동작을 정지시킨 상태에서, PROM 기록기로부터 플래시 메모리(9)로 각종 신호를 공급한다. 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하강하면, RS형 플립플롭(25)의 셋트에 따라 제어 신호 WRT가 상승하고, 플래시 메모리(9)의 어드레스 영역 A의 내부 셀은 기록 가능 상태가 된다. 보호 데이타는 동작 허가 신호 *CE 및 기록 허가 신호 *WE의 변화에 동기하여 레지스터(12)에 셋트된다. 또, 보호용 셀(15)의 값이 논리값「0」이기 때문에, 보호 데이타 식별 회로(16)의 출력에 상관 없이 D형 플립플롭(19)의 입력은 논리값「0」이다. 또한, 기록 금지 신호 WI는 발생하지 않는다. 따라서, 기록 종료 신호 EOW가 발생할 때, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강한다. 다시 말하면, 최초의 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 발생하고 나서 기록 종료 신호 EOW가 발생할 때까지 제어 신호 WRT는 하이 레벨을 계속한다. 레지스터(12) 에 대한 보호 데이타의 셋트 및 페이지 버퍼(14)에 대한 128워드의 프로그램 데이타의 기억이 종료되면, 소거 신호 ERASE가 발생하고, 플래시 메모리(9)의 어드레스 영역 A의 재기록 대상 페이지의 내용은 소거되고, 기록 신호 PROGRAM이 발생하여, 페이지 버퍼(14)의 내용이 플래시 메모리(9)의 어드레스 영역 A에 기록된다. 여기서, 기록 신호 PROGRAM이 상승하면, 보호용 셀(15)은 논리값「1」로 된다. 즉, 이후에는, 플래시 메모리(9)의 어드레스 영역 A의 재기록을 실행하기 위해서는, 보호 데이타가 필요해진다. 또한, 기록 신호 PROGRAM이 하강하면, 기록 종료 신호 EOW가 발생한다. 즉, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강한다.In the state where the operation of the microcomputer is stopped, various signals are supplied from the PROM recorder to the flash memory 9. When the operation permission signal * CE and the write permission signal * WE fall, the control signal WRT rises in accordance with the set of the RS flip-flop 25, and the internal cell of the address area A of the flash memory 9 becomes writable. do. The protection data is set in the register 12 in synchronization with the change of the operation permission signal * CE and the write permission signal * WE. In addition, since the value of the protective cell 15 is a logic value "0", the input of the D-type flip-flop 19 is a logic value "0" regardless of the output of the protection data identification circuit 16. In addition, the write prohibition signal WI does not occur. Therefore, when the write end signal EOW occurs, the control signal WRT falls in accordance with the reset of the RS flip-flop 25. In other words, the control signal WRT continues the high level until the first operation permission signal * CE and the recording permission signal * WE have been generated until the recording end signal EOW occurs. When the set of protected data for the register 12 and the storage of the 128-word program data for the page buffer 14 are terminated, the erase signal ERASE occurs, and the rewrite target page of the address area A of the flash memory 9 is generated. The contents are erased, the write signal PROGRAM is generated, and the contents of the page buffer 14 are written to the address area A of the flash memory 9. Here, when the write signal PROGRAM rises, the protective cell 15 becomes a logic value "1". That is, afterwards, in order to perform rewriting of the address area A of the flash memory 9, protected data is required. If the write signal PROGRAM falls, the write end signal EOW occurs. That is, the control signal WRT falls in accordance with the reset of the RS flip-flop 25.

도 4는 보호용 셀(15)을 리셋트하고, 보호 데이타를 공급하지 않은 경우의 동작을 나타낸 타임차트이다.4 is a time chart showing the operation when the protection cell 15 is reset and no protection data is supplied.

마이크로컴퓨터의 동작을 정지시킨 상태에서, PROM 기록기로부터 플래시 메모리(9)로 각종 신호를 공급한다. 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하강하면, RS형 플립플롭(25)의 셋트에 따라 제어 신호 WRT가 상승하고, 플래시 메모리(9)의 어드레스 영역 A의 내부 셀은 기록 가능 상태가 된다. 또한, 보호용 셀(15)의 값이 논리값「0」이기 때문에, 보호 데이타 식별 회로(16)의 출력에 상관없이, D형 플립플롭(19)의 입력은 논리값「0」이다. 또한, 기록 금지 신호 WI는 발생하지 않는다. 따라서, 기록 종료 신호 EOW가 발생할 때, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강한다. 다시 말하면, 최초의 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 발생하고 나서 기록 종료 신호 EOW가 발생할 때까지 제어 신호 WRT는 하이 레벨을 계속한다. 페이지 버퍼(14)에 대한 128워드의 프로그램 데이타의 기억이 종료되면, 소거 신호 ERASE가 발생하고, 플래시 메모리 (9)의 어드레스 영역 A의 재기록 대상 페이지의 내용은 소거되고, 기록 신호 PROGRAM이 발생하고, 페이지 버퍼(14)의 내용이 플래시 메모리(9)의 어드레스 영역 A에 기록된다. 여기서, 보호용 셀(15)의 값은 논리값「0」인 상태 그대로이다. 또한, 기록 신호 PROGRAM이 하강하면, 기록 종료 신호 EOW가 발생한다. 즉, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강한다.In the state where the operation of the microcomputer is stopped, various signals are supplied from the PROM recorder to the flash memory 9. When the operation permission signal * CE and the write permission signal * WE fall, the control signal WRT rises in accordance with the set of the RS flip-flop 25, and the internal cell of the address area A of the flash memory 9 becomes writable. do. In addition, since the value of the protective cell 15 is a logic value "0", the input of the D-type flip-flop 19 is a logic value "0" irrespective of the output of the protection data identification circuit 16. In addition, the write prohibition signal WI does not occur. Therefore, when the write end signal EOW occurs, the control signal WRT falls in accordance with the reset of the RS flip-flop 25. In other words, the control signal WRT continues the high level until the first operation permission signal * CE and the recording permission signal * WE have been generated until the recording end signal EOW occurs. When the storage of the 128-word program data for the page buffer 14 ends, the erase signal ERASE occurs, the contents of the rewrite target page in the address area A of the flash memory 9 are erased, and the write signal PROGRAM is generated. The contents of the page buffer 14 are written to the address area A of the flash memory 9. Here, the value of the protective cell 15 remains as it is in the logical value "0". If the write signal PROGRAM falls, the write end signal EOW occurs. That is, the control signal WRT falls in accordance with the reset of the RS flip-flop 25.

도 5는 보호용 셀(15)을 셋트하고, 보호 데이타를 공급하는 경우의 동작을 나타낸 타임차트이다.Fig. 5 is a time chart showing an operation in the case where the protection cell 15 is set and protection data is supplied.

마이크로컴퓨터의 동작을 정지시킨 상태에서, PROM 기록기로부터 플래시 메모리(9)로 각종 신호를 공급한다. 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하강하면, RS형 플립플롭(25)의 셋트에 따라 제어 신호 WRT가 상승하고, 플래시 메모리(9)의 어드레스 영역 A의 내부 셀은 기록 가능 상태가 된다. 보호 데이타는 동작 허가 신호 *CE 및 기록 허가 신호 *WE의 변화에 동기하여 레지스터(12)에 셋트된다. 또, 보호용 셀(15)의 값이 논리값「1」이므로 D형 플립플롭(19)의 입력은 보호 데이타 식별 회로(16)의 출력에 의존한다. 즉, 보호 데이타 식별 회로(16)의 출력이 논리값「1」이므로 D형 플립플롭(19)의 입력은 논리값「0」이다. 또한, 기록 금지 신호 WI는 발생하지 않는다. 따라서, 기록 종료 신호 EOW가 발생할 때, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 비로소 하강한다. 다시 말하면, 최초의 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 발생하고 나서 기록 종료 신호 EOW가 발생할 때까지 제어 신호 WRT는 하이 레벨을 계속한다. 보호 데이타의 해독 결과가 올바른 경우에는 플래시 메모리(9)의 기록 동작이 허가되고, 페이지 버퍼(14)에 128워드의 프로그램 데이타가 기억된다. 그 후, 소거 신호 ERASE가 발생하고, 플래시 메모리(9)의 어드레스 영역 A의 재기록 대상 페이지의 내용은 소거된다. 그 후, 기록 신호 PROGRAM이 발생하고, 페이지 버퍼(14)의 내용이 플래시 메모리(9)의 어드레스 영역 A에 기록된다. 기록 신호 PROGRAM이 하강하면, 기록종료 신호 EOW가 발생되기 때문에, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강한다.In the state where the operation of the microcomputer is stopped, various signals are supplied from the PROM recorder to the flash memory 9. When the operation permission signal * CE and the write permission signal * WE fall, the control signal WRT rises in accordance with the set of the RS flip-flop 25, and the internal cell of the address area A of the flash memory 9 becomes writable. do. The protection data is set in the register 12 in synchronization with the change of the operation permission signal * CE and the write permission signal * WE. In addition, since the value of the protective cell 15 is logical value "1", the input of the D flip-flop 19 depends on the output of the protection data identification circuit 16. As shown in FIG. That is, since the output of the protection data identification circuit 16 is a logic value "1", the input of the D-type flip-flop 19 is a logic value "0". In addition, the write prohibition signal WI does not occur. Therefore, when the write end signal EOW occurs, the control signal WRT does not fall until the reset of the RS flip-flop 25 occurs. In other words, the control signal WRT continues the high level until the first operation permission signal * CE and the recording permission signal * WE have been generated until the recording end signal EOW occurs. If the result of decryption of the protected data is correct, the write operation of the flash memory 9 is permitted, and 128 words of program data are stored in the page buffer 14. Thereafter, the erase signal ERASE occurs, and the contents of the rewrite target page in the address area A of the flash memory 9 are erased. After that, the write signal PROGRAM is generated, and the contents of the page buffer 14 are written to the address area A of the flash memory 9. When the recording signal PROGRAM falls, the recording end signal EOW is generated. Therefore, the control signal WRT falls in accordance with the reset of the RS flip-flop 25.

도 6은 보호용 셀(15)을 셋트하고, 보호 데이타를 공급하지 않은 경우의 동작을 나타낸 타임차트이다.Fig. 6 is a time chart showing the operation when the protection cell 15 is set and no protection data is supplied.

마이크로컴퓨터의 동작을 정지시킨 상태에서, PROM 기록기로부터 플래시 메모리(9)로 각종 신호를 공급한다. 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하강하면, RS형 플립플롭(25)의 셋트에 따라 제어 신호 WRT가 상승하고, 플래시 메모리(9)의 어드레스 영역 A의 내부 셀은 기록 가능 상태가 된다. 또한, 보호용 셀(15)의 값이 논리값「1」이므로 D형 플립플롭(19)의 입력은 보호 데이타 식별 회로(16)의 출력에 의존한다. 즉, 보호 데이타 식별 회로(16)의 출력이 논리값「0」이므로 D형 플립플롭(19)의 입력은 논리값「1」이다. 또한, 기록 금지 신호 WI는 발생하지 않는다. 따라서, 페이지 버퍼(14)에 대한 데이타 기억 동작 종료로부터 소정 시간(예를 들면 300μsec) 경과 후에 발생하는 클럭 CLK2에 동기하여 D형 플립플롭(19)은 논리값「1」을 유지한다. 즉, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강하고, 플래시 메모리(9)의 기록 동작은 금지된다.In the state where the operation of the microcomputer is stopped, various signals are supplied from the PROM recorder to the flash memory 9. When the operation permission signal * CE and the write permission signal * WE fall, the control signal WRT rises in accordance with the set of the RS flip-flop 25, and the internal cell of the address area A of the flash memory 9 becomes writable. do. In addition, since the value of the protective cell 15 is logical value "1", the input of the D flip-flop 19 depends on the output of the protection data identification circuit 16. As shown in FIG. That is, since the output of the protection data identification circuit 16 is a logic value "0", the input of the D-type flip-flop 19 is a logic value "1". In addition, the write prohibition signal WI does not occur. Accordingly, the D-type flip-flop 19 holds the logic value "1" in synchronization with the clock CLK2 generated after a predetermined time (for example, 300 mu sec) has elapsed from the end of the data storage operation to the page buffer 14. That is, the control signal WRT falls in accordance with the reset of the RS flip-flop 25, and the write operation of the flash memory 9 is prohibited.

다음에, 플래시 메모리(9)의 어드레스 영역 B의 재기록 명령을 이용하여 어드레스 영역 A의 프로그램 명령을 재기록하는 경우에 대해 설명하기로 한다.Next, a case of rewriting the program command in the address area A using the rewrite command in the address area B of the flash memory 9 will be described.

도 7은 보호 데이타를 공급하는 경우의 동작을 나타낸 타임차트이다.7 is a time chart showing an operation in the case of supplying protected data.

마이크로컴퓨터가 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령의 해독 결과에 따라 각종 논리 연산 동작을 실행하고 있을 때, 어드레스 영역 A의 프로그램 명령을 재기록하기 위한 인터럽트 요구가 발생하면, 프로그램 카운터(29)의 값이 어드레스 영역 A로부터 어드레스 영역 B로 점프한다. 그리고, 마이크로컴퓨터는 어드레스 영역 B의 재기록 명령의 해독 결과에 따라서 재기록 동작을 개시한다. 이 때, CPU(28)는 논리값「1」의 온보드 신호 OB를 항상 출력한다. 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하강하면, RS형 플립플롭(25)의 셋트에 따라 제어 신호 WRT가 상승하고, 플래시 메모리(9)의 어드레스 영역 A의 내부 셀은 기록 가능 상태가 된다. 보호 데이타는 동작 허가 신호 *CE 및 기록 허가 신호 *WE의 변화에 동기하여 레지스터(12)에 셋트된다. 또, 온보드 신호 OB가 논리값 「1」이므로 D형 플립플롭(19)의 입력은 보호 데이타 식별 회로(16)의 출력에 의존한다. 즉, 보호 데이타 식별 회로(16)의 출력이 논리값「1」이므로 D형 플립플롭(19)의 입력은 논리값「0」이다. 또한, 기록 금지 신호 WI는 페이지 버퍼(14)에 대한 기억이 종료할 때까지 주기적 간격으로 발생하지만, 강제 설정 신호 PL이 논리값「1」이므로 레지스터(12)의 해독에 지장은 없다. 그리고, 보호 데이타의 해독 결과가 올바른 경우에는, 소거 신호 ERASE가 발생되고, 플래시 메모리(9)의 어드레스 영역 A의 재기록 대상 페이지의 내용이 소거된다. 그 후, 기록 신호 PROGRAM이 발생하고, 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하강에 동기하여 제어 신호 WRT가 상승하고, 페이지 버퍼(14)의 내용이 플래시 메모리(9)의 어드레스 영역 A에 기록된다. 기록 신호 PROGRAM이 하강하면, 기록 종료 신호 EOW가 발생하기 때문에, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강한다.When an interrupt request for rewriting the program command in the address area A occurs while the microcomputer is executing various logical arithmetic operations in accordance with the decoding result of the program command in the address area A of the flash memory 9, the program counter 29 ) Jumps from the address area A to the address area B. Then, the microcomputer starts the rewrite operation in accordance with the decoding result of the rewrite command in the address area B. FIG. At this time, the CPU 28 always outputs the onboard signal OB having the logic value "1". When the operation permission signal * CE and the write permission signal * WE fall, the control signal WRT rises in accordance with the set of the RS flip-flop 25, and the internal cell of the address area A of the flash memory 9 becomes writable. do. The protection data is set in the register 12 in synchronization with the change of the operation permission signal * CE and the write permission signal * WE. In addition, since the on-board signal OB is a logic value "1", the input of the D flip-flop 19 depends on the output of the protection data identification circuit 16. As shown in FIG. That is, since the output of the protection data identification circuit 16 is a logic value "1", the input of the D-type flip-flop 19 is a logic value "0". The write prohibition signal WI is generated at periodic intervals until the storage of the page buffer 14 ends, but since the forced setting signal PL is a logic value "1", there is no problem in the decoding of the register 12. When the decryption result of the protected data is correct, the erase signal ERASE is generated, and the contents of the rewrite target page in the address area A of the flash memory 9 are erased. Thereafter, the write signal PROGRAM is generated, the control signal WRT rises in synchronization with the operation permission signal * CE and the write permission signal * WE falling, and the contents of the page buffer 14 are changed in the address area A of the flash memory 9. Is written on. When the write signal PROGRAM falls, the write end signal EOW occurs, so that the control signal WRT falls in accordance with the reset of the RS flip-flop 25.

도 8은 보호 데이타를 공급하지 않은 경우의 동작을 나타낸 타임차트이다.8 is a time chart showing an operation when no protection data is supplied.

마이크로컴퓨터가 플래시 메모리(9)의 어드레스 영역 A의 프로그램 명령의 해독 결과에 따라 각종 논리 연산 동작을 실행하고 있을 때, 어드레스 영역의 프로그램 명령을 재기록하기 위한 인터럽트 요구가 발생하면, 프로그램 카운터(29)의 값이 어드레스 영역 A로부터 어드레스 영역 B로 점프한다. 그리고, 마이크로컴퓨터는 어드레스 영역 B의 재기록 명령의 해독 결과에 따라 재기록 동작을 개시한다. 이 때, CPU(28)는 논리값「1」의 온보드 신호 OB를 항상 출력한다. 동작 허가 신호 *CE 및 기록 허가 신호 *WE가 하강하면, RS형 플립플롭(25)의 셋트에 따라 제어 신호 WRT가 상승하고, 플래시 메모리(9)의 어드레스 영역 A의 내부 셀은 기록 가능 상태로 된다. 보호 데이타는 동작 허가 신호 *CE 및 기록 허가 신호 *WE의 변화에 동기하여 레지스터(12)에 셋트된다. 또한, 온보드 신호 OB가 논리값 「1」이므로 D형 플립플롭(19)의 입력은 보호 데이타 식별 회로(16)의 출력에 의존한다. 즉, 보호 데이타 식별 회로(16)의 출력이 논리값「0」이므로 D형 플립플롭(19)의 입력은 논리값「1」이다. 또한, 기록 금지 신호 WI는 페이지 버퍼(14)에 대한 기억이 종료할 때까지 주기적 간격으로 발생하지만, 강제 설정 신호 PL이 논리값「1」이므로 레지스터(12)의 해독에 지장은 없다. 그리고, 페이지 버퍼(14)에 대한 데이타 기억 동작 종료로부터 소정 시간(예를 들면 300μsec) 경과 후에 발생하는 클럭 CLK2에 동기하여 D형 플립플롭(19)은 논리값「1」을 유지한다. 즉, RS형 플립플롭(25)의 리셋트에 따라 제어 신호 WRT는 하강하여, 플래시 메모리(9)의 기록 동작은 금지된다.When an interrupt request for rewriting a program command in the address area occurs when the microcomputer is executing various logical arithmetic operations in accordance with the decoding result of the program command in the address area A of the flash memory 9, the program counter 29 The value of jumps from the address area A to the address area B. Then, the microcomputer starts the rewrite operation in accordance with the decoding result of the rewrite command in the address area B. FIG. At this time, the CPU 28 always outputs the onboard signal OB having the logic value "1". When the operation permission signal * CE and the write permission signal * WE fall, the control signal WRT rises in accordance with the set of the RS flip-flop 25, and the internal cells of the address area A of the flash memory 9 are in a writeable state. do. The protection data is set in the register 12 in synchronization with the change of the operation permission signal * CE and the write permission signal * WE. In addition, since the onboard signal OB is a logic value "1", the input of the D-type flip-flop 19 depends on the output of the protection data identification circuit 16. That is, since the output of the protection data identification circuit 16 is a logic value "0", the input of the D-type flip-flop 19 is a logic value "1". The write prohibition signal WI is generated at periodic intervals until the storage of the page buffer 14 ends, but since the forced setting signal PL is a logic value "1", there is no problem in the decoding of the register 12. Then, the D flip-flop 19 holds the logic value "1" in synchronization with the clock CLK2 generated after a predetermined time (for example, 300 mu sec) has elapsed from the end of the data storage operation to the page buffer 14. That is, the control signal WRT falls in accordance with the reset of the RS flip-flop 25, and the write operation of the flash memory 9 is prohibited.

이상에 의해, 본 발명의 실시 형태에 따르면, 플래시 메모리(9)의 어드레스영역 B의 재기록 명령을 이용하여 어드레스 영역 A의 프로그램 명령을 재기록하는경우, 보호용 셀(15)의 상태에 상관 없이 보호 데이타의 해독 결과가 올바른 경우에만 플래시 메모리(9)의 재기록 동작을 허가하도록 하였다. 따라서, 마이크로컴퓨터의 프로그램 처리가 폭주하여 보호 데이타가 잘못된 경우, 플래시 메모리(9)의 어드레스 영역 A의 재기록 동작을 확실하게 금지할 수 있다.As described above, according to the embodiment of the present invention, when the program command in the address area A is rewritten using the rewrite command in the address area B of the flash memory 9, the protection data is independent of the state of the protective cell 15. The rewrite operation of the flash memory 9 is allowed only when the decryption result of the is correct. Therefore, when the program processing of the microcomputer is congested and the protection data is wrong, the rewriting operation of the address area A of the flash memory 9 can be reliably prevented.

본 발명에 의하면, 불휘발성 메모리의 제2 기억 영역의 재기록 명령을 이용하여 제1 기억 영역의 프로그램 명령을 재기록하는 경우, 보호용 셀의 상태에 상관없이 보호 데이타의 해독 결과가 올바른 경우에만 불휘발성 메모리의 재기록 동작을 허가하도록 하였다. 따라서, 마이크로컴퓨터의 프로그램 처리가 폭주하여 보호 데이타가 잘못된 경우, 불휘발성 메모리의 제1 기억 영역의 재기록 동작을 확실하게 금지시킬 수 있는 이점이 얻어진다.According to the present invention, in the case of rewriting the program command of the first storage area using the rewrite command of the second storage area of the nonvolatile memory, the nonvolatile memory only when the result of decryption of the protection data is correct regardless of the state of the protective cell. To allow the rewrite operation. Thus, when the program processing of the microcomputer is congested and the protected data is wrong, an advantage can be reliably prevented from rewriting the first storage area of the nonvolatile memory.

Claims (1)

데이타를 일괄 또는 부분적으로 전기 소거할 수 있고 또한 데이타를 기록 및 판독할 수 있는 특성을 지니고, 제1 기억 영역에 각종 논리 연산을 실행시키기 위한 프로그램 명령이 기억되고 제2 기억 영역에 상기 제1 기억 영역의 내용을 재기록하기 위한 재기록 명령이 기억된 불휘발성 메모리와, 상기 불휘발성 메모리의 제1 기억 영역의 잘못된 재기록을 방지하기 위한 보호 데이타가 셋트되는 레지스터와, 상기 레지스터의 값을 해독하여 해독 결과에 따라 상기 불휘발성 메모리의 제1 기억 영역의 재기록을 허가 또는 금지시키는 디코더와, 외부의 재기록 및 내부의 재기록의 허가 조건을 변경하기 위한 값을 기억하는 보호용 셀을 포함하는 마이크로컴퓨터에 있어서,Having a characteristic that data can be erased collectively or partially, and that data can be written and read, a program instruction for executing various logical operations in a first storage area is stored and the first storage in a second storage area. A nonvolatile memory in which a rewrite command for rewriting the contents of the area is stored, a register in which protection data for preventing erroneous rewriting of a first storage area of the nonvolatile memory is set, and a value of the register is decrypted to decrypt the result. A microcomputer comprising a decoder which permits or prohibits rewriting of a first storage area of the nonvolatile memory according to the present invention, and a protective cell which stores a value for changing conditions for permitting external rewrite and internal rewrite. 외부로부터의 제어에 의해 상기 제1 기억 영역을 재기록할 때, 상기 보호용셀의 특정값에 대응하여 상기 불휘발성 메모리의 제1 기억 영역을 재기록 가능하게 함과 동시에, 상기 불휘발성 메모리의 제2 기억 영역의 재기록 명령을 사용하여 제1 기억 영역의 프로그램 명령을 재기록할 때, 상기 보호용 셀의 값에 상관없이 상기 레지스터에 올바른 보호 데이터가 셋트된 경우에만, 상기 불휘발성 메모리의 제1 기억 영역의 재기록을 허가하는 수단을 포함하는 것을 특징으로 하는 마이크로컴퓨터.When rewriting the first storage area by external control, the first storage area of the nonvolatile memory can be rewritten in correspondence to a specific value of the protective cell, and the second memory of the nonvolatile memory is rewritten. When rewriting the program command of the first storage area using the rewrite command of the area, rewriting of the first storage area of the nonvolatile memory only when the correct protected data is set in the register regardless of the value of the protective cell. And a means for authorizing.
KR1019990010376A 1998-03-26 1999-03-25 Microcomputer KR100341424B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP1998-078779 1998-03-26
JP07877998A JP3197865B2 (en) 1998-03-26 1998-03-26 Microcomputer

Publications (2)

Publication Number Publication Date
KR19990078265A KR19990078265A (en) 1999-10-25
KR100341424B1 true KR100341424B1 (en) 2002-06-22

Family

ID=13671390

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019990010376A KR100341424B1 (en) 1998-03-26 1999-03-25 Microcomputer

Country Status (3)

Country Link
JP (1) JP3197865B2 (en)
KR (1) KR100341424B1 (en)
TW (1) TW432329B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6300308B1 (en) 1997-12-31 2001-10-09 Board Of Regents, The University Of Texas System Methods and compositions for inducing autoimmunity in the treatment of cancers
JP2002245023A (en) * 2001-02-16 2002-08-30 Mitsubishi Electric Corp Microcomputer
JP4958201B2 (en) * 2001-03-30 2012-06-20 ルネサスエレクトロニクス株式会社 Microcomputer
JP4953788B2 (en) * 2006-12-05 2012-06-13 株式会社デンソー Electronic equipment
JP2010170579A (en) * 2010-04-19 2010-08-05 Renesas Technology Corp Data processor

Also Published As

Publication number Publication date
TW432329B (en) 2001-05-01
JPH11272472A (en) 1999-10-08
JP3197865B2 (en) 2001-08-13
KR19990078265A (en) 1999-10-25

Similar Documents

Publication Publication Date Title
US6229731B1 (en) Nonvolatile semiconductor memory device with security function and protect function
US5826007A (en) Memory data protection circuit
KR100301409B1 (en) Semiconductor memory device having data protection feature
US5890191A (en) Method and apparatus for providing erasing and programming protection for electrically erasable programmable read only memory
KR100255568B1 (en) Microcomputer having a reloadable non-volatile memory
US5812446A (en) Method and apparatus for the protection of non-volatile memory zones
KR100341424B1 (en) Microcomputer
US7027350B2 (en) Device and method for partial read-protection of a non-volatile storage
JP2547379B2 (en) Portable data carrier
JPWO2006040798A1 (en) Semiconductor integrated circuit device and electronic system
JP3073748B2 (en) Erasable and rewritable ROM protection device
US20020174310A1 (en) Non-volatile memory
US20040186947A1 (en) Access control system for nonvolatile memory
US6125054A (en) Rom data read protect circuit
JP2002015584A (en) Read/protect circuit for non-volatile memory
US5928361A (en) Data security device and method thereof
JPH0371356A (en) Memory system
JP3028567B2 (en) Microcomputer with built-in EEPROM
JP3695931B2 (en) Microcomputer
US20220113879A1 (en) System with Increasing Protected Storage Area and Erase Protection
JP2000276461A (en) Microcomputer
JP4118023B2 (en) Memory control circuit
KR100905640B1 (en) Flash memory protect circuit
JP2701790B2 (en) Nonvolatile semiconductor memory device
JP4848126B2 (en) Microcomputer, data protection method for nonvolatile memory in microcomputer

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20080522

Year of fee payment: 7

LAPS Lapse due to unpaid annual fee