JPH03186927A - Program alteration device for microcomputer - Google Patents

Program alteration device for microcomputer

Info

Publication number
JPH03186927A
JPH03186927A JP1325876A JP32587689A JPH03186927A JP H03186927 A JPH03186927 A JP H03186927A JP 1325876 A JP1325876 A JP 1325876A JP 32587689 A JP32587689 A JP 32587689A JP H03186927 A JPH03186927 A JP H03186927A
Authority
JP
Japan
Prior art keywords
program
data
address
rom
change
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
JP1325876A
Other languages
Japanese (ja)
Inventor
Azuma Miyazawa
東 宮沢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Olympus Corp
Original Assignee
Olympus Optical Co Ltd
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 Olympus Optical Co Ltd filed Critical Olympus Optical Co Ltd
Priority to JP1325876A priority Critical patent/JPH03186927A/en
Publication of JPH03186927A publication Critical patent/JPH03186927A/en
Priority to US08/040,562 priority patent/US5357627A/en
Priority to US08/544,694 priority patent/US5592613A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To facilitate modification of a program by using program altering RAM incorporated in a one chip microcomputer, and a nonvolatile memory which is externally connected to the microcomputer, which stores program altering data and capable of serial communication. CONSTITUTION:When alteration address data A1 which is set in an address data area 11a coincides with the output content of a program counter 1, an output permission signal is transmitted from a coincidence detection means 13a to a vector table 12a and only the data output of the vector table 12a is transmitted to a program counter value alteration means 14. When the output of the coincidence detection means 13a is simultaneously inputted to an interruption generation circuit 16 through an OR circuit 15, interruption occurs and a vector address 1 from the vector table 12a is inputted to the program counter alteration means 14 by the interruption. The means 14 refers to the content AAAA of the vector address 1 and alters the content of the program counter 1 to AAAA. Thus, the content of a ROM program can easily be altered.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、マイクロコンピュータシステムに係り、詳し
くはリードオンリメモリの修正すべきプログラムデータ
に代えて修正されたプログラムデータを出力するマイク
ロコンピュータ(以下、マイコンと略記する。)のプロ
グラム変更装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a microcomputer system, and more particularly to a microcomputer (hereinafter referred to as "microcomputer") that outputs modified program data in place of program data to be modified in a read-only memory. , abbreviated as microcomputer).

[従来の技術] 一般的に、従来のワンチップマイコンは、第10図に示
すように、プログラムカウンタPC1所定のプログラム
が書込まれたプログラムメモリPMおよび命令デコーダ
IDを有する。このワンチップマイコンの動作はよく知
られているように、システムクロック(図示せず)によ
ってカウントアツプするプログラムカウンタPcによっ
てアドレスが指定されるプログラムメモリPMから続出
されるデータが命令デコーダIDによってデコードされ
ることによってプログラムが実行される。
[Prior Art] Generally, a conventional one-chip microcomputer includes a program counter PC1, a program memory PM in which a predetermined program is written, and an instruction decoder ID, as shown in FIG. As is well known, the operation of this one-chip microcomputer is such that data successively outputted from a program memory PM whose address is specified by a program counter Pc counted up by a system clock (not shown) is decoded by an instruction decoder ID. The program is executed by

プログラムメモリPMは、−数的にマスクROM (リ
ードオンリーメモリ)が用いられ、このマスクROMは
メーカの製造工程てメーカによりプログラムが書込まれ
、ユーザによる書換えは不可能である。
As the program memory PM, a mask ROM (read only memory) is numerically used, and a program is written into the mask ROM by the manufacturer during the manufacturer's manufacturing process, and cannot be rewritten by the user.

また、最近では、ユーザによる書換えが1回だけ可能な
ワンタイムROMと呼ばれるものも販売されている。
Furthermore, recently, a so-called one-time ROM, which can be rewritten only once by the user, is also on sale.

しかし、ワンチップマイコンの製造後にマスクROMの
書込みプログラムにバグなどが発見された場合やその一
部を修正したい場合、再度、ROMのマスクパターンを
書換えてから集積回路の製造プロセスをやり直す必要が
あるので、修正されたワンチップマイコンを人手するま
での期間が現状では数ケ月もかかる。
However, if a bug is discovered in the mask ROM writing program after manufacturing the one-chip microcontroller, or if you want to correct a part of it, it is necessary to rewrite the ROM mask pattern and restart the integrated circuit manufacturing process. Therefore, it currently takes several months to manually create a modified one-chip microcontroller.

しかも、マスクROMの書込みプログラムにバグなどが
発見されたワンチップマイコンは再利用することができ
ない。また、ワンタイムROMはマスクROMに比べて
非常に高価であり、ユーザがプログラムを書込むのに非
常に時間がかかり、量産品への採用には不向きである。
Moreover, a one-chip microcomputer in which a bug has been found in the mask ROM writing program cannot be reused. Furthermore, one-time ROMs are much more expensive than mask ROMs, and it takes much time for a user to write a program, making them unsuitable for mass-produced products.

このような課題を解決すべく、本発明者らは、「特願平
コ、−131861号」により、データ書換え用の電気
的に書込み可能な不揮発性メモリ部をワンチップマイコ
ンに内蔵することによってプログラムデータを修正する
方法を提案した。
In order to solve these problems, the inventors of the present invention have developed an electrically writable non-volatile memory section for data rewriting into a one-chip microcontroller in accordance with "Japanese Patent Application No. 131861". A method to modify program data was proposed.

この方法は、ワンチップマイコン内の電気的に書込み可
能な不揮発性メモリ部に修正したいプログラムアドレス
および修正プログラムを記憶する場所を指定し、プログ
ラムカウンタと上記不揮発性メモリ部内の修正したいプ
ログラムアドレスとが一致した場合に修正プログラムを
実行するものであった。
In this method, a program address to be modified and a location for storing the modified program are specified in an electrically writable non-volatile memory section in a one-chip microcontroller, and the program counter and the program address to be modified in the non-volatile memory section are specified. If there is a match, the update program will be executed.

こうすることにより、ワンチップマイコンの量産後にプ
ログラムのバグが発見された場合やその一部を修正した
い場合でも、再度、マスクROMを修正することなくプ
ログラムを変更でき、生産工程を止めなくて済む。
By doing this, even if a bug in the program is discovered after mass production of the one-chip microcontroller, or if a part of it needs to be fixed, the program can be changed without having to modify the mask ROM again, eliminating the need to stop the production process. .

[発明が解決しようとする課題] 上記したような方法は、比較的簡単な回路構成で実現可
能ではあるが、通常、CMO8(相補性絶縁ゲート型)
プロセスで製造されるワンチップマイコン内に電気的に
書込み可能な不揮発性メモリ部を作り込むプロセスが追
加する必要が生じるので、結果的に、ワンチップマイコ
ンのコストが上昇してしまうという問題がある。しかも
、内蔵した不揮発性メモリ部の容量の全てを使うとは限
らす、むしろ、全部は使わないことの方が多いので、容
量の無駄が生じる。
[Problems to be Solved by the Invention] Although the method described above can be realized with a relatively simple circuit configuration, it is usually
Since it is necessary to add an electrically writable non-volatile memory part into the one-chip microcontroller manufactured by the process, there is a problem in that the cost of the one-chip microcontroller increases as a result. . Furthermore, not all of the capacity of the built-in non-volatile memory section is used; in fact, all of it is often not used, resulting in wasted capacity.

このような問題を解決するために、ポートとアドレスバ
ス、データバスを切換えて、プログラムメモリをパラレ
ルデータ通信タイプのデバイスにより外付は拡張できる
方式のマイコンを使用することが考えられるが、これは
、ポートの有効活用上望ましくない。
In order to solve this problem, it is possible to use a microcontroller that can switch the port, address bus, and data bus and expand the program memory externally with a parallel data communication type device, but this is not possible. , which is undesirable in terms of effective use of ports.

本発明は、このような課題に着目してなされたもので、
ワンチップマイコン内のり−ドオンリメモリの書込みプ
ログラムにバグなどが発見された場合やその一部を修正
したい場合に、リードオンリメモリの内容を書換えるこ
となく、一部を疑似的に書換えてプログラムを修正でき
、あるいは、割込み処理を行わせることにより実質的に
プログラムの追加とか削除を行なうことができ、しかも
、ワンチップマイコンをCMOSプロセスのままで実現
し得るマイクロコンピュータのプログラム変更装置を提
供することを目的とする。
The present invention was made with attention to such problems,
If a bug is discovered in the read-only memory write program in a one-chip microcontroller, or if you want to fix a part of it, you can modify the program by pseudo-writing a part of it without rewriting the read-only memory contents. Alternatively, it is an object of the present invention to provide a microcomputer program changing device that can substantially add or delete programs by performing interrupt processing, and that can realize a one-chip microcomputer using a CMOS process. shall be.

[課題を解決するための手段] 本発明のマイクロコンピュータのプログラム変更装置は
、リードオンリメモリに記憶されたプログラム命令に従
って動作するワンチップマイコンと、このワンチップマ
イコンに信号線で接続されている不揮発性メモリとから
なるマイコンシステムにおいて、上記不揮発性メモリに
は上記リードオンリメモリのプログラム変更用の変更ア
ドレスおよび命令コードを記憶させておき、上記ワンチ
ップマイコンでは、例えば電源投入時のリセット直後の
命令で上記不揮発性メモリから変更アドレスおよび命令
コードを受信してランダムアクセスメモリに記憶してお
き、上記変更アドレスとプログラムカウンタの内容とを
比較し、一致した場合に」二記命令コードを実行するよ
うにしている。
[Means for Solving the Problems] A microcomputer program change device of the present invention includes a one-chip microcomputer that operates according to program instructions stored in a read-only memory, and a non-volatile microcomputer connected to the one-chip microcomputer by a signal line. In the microcomputer system, the nonvolatile memory stores a change address and instruction code for changing the program in the read-only memory. receives the modified address and instruction code from the non-volatile memory and stores them in the random access memory, compares the modified address with the contents of the program counter, and if they match, executes the instruction code 2. I have to.

[作 用コ ワンチップマイコン内のROMの書込みプログラムにバ
グなどが発見された場合やその一部を修正したい場合に
、このROMの修正したいアドレスに対応するアドレス
データと修正されたプログラムデータあるいは修正する
ための割込み用のプログラムデータをマイコンの外部に
設けられた不揮発性メモリに記憶させておき、ワンチッ
プマイコンの電源投入時のリセット直後の命令で不揮発
性メモリの記憶データをシリアル通信回路を介してプロ
グラム変更用のランダムアクセスメモリ(RAM)に読
み込む。これにより、プログラム変更用のRAMに記憶
されたアドレスデータとプログラムカウンタとが一致し
た時は、ROMの修正すべきプログラムデータに代えて
プログラム変更用のRAMに記憶されている修正された
プログラムデータが命令デコーダに出力される、あるい
は割込み用のプログラムデータに基すいて割込み処理が
行われるようになり、バグなどが修正されたプログラム
か実行される。なお、割込み処理では、メモリのデータ
の書換えとか、追加したい機能のサブルーチンのコール
とか、無条件ジャンプなどによりそれまでの処理の流れ
を変え、実質的にプログラムの追加とか削除を行なうこ
とが可能であり、プログラムの修正か可能になる。
[Operation] When a bug is discovered in the writing program of the ROM in the Cowanchip microcontroller, or when you want to correct a part of it, the address data corresponding to the address to be corrected in this ROM and the corrected program data or the corrected program data are Program data for interrupts is stored in a non-volatile memory provided outside the microcontroller, and the stored data in the non-volatile memory is sent via the serial communication circuit using a command immediately after a reset when the one-chip microcontroller is powered on. Load into random access memory (RAM) for program modification. As a result, when the address data stored in the RAM for program modification and the program counter match, the modified program data stored in the RAM for program modification is used instead of the program data to be modified in the ROM. Interrupt processing is now performed based on the program data output to the instruction decoder or for interrupts, and a program with bugs and the like corrected is executed. In addition, in interrupt processing, it is possible to change the flow of processing up to that point by rewriting data in memory, calling a subroutine for a function you want to add, or unconditionally jumping, and essentially adding or deleting a program. Yes, it is possible to modify the program.

[実施例コ 以下、図面を参照して本発明の実施例を詳細に説明する
[Embodiments] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

まず、本発明のマイコンのプログラム変更装置の概念を
第1図を参照して説明する。第1図に示すマイコンシス
テムにおいて、10はワンチップマイコン、20はこの
マイコン1oの外部に設けられ、このワンチップマイコ
ン10にセットずべきデータを記憶している電気的に書
込み可能な不揮発性メモリ、30は上記マイコン1oと
不揮発性メモリ20とを接続する信号!(例えばシリア
ル通信配線)である。
First, the concept of the microcomputer program changing device of the present invention will be explained with reference to FIG. In the microcomputer system shown in FIG. 1, 10 is a one-chip microcomputer, and 20 is an electrically writable nonvolatile memory that is provided outside the microcomputer 1o and stores data to be set in the one-chip microcomputer 10. , 30 is a signal connecting the microcomputer 1o and the nonvolatile memory 20! (For example, serial communication wiring).

上記ワンチップマイコン10において、1はプログラム
カウンタ、2は所定のプログラムが書込まれたマスクR
OM、3はプログラム変更用RAM、4はセレクタ、5
は命令デコーダ、6はメインメモリ用のRAM、7はシ
リアル通信回路であって、前記配線30を介して前記不
揮発性メモリ20に接続されている。
In the one-chip microcomputer 10, 1 is a program counter, and 2 is a mask R in which a predetermined program is written.
OM, 3 is RAM for program change, 4 is selector, 5
is an instruction decoder, 6 is a RAM for main memory, and 7 is a serial communication circuit, which is connected to the nonvolatile memory 20 via the wiring 30.

上記プログラムカウンターは、ROM2だけでなく、プ
ログラム変更用RAM3にもアドレス値を与えるように
接続されている。
The program counter is connected not only to the ROM 2 but also to the program changing RAM 3 so as to provide an address value.

前記プログラム変更用RAM3は、ROM2の書込みプ
ログラムにバグなどが発見された場合やその一部を修正
したい場合に、このROM2の修正したいアドレスに対
応するアドレスデータおよび修正するためのプログラム
データが対応して書込まれる変更アドレスRAM31お
よびプログラムRAM32を有する。これらのアドレス
データおよびプログラムデータは、ワンチップマイコン
10の電源投入(パワーオン)時のリセット直後の命令
で前記不揮発性メモリ2oの記憶データが前記シリアル
通信回路7を介してシリアル通信により読み込まれるよ
うになっており、上記プログラム変更用RAM3は実質
的に不揮発性メモリと同等になる。
The program change RAM 3 is used to store address data corresponding to the address to be corrected and program data for correction when a bug is discovered in the program written in the ROM 2 or when a part of it is desired to be corrected. It has a change address RAM 31 and a program RAM 32 in which changes are written. These address data and program data are stored in the nonvolatile memory 2o so that the data stored in the nonvolatile memory 2o is read by serial communication via the serial communication circuit 7 in response to a command immediately after a reset when the one-chip microcomputer 10 is powered on. The program change RAM 3 is substantially equivalent to a non-volatile memory.

前記セレクタ4は、通常はROM2の出力データを選択
して命令デコーダ5に人力させるが、変更アドレスRA
M3 ]−に記憶されたアドレスデータとプログラムカ
ウンタ1の出力内容とが一致したときにプログラムRA
M32からプログラムデータが出力すると、このプログ
ラムRAM32の出力データ(修正されたプログラムデ
ータ)をROM2の出力データ(修正すべきプログラム
データ)に代えて選択して命令デコーダ5に人力させる
ように構成されている。
The selector 4 normally selects the output data of the ROM 2 and inputs it manually to the instruction decoder 5, but the selector 4 selects the output data of the ROM 2 and manually inputs the data to the instruction decoder 5.
M3] - When the address data stored in - and the output contents of program counter 1 match, the program RA
When program data is output from M32, the output data of the program RAM 32 (corrected program data) is selected in place of the output data of the ROM 2 (program data to be corrected) and the instruction decoder 5 is manually operated. There is.

一方、前記不揮発性メモリ20としては、電気的に消去
可能なEEFROM、紫外線消去型のEFROM、ワン
タイムFROM、バックアップ電池付きの通常のRAM
でもよいが、ここでは、シリアル通信可能なEEPRO
Mを示している。
On the other hand, the non-volatile memory 20 may include an electrically erasable EEFROM, an ultraviolet erasable EFROM, a one-time FROM, and a normal RAM with a backup battery.
However, here, we use EEPRO that can communicate serially.
It shows M.

この場合、最近のカメラシステム等は、製品組立 0 て後の調整データの記憶用としてE E、 F ROM
を用いるものが多く、しかも、EEFROMのビット容
量当りの価格もかなり下かってきている。そこで、上記
EEFROMの調整データ記憶部以外の残りの部分をプ
ログラム変更用データの記憶用として使用すれば、製品
のコストアップを伴うことなくプログラムを変更するこ
とかできる。
In this case, recent camera systems use E, F ROM to store adjustment data after product assembly.
In addition, the price per bit capacity of EEFROM has come down considerably. Therefore, if the remaining portion of the EEFROM other than the adjustment data storage section is used for storing program change data, the program can be changed without increasing the cost of the product.

第2図は、上記EEFROM20のデータマツプの一例
を示している。すなわち、EEPROM20の予め決め
られた番地までを調整データエリア、それ以降の番地(
ここでは、“hhh”番地以降)をプログラム変更デー
タエリアと決めておく。このプログラム変更データエリ
アは、変更アドレスデータエリア、変更プログラム容量
データエリア、変更プログラムデータエリアに分割して
おく。プログラム変更データエリアのデータ型式は、変
更アドレスデータエリアの変更アドレスデータ、変更プ
ログラム容量データエリアの変更プログラム容量データ
、変更プログラムデータエリアの変更プログラムデータ
が1組となっている。
FIG. 2 shows an example of a data map of the EEFROM 20. In other words, the area up to a predetermined address in the EEPROM 20 is the adjustment data area, and the subsequent addresses (
Here, the area after address "hhh" is determined to be the program change data area. This program change data area is divided into a change address data area, a change program capacity data area, and a change program data area. The data format of the program change data area is a set of change address data in the change address data area, change program capacity data in the change program capacity data area, and change program data in the change program data area.

1 すなわち、変更アドレスデータエリアにおいては、“h
hh”番地に変更したい第1の変更アドレスデータA1
をセットし、次に変更したい第2の変更アドレスデータ
A2、第3の変更アドレスブタA3、・・・第mの変更
アドレスデータAmかある場合には”hhh”番地の次
に続けて順次セットする。この場合、予め、マイコン内
の修正箇所は、変更アドレスRAMの容量によってm箇
所とされているものとする。従って、マイコンは、プロ
グラムのm箇所を変更することができるが、変更アドレ
スの箇所がm個より少ない場合は、絶対に修正を行わな
いROMアドレス、たとえば0000(H)等のデータ
を変更アドレスデータエリアの残りの部分にセットして
おき、このアドレス0000(H)の場合はROMプロ
グラムを修正しないように、マイコンのハードウェアを
構成すればよい。
1 In other words, in the changed address data area, “h
First change address data A1 that you want to change to address hh”
, then set the second change address data A2, the third change address button A3, ... if the m-th change address data Am exists, successively set it after the "hhh" address. do. In this case, it is assumed that the number of correction points in the microcomputer is determined in advance to be m depending on the capacity of the change address RAM. Therefore, the microcontroller can change m locations in the program, but if the number of modified address locations is less than m, the ROM address that will never be modified, for example, data such as 0000(H), will be changed to the modified address data. It is sufficient to configure the hardware of the microcomputer so that it is set in the remaining part of the area and the ROM program is not modified in the case of this address 0000 (H).

また、変更プログラム容量データエリアにおいては、“
hhh十m”番地以降に前記第1の変更アドレスデータ
A1−第mの変更アドレスデータ2 Amと対をなす変更プログラムの容量(長さ)を示す変
更プログラム容量データB1〜Bmを順次セットする。
In addition, in the changed program capacity data area, “
After address hhh10m'', modified program capacity data B1 to Bm indicating the capacity (length) of the modified program that is paired with the first modified address data A1 to the m-th modified address data 2Am are sequentially set.

この場合も、変更アドレスの箇所がm個より少ない場合
は、変更プログラム容量データエリアの残りの部分に0
000 (H)のデータをセットしておく。
In this case as well, if the number of changed addresses is less than m, the remaining part of the changed program capacity data area is filled with 0.
Set the data of 000 (H).

また、変更プログラムデータエリアにおいては、“hh
h+2m“番地以降に前記第1の変更アドレスデータA
1−第mの変更アドレスデータAmと対をなす変更プロ
グラムの内容を示す変更プログラムデータC1〜Cmを
順次セットする。ここで、変更プログラムデータC2の
先頭アドレスは”hhh+2m+Bl+1”番地、変更
プログラムデータCmの先頭アドレスは“hhh千2m
+81十B2+−B (m−1)+1”番地になる。
In addition, in the change program data area, “hh
The first changed address data A after address "h+2m"
1- Change program data C1 to Cm indicating the contents of the change program paired with the m-th change address data Am are sequentially set. Here, the starting address of the modified program data C2 is "hhh+2m+Bl+1", and the starting address of the modified program data Cm is "hhh 1,000 2m".
+810B2+-B (m-1)+1" address.

この場合も、変更アドレスの箇所がm個より少ない場合
は、変更プログラムデータエリアの残りの部分に0OO
OHのデータをセットしておく。
In this case as well, if the number of changed addresses is less than m, the rest of the changed program data area is filled with 0OO.
Set the OH data.

次に、第1図のマイコンの動作を説明する。このマイコ
ンの動作は、基本的には従来のマイコン3 の動作と同様であるが、さらに、ROM2の書込みプロ
グラムの一部が疑似的に書換えられてプログラムか修正
されるようになっている。すなわち、前記したようなE
EPROM20のプログラム変更データエリアのデータ
は、ワンチップマイコン10の電源投入時のリセット直
後の命令で前記シリアル通信回路7を介してシリアル通
信により読み込まれて前記プログラム変更用RAM3に
セットされる。この場合、変更アドレスデータエリアの
変更アドレスデータは変更アドレスRAM31に順次セ
ットされ、変更プログラム容量データエリアの変更プロ
グラム容量データおよび変更プログラムデータエリアの
変更プログラムデータはプログラムRAM32に順次セ
ットされる。そして、通常は、システムクロック(図示
せず)によってカウントアツプするプログラムカウンタ
1によってアドレスが指定されるROM2から読出され
るデータがセレクタ4により選択されて命令デコーダ5
によってデコードされることによってプログラムが実行
される。しかし、変更アドレスRAM 4 3]に記憶されているアドレスデータとプログラムカウ
ンタ1の出力内容とが一致したときにプログラムRAM
32からブロクラムデータか出力すると、このプログラ
ムRAM32の出力データ(修正されたプログラムデー
タ)がROM2の出力データ(修正すべきプログラムデ
ータ)に代わってセレクタ4により選択されて命令デコ
ーダ5に入力する。これにより、疑似的に書換えられた
プログラムが命令デコーダ5によってデコードされ、修
正されたプログラムか実行されることになる。
Next, the operation of the microcomputer shown in FIG. 1 will be explained. The operation of this microcomputer is basically the same as that of the conventional microcomputer 3, but in addition, a part of the program written in the ROM 2 is artificially rewritten to modify the program. In other words, E as described above
The data in the program change data area of the EPROM 20 is read by serial communication via the serial communication circuit 7 and set in the program change RAM 3 in response to a command immediately after the one-chip microcomputer 10 is reset when the power is turned on. In this case, the modified address data in the modified address data area is sequentially set in the modified address RAM 31, and the modified program capacity data in the modified program capacity data area and the modified program data in the modified program data area are sequentially set in the program RAM 32. Normally, data read from the ROM 2 whose address is specified by a program counter 1 counted up by a system clock (not shown) is selected by a selector 4 and sent to an instruction decoder 5.
The program is executed by being decoded by However, when the address data stored in the changed address RAM 4 3] and the output contents of the program counter 1 match, the program RAM
When the block diagram data is output from the program RAM 32, the output data of the program RAM 32 (corrected program data) is selected by the selector 4 and input to the instruction decoder 5 instead of the output data of the ROM 2 (program data to be corrected). As a result, the pseudo-rewritten program is decoded by the instruction decoder 5, and the modified program is executed.

次に、本発明の第1実施例を説明する。第3図は、変更
アドレスRAM31の一具体例を示しており、第4図は
、ROM2とプログラムRAM3とが同一アドレス空間
に配置されている場合のメモリマツプを示している。
Next, a first embodiment of the present invention will be described. FIG. 3 shows a specific example of the modified address RAM 31, and FIG. 4 shows a memory map when the ROM 2 and the program RAM 3 are arranged in the same address space.

第3図に示す変更アドレスRAM31は、アドレスデー
タ領域1.1 a〜1.1. mおよびベクターテーブ
ル12a〜12mおよび一致検出手段13a〜13mの
各1個を1組とする複数の組を持って 5 いる。
The modified address RAM 31 shown in FIG. 3 has address data areas 1.1a to 1.1. m, vector tables 12a to 12m, and matching detection means 13a to 13m.

上記アドレスデータ領域1.1 a〜]−1,mには対
応して前記変更アドレスデータA]〜Amがセットされ
、ベクターテーブル1.2 a〜1.2mには割込み処
理の先頭アドレス(」二記変更アドレスデータA1〜A
mと対をなす変更プログラムデータC1〜Cmの先頭ア
ドレス)を格納しているプログラムRAMのベクターア
ドレス1〜mのデータがセットされている。
The above address data areas 1.1 a to ]-1 and m are set with the changed address data A] to Am, and vector tables 1.2 a to 1.2 m contain the start address ('') of the interrupt processing. 2. Changed address data A1-A
The data of vector addresses 1 to m of the program RAM storing the starting addresses of changed program data C1 to Cm paired with m are set.

上記複数の組の一致検出手段13a〜13mにはプログ
ラムカウンタ1の値が入力し、これらのうちどれかで一
致が検出されると、一致したアドレスデータ領域11i
(a=1、・・・m)と同し組のベクターテーブル12
1に出力許可信号を送り、そのベクターテーブル12i
のデータ出力のみかプログラムカウンタ値変更手段14
に伝えられる。
The value of the program counter 1 is input to the plurality of sets of match detection means 13a to 13m, and when a match is detected in any of them, the matched address data area 11i
Vector table 12 of the same group as (a=1,...m)
1, and sends an output permission signal to the vector table 12i.
Only data output or program counter value changing means 14
can be conveyed to.

また、上記複数の組の一致検出手段13a〜13mの各
出力はオア回路15を経て割込み発生回路16に人力し
、複数の組のうちどれかで一致が検出され、且つ、割り
込み許可フラグの内容が6 許可であると、割込みか発生し、プログラムカウンタ値
変更手段14により、一致した組のベクターテーブル1
21の値がプログラムカウンタ1に書込まれ、同時に、
プログラムカウンタ]の値がスタック(図示せず)に退
避される。また、割込み許可フラグの内容が禁止であれ
ば、割込みが発生せず、プログラムカウンタ]の値は変
化しない。
Further, each output of the plurality of pairs of coincidence detecting means 13a to 13m is input to the interrupt generation circuit 16 via the OR circuit 15, and if a coincidence is detected in any one of the plurality of pairs, and the contents of the interrupt permission flag are If 6 is permitted, an interrupt occurs, and the program counter value changing means 14 updates the vector table 1 of the matching set.
A value of 21 is written to program counter 1, and at the same time,
program counter] is saved to a stack (not shown). Furthermore, if the contents of the interrupt permission flag are prohibited, no interrupt occurs and the value of the program counter does not change.

第4図に示すメモリマツプにおいては、ROM領域のア
ドレスに続いてプログラムRAM領域のアドレスが割当
てられている。プログラムRAM飴域においては、ベク
ターアドレス1〜mに続いて変更プログラムデータc1
〜Cmが順次セットされている。この場合、ベクターア
ドレス1には、変更プログラムデータc1の先頭アドレ
スヘジャンプするためのアドレスデータAAAAがセッ
トされている。ベクターアドレスデータ2〜mには、変
更プログラムデータC2〜Cmの先頭アドレスヘジャン
ブするためのアドレスデータBBBB〜MMMMがセッ
トされている。このアドレスデータB B B B−M
MMMハ、EEPROM20から7 のデータ読み込み直後に変更プログラム容量データにし
たがって計算された後に再セットされる。
In the memory map shown in FIG. 4, the address of the program RAM area is assigned following the address of the ROM area. In the program RAM candy area, following vector addresses 1 to m, change program data c1
~Cm are set sequentially. In this case, address data AAAA for jumping to the start address of the changed program data c1 is set in the vector address 1. Address data BBBB-MMMM for jumping to the start address of the changed program data C2-Cm is set in the vector address data 2-m. This address data B B B B-M
Immediately after reading data from the EEPROMs 20 to 7, the MMM is calculated according to the changed program capacity data and then reset.

ここで、代表的に第1組の変更プログラムを例にとって
ROMプログラム変更のンーケンスを説明する。
Here, the sequence of changing the ROM program will be explained by taking the first set of change programs as an example.

まず、アドレスデータ領域11aに変更アドレスデータ
A土がセットされている。いま、このアドレスデータ領
域11aにセットされている変更アドレスデータA1と
プログラムカウンタ1の出力内容とが一致すると、一致
検出手段1.3 aからベクターテーブル12aに出力
許可信号を送り、このベクターテーブル12aのデータ
出力(第4図中のベクターアドレス1)のみがプログラ
ムカウンタ値変更手段14に伝えられる。同時に、致検
出手段13aの出力がオア回路15を経て割込み発生回
路]6に入力すると、割込みが発生し、この割込みによ
り、前記ベクターテーブル12 aからのベクターアド
レス1がプログラムカウンタ値変更手段14に人力され
、ここで、ベクターアドレス1の内容AAAAを参照し
てプログラムヵ8 ウンタ1の内容をAAAAに変更する。従って、このプ
ログラムカウンタ1によりアドレス指定されたプログラ
ムRAM領域の変更プログラムデータB1がROM2の
出力データ(修正すべきプログラムデータ)に代わって
セレクタ4により選択されて命令デコーダ5に人力する
。これにより、疑似的に書換えられたプログラムが命令
デコーダ5によってデコードされ、第1組の変更プログ
ラムが実行されるようになり、ROMプログラムのAA
AA番地の内容が実質的に変更されることになる。
First, changed address data A is set in the address data area 11a. When the changed address data A1 currently set in this address data area 11a matches the output content of the program counter 1, an output permission signal is sent from the match detection means 1.3a to the vector table 12a, and this vector table 12a is Only the data output (vector address 1 in FIG. 4) is transmitted to the program counter value changing means 14. At the same time, when the output of the error detecting means 13a is input to the interrupt generating circuit 6 via the OR circuit 15, an interrupt occurs, and this interrupt causes the vector address 1 from the vector table 12a to be changed to the program counter value changing means 14. Here, the content of the program counter 8 is changed to AAAA by referring to the content AAAA of the vector address 1. Therefore, the modified program data B1 of the program RAM area addressed by the program counter 1 is selected by the selector 4 and input to the instruction decoder 5 instead of the output data of the ROM 2 (program data to be modified). As a result, the pseudo-rewritten program is decoded by the instruction decoder 5, and the first set of changed programs is executed.
The contents of the AA address will be substantially changed.

なお、上記変更プログラムの最後の行に、ROM領域内
の戻したい番地へのジャンプ命令を書いておけば、任意
の長さのROM上のプログラムを任意の長さのRAM上
のプログラムに変更することができる。
If you write a jump instruction to the address you want to return to in the ROM area on the last line of the above change program, you can change a program in ROM of any length to a program in RAM of any length. be able to.

なお、第3図に示した変更アドレスRAM31は、割込
み発生回路16を用いてプログラムカウンタ値変更手段
14に指示を与えたが、割込み発生回路16は特に必要
とするものではなく、オア9 回路15の出力により直接にプログラムカウンタ値変更
手段14に指示を与えるようにしてもよい。
Note that the change address RAM 31 shown in FIG. 3 uses the interrupt generation circuit 16 to give instructions to the program counter value change means 14, but the interrupt generation circuit 16 is not particularly required, and the OR 9 circuit 15 An instruction may be directly given to the program counter value changing means 14 by the output.

次に、本発明のマイコンの第2実施例を説明する。この
第2実施例は、実際に、ROMプログラムのバグなどを
修正する場合は、1〜2行のプログラムを修正すれば済
むことが非常に多いことに着目し、ROMプログラムの
任意の1行のみを変更して実行するためのものであり、
第1実施例と比べて、EEPROM20のデータ型式(
データ構成)を第5図に示すように変更し、プログラム
変更用RAMの構成を第6図に示すように変更した点が
異なり、その他は同じであるので第1実施例中と同一符
号を付している。
Next, a second embodiment of the microcomputer of the present invention will be described. This second embodiment focuses on the fact that, when actually correcting a bug in a ROM program, it is often enough to correct one or two lines of the program. is for modifying and running
Compared to the first embodiment, the data type of the EEPROM 20 (
The difference is that the data structure) has been changed as shown in FIG. 5, and the configuration of the program change RAM has been changed as shown in FIG. are doing.

すなわち、EEPROM20においては、第5図に示す
ように、予め決められた番地までを調整データエリア、
それ以降の番地をプログラム変更データエリアと決めて
おく。そして、プログラム変更データエリアには、プロ
グラム変更データエリアに変更させたいアドレスのデー
タと変更プログラム1行分とのペアを、変更させたい組
数だけ0 連続して順次セットしておく。この場合、変更アドレス
データエリアの残りの部分には、前記したような000
0 (H)のデータをセットしておく。
That is, in the EEPROM 20, as shown in FIG.
The addresses after that are determined to be the program change data area. Then, in the program change data area, pairs of data at an address to be changed and one line of the change program are successively set as many pairs as the number of pairs desired to be changed. In this case, the remaining part of the changed address data area contains 000 as described above.
0 (H) data is set.

また、プログラム変更用RAMにおいては、第6図に示
すように、所望のデータ修正数に対応して設けられた複
数(n)個のデータ修正ブロック61〜6nを設ける。
Further, in the program change RAM, as shown in FIG. 6, a plurality (n) of data correction blocks 61 to 6n are provided corresponding to the desired number of data corrections.

この各ブロック61〜6nにおいて、一対のメモリ領域
としてアドレスデータ領域62およびプログラムデータ
領域63が確保されており、このアドレスデータ領域6
2およびプログラムデータ領域63にはシリアル通信に
より変更アドレスおよび変更プログラム1行分のデータ
が対応してセットされる。この場合、データ修正ブロッ
ク61〜6nに対して、変更アドレスおよび変更プログ
ラム1行分のデータが順次セットされる。さらに、アド
レスデータ領域62およびプログラムデータ領域63に
対して1つのブタ判定回路64が設けられており、この
データ判定回路64は、プログラムカウンタ1からのア
ドレス人力とアドレスデータ領域62に記憶され1 ている変更アドレスとを比較判定し、一致時には一致信
号出力を活性化してプログラムデータ領域63に出力許
可信号を与えると共にオア回路65に人力する。上記出
力許可信号は、プログラムデータ領域63に記憶されて
いるプログラムデータ(修正データ)を出力させるよう
に制御し、各ブロック61〜6nの出力データ(修正デ
ータ)は、共通のバスを経てセレクタ4のデータ人力と
なる。
In each of these blocks 61 to 6n, an address data area 62 and a program data area 63 are secured as a pair of memory areas, and this address data area 6
2 and the program data area 63, a modified address and data for one line of the modified program are correspondingly set by serial communication. In this case, the modified address and data for one line of the modified program are sequentially set in the data modification blocks 61 to 6n. Further, one pig judgment circuit 64 is provided for the address data area 62 and the program data area 63, and this data judgment circuit 64 is configured to detect the address input from the program counter 1 and the data stored in the address data area 62. When a match is found, a match signal output is activated, an output permission signal is given to the program data area 63, and an output permission signal is sent to the OR circuit 65. The output permission signal controls the output of the program data (modified data) stored in the program data area 63, and the output data (modified data) of each block 61 to 6n is sent to the selector 4 via a common bus. Data becomes human power.

なお、各ブロック61〜6nが受は持つデータ修正箇所
(アドレス)は互いに異なるので、データ修正時にはど
れか1つのブロックから修正データが出力される。また
、上記オア回路65の出力はセレクタ4に対して切換制
御人力となり、上記オア回路65の出力はセレクタ4に
対して切換制御人力となり、このプログラム変更用RA
Mの出力データをROM2の出力データ(修正すべきプ
ログラムデータ)に代えて選択させる。
Note that each block 61 to 6n has a different data modification location (address), so when data is modified, modified data is output from one of the blocks. Further, the output of the OR circuit 65 serves as a manual switching control for the selector 4, and the output of the OR circuit 65 serves as a switching control manual for the selector 4.
The output data of M is selected instead of the output data of ROM2 (program data to be corrected).

上記した第2実施例では、基本的にはROMコードと同
じ長さもしくは短い長さのプログラムしか変更できない
。ここで、ROMコードと同じ長2 さのコードに変更する場合の一例を第7図に示す。
In the second embodiment described above, basically only a program having the same length or a shorter length than the ROM code can be changed. Here, an example of changing the code to a code having the same length as the ROM code is shown in FIG.

すなわち、ROMアドレスの例えば107Aから始まる
例えば2ハイド命令コード(9A、OE)を(9B、3
D)という2バイト命令コードに変更する場合、図示の
ように、EEPROM20の例えば変更アドレス1,2
および変更プログラム1.2に変更アドレスのデータと
変更プログラム1行分とのペア(1,07A、9B)、
(107B。
That is, for example, the 2-hide instruction code (9A, OE) starting from the ROM address 107A is converted to (9B, 3
When changing to the 2-byte instruction code D), for example, change addresses 1 and 2 of the EEPROM 20 as shown in the figure.
and a pair (1,07A, 9B) of the change address data and one line of the change program in change program 1.2,
(107B.

3D)を順次書き込んでおく。3D) in order.

また、ROMコードをこれより短いコードに変更する場
合の一例を第8図に示す。すなわち、例えばROMアド
レスの例えば107Aから始まる2バイト命令コードを
1バイト命令コードC1に変更する場合は、2バイト命
令コードが書き込まれている2つのROMアドレスのい
ずれかの内容をNOP命令コード(例えば00)に書換
えればよく、図示のように、EEPROM20の例えば
変更アドレス1.2および変更プログラム1,2に変更
アドレスのデータと変更プログラム1行分とのペア(1
07A、CI)、(107B、00)3 を順次書き込んでおく。
FIG. 8 shows an example of changing the ROM code to a shorter code. That is, for example, when changing a 2-byte instruction code starting from ROM address 107A to a 1-byte instruction code C1, change the contents of either of the two ROM addresses to which the 2-byte instruction code is written to a NOP instruction code (for example, 00), and as shown in the figure, a pair (1
07A, CI) and (107B, 00)3 are written in sequence.

上記したような2バイト命令コードの変更に準じて3バ
イト命令コード等も変更することができる。
The 3-byte instruction code, etc. can also be changed in accordance with the above-mentioned change of the 2-byte instruction code.

次に、前記第2実施例において、ROMコードをこれよ
り長いコードに変更する方法を説明する。
Next, a method of changing the ROM code to a longer code in the second embodiment will be explained.

第9図は、1バイト命令コードを3バイト命令コードに
変更する場合の一例として、ROMアドレスの例えば3
A02の1バイト命令コードC1を(79,46,B3
)という3バイト命令コードに変更する場合を示してい
る。この場合、ROMアドレスの3AO3,3AO4に
は、例えば図示のように、9ASOEのコードが書込ま
れているものとすれば、EEPROM20のプログラム
変更データエリアには、例えば図示のように、変更アド
レス1〜11および変更プログラム1〜11を使用して
変更アドレスのデータと変更プログラム1行分とのペア
を連続的に書き込んでおく。
FIG. 9 shows an example of changing a 1-byte instruction code to a 3-byte instruction code.
The 1-byte instruction code C1 of A02 is (79, 46, B3
) shows the case of changing to a 3-byte instruction code. In this case, if a code of 9ASOE is written in ROM addresses 3AO3 and 3AO4, for example as shown in the figure, then the program change data area of the EEPROM 20 will have a change address 1 as shown in the figure. -11 and change programs 1-11 are used to continuously write a pair of change address data and one line of change program.

ここで、1バイト命令コード90は、これに続く2バイ
トのコードにジャンプする命令であり、4 ROMアドレスのcooo以降は本発明のワンチップマ
イコンのプログラムで使用していない領域であるとする
Here, it is assumed that the 1-byte instruction code 90 is an instruction to jump to the following 2-byte code, and the area after 4 ROM address cooo is an area that is not used by the program of the one-chip microcomputer of the present invention.

次に、上記1バイト命令コードC1を3バイト命令コー
ド(79,46,B3)に変更するプログラムを実際に
実行する手順について説明する。
Next, a procedure for actually executing a program for changing the 1-byte instruction code C1 to a 3-byte instruction code (79, 46, B3) will be described.

まず、ROMアドレスの3A02〜3A04に変更アド
レス]〜3のデータが順次一致すると、ROMアドレス
の3A02の時にコードC1をコード90に書き換え、
ROMアドレスの3AO3の時にコード9AをコードC
Oに書き換え、ROMアドレスの3A04の時にコード
OEをコード00に書き換えるようになるので、命令コ
ード90を実行し、本発明のワンチップマイコンのプロ
グラムで使用していないROMアドレスのcoooにジ
ャンプする。ここで、ROMアドレスのcooo以降は
プログラムがない領域であるので自由に使用してもよい
。次に、ROMアドレスのcooo〜C002に変更ア
ドレス4〜6のデータが順次一致すると、変更プログラ
ム4〜65 に書き込んでおいた変更したい3バイト命令コード(7
9,46,B3)を実行するようになる。
First, when the data of ROM addresses 3A02 to 3A04 match the data of [change address] to 3 in sequence, code C1 is rewritten to code 90 at ROM address 3A02,
Code 9A and code C when ROM address is 3AO3
Since the code OE is rewritten to code 00 at ROM address 3A04, instruction code 90 is executed and jumps to ROM address cooo, which is not used in the program of the one-chip microcomputer of the present invention. Here, since the area after ROM address cooo is an area where there is no program, it may be used freely. Next, when the data of change addresses 4 to 6 sequentially match the ROM addresses cooo to C002, the 3-byte instruction code (7
9, 46, B3).

次に、ROMアドレスのC003、C004に変更アド
レス7.8のデータが順次一致すると、変更プログラム
7.8に書き込んでおいたROMアドレスの3AO3,
3AO4の2バイトのコードと同じコード(9A、OE
)を実行するようになる。そして、次に、ROMアドレ
スのC005〜COO7に変更アドレス9〜11のデー
タが順次一致すると、変更プログラム9〜11に書き込
んでおいたジャンプ命令90およびジャンプ先(3A、
05)のコードを実行し、ROMアドレスの3AO5に
戻るようになる。
Next, when the data of the change address 7.8 sequentially matches the ROM addresses C003 and C004, the ROM address 3AO3, which was written in the change program 7.8,
The same code as the 2-byte code of 3AO4 (9A, OE
) will now be executed. Then, when the data of changed addresses 9 to 11 sequentially match the ROM addresses C005 to COO7, the jump command 90 written in the changed programs 9 to 11 and the jump destination (3A,
05) is executed and returns to ROM address 3AO5.

以上の動作により、実質的には、1バイト命令コードを
3バイト命令コードに変更して実行したことになる。
The above operation essentially means that the 1-byte instruction code is changed to a 3-byte instruction code and executed.

上記したような変更方法を使用すれば、さらに長いプロ
グラムをROMコードに代えて実行することが可能にな
ることは言うまでもない。
It goes without saying that by using the above-described modification method, it becomes possible to execute even longer programs instead of using ROM code.

 6 [発明の効果] 以上詳述したように本発明のマイクロコンピュータのプ
ログラム変更装置によれば、ワンチップマイコンに内蔵
されたプログラム変更用RAMおよびマイコンに外付は
接続されてプログラム変更用データを記憶したシリアル
通信可能な不揮発性メモリを利用することにより、マイ
コンの電源投入時のリセット直後の命令で不揮発性メモ
リの変更記憶データをシリアル通信を介してプログラム
変更用のRAMに読み込むようにしている。これにより
、ROMの書込みプログラムにバグなどが発見された場
合やその一部を修正したい場合に、ROMの内容を書換
えることなく、一部を疑似的に書換えてプログラムを修
正することや、割込み処理を行わせることにより実質的
にプログラムの追加とか削除を行ない、プログラムを修
正することができる。
6 [Effects of the Invention] As described in detail above, according to the microcomputer program changing device of the present invention, the program changing RAM built in the one-chip microcomputer and the external device connected to the microcomputer can transfer program changing data. By using the stored non-volatile memory that can be used for serial communication, the changed data stored in the non-volatile memory is read into the RAM for program changes via serial communication in response to a command immediately after resetting when the microcontroller is powered on. . As a result, if a bug is discovered in the ROM writing program or if you want to modify a part of it, you can modify the program by pseudo rewriting a part of it without rewriting the ROM contents, or use the interrupt By performing the processing, it is possible to substantially add or delete programs and modify the program.

したがって、バグなどが発見されたマイコンを再利用す
ることができ、再度、ROMを作り直す必要がなくなり
、生産工程に影響を与えないで済 7 み、修正されたマイコンを短期間に人手することができ
る。実際に、バグなどを修正する場合は、1〜2行のプ
ログラムを修正すれば済むことが多いので、本発明のマ
イコンは極めて有用である。
Therefore, it is possible to reuse a microcontroller in which a bug has been found, eliminating the need to recreate the ROM, and without affecting the production process. can. In fact, when a bug is to be corrected, it is often enough to modify one or two lines of the program, so the microcomputer of the present invention is extremely useful.

しかも、ワンチップマイコンをCMOSプロセスのまま
で実現できるので、結果的に、ワンチップマイコンのコ
ストの上昇を抑制することができる。
Moreover, since the one-chip microcomputer can be realized using a CMOS process, the cost increase of the one-chip microcomputer can be suppressed as a result.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明のマイコンのプログラム変更装置の概念
を示す説明図、第2図は第1図中のEEPROMのデー
タ構成の一例を示す説明図、第3図は本発明の第1実施
例で使用されるプログラム変更用RAMの一具体例を示
すブロック図、第4図は本発明の第1実施例で使用され
るROMとプログラムRAMとが同一アドレス空間に配
置されている場合のメモリマツプを示す図、第5図は本
発明の第2実施例で使用されるEEPROMのデータ構
成を示す説明図、第6図は本発明の第2実施例で使用さ
れるプログラム変更用RAM8 の−具体例を示すブロック図、第7図は本発明の第2実
施例においてROMコードを同じ長さのコードに変更す
る場合のROMコードおよびEEFROMコードの一例
を示す図、第8図は本発明の第2実施例においてROM
コードをそれより短いコードに変更する場合のROMコ
ードおよびEEPROMコートの一例を示す図、第9図
は本発明の第2実施例においてROMコードをそれより
長いコードに変更する場合のROMコードおよびEEP
ROMコードの一例を示す図、第10図は従来のワンチ
ップマイコンを示すブロック図である。 1・・・プログラムカウンタ、2・・・ROM。 3・・・プログラム変更用RAM、4・・・セレクタ、
5・・・命令デコーダ、 6・・・シリアル通信回路、
7・・・不揮発性メモリ、1 ]、 a〜l1m・・・
アドレスデータ領域、12a〜12m・・・ベクターテ
ーブル、13a〜13m・・・一致検出手段、14・・
・プログラムカウンタ値変更手段、15・・・オア回路
、16・・・割込み発生回路、31・・・変更アドレス
9 AM。 プ ダラムRAM。 アドレスデータ領域、 3・・・プログラムデータ 領域、 64・・・データ判定回路、 5・・・オア回路。
FIG. 1 is an explanatory diagram showing the concept of a microcomputer program change device of the present invention, FIG. 2 is an explanatory diagram showing an example of the data structure of the EEPROM in FIG. 1, and FIG. 3 is a first embodiment of the present invention. FIG. 4 is a block diagram showing a specific example of a program changing RAM used in the first embodiment of the present invention. FIG. 5 is an explanatory diagram showing the data structure of the EEPROM used in the second embodiment of the present invention, and FIG. 6 is a specific example of the program change RAM 8 used in the second embodiment of the present invention. FIG. 7 is a block diagram showing an example of the ROM code and EEFROM code when changing the ROM code to a code of the same length in the second embodiment of the present invention, and FIG. 8 is a block diagram showing the second embodiment of the present invention. In the embodiment, ROM
FIG. 9 shows an example of the ROM code and EEPROM code when changing the code to a shorter code, and FIG. 9 shows the ROM code and EEPROM code when changing the ROM code to a longer code in the second embodiment of the present invention.
FIG. 10, which shows an example of a ROM code, is a block diagram showing a conventional one-chip microcomputer. 1...Program counter, 2...ROM. 3...RAM for program change, 4...Selector,
5... Instruction decoder, 6... Serial communication circuit,
7...Nonvolatile memory, 1], a~l1m...
Address data area, 12a to 12m... Vector table, 13a to 13m... Match detection means, 14...
・Program counter value changing means, 15... OR circuit, 16... Interrupt generation circuit, 31... Change address 9 AM. Pudalam RAM. Address data area, 3... Program data area, 64... Data judgment circuit, 5... OR circuit.

Claims (1)

【特許請求の範囲】 リードオンリメモリに記憶されたプログラム命令に従っ
て動作するワンチップマイクロコンピュータと、このワ
ンチップマイクロコンピュータに信号線で接続されてい
る不揮発性メモリとからなるマイクロコンピュータシス
テムにおいて、上記不揮発性メモリは、上記リードオン
リメモリのプログラム変更用の変更アドレスおよび命令
コードを記憶する変更情報記憶部を有し、 上記ワンチップマイクロコンピュータは、 上記、不揮発性メモリから変更アドレスおよび命令コー
ドを受信する受信手段と、 上記変更アドレスおよび命令コードを記憶するためのラ
ンダムアクセスメモリと、 上記変更アドレスとプログラムカウンタの内容とを比較
する比較手段と、 この比較手段により一致信号が出力された場合に上記命
令コードを実行する命令実行手段とを有することを特徴
とするマイクロコンピュータのプログラム変更装置。
[Scope of Claims] A microcomputer system comprising a one-chip microcomputer that operates according to program instructions stored in a read-only memory, and a nonvolatile memory connected to the one-chip microcomputer by a signal line. The one-chip microcomputer receives the modified address and instruction code from the nonvolatile memory, and the one-chip microcomputer receives the modified address and instruction code from the nonvolatile memory. a receiving means; a random access memory for storing the modified address and the instruction code; a comparing means for comparing the modified address with the contents of the program counter; A program changing device for a microcomputer, comprising: instruction execution means for executing code.
JP1325876A 1989-03-28 1989-12-18 Program alteration device for microcomputer Pending JPH03186927A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP1325876A JPH03186927A (en) 1989-12-18 1989-12-18 Program alteration device for microcomputer
US08/040,562 US5357627A (en) 1989-03-28 1993-03-31 Microcomputer having a program correction function
US08/544,694 US5592613A (en) 1989-03-28 1995-10-18 Microcomputer having a program correction function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1325876A JPH03186927A (en) 1989-12-18 1989-12-18 Program alteration device for microcomputer

Publications (1)

Publication Number Publication Date
JPH03186927A true JPH03186927A (en) 1991-08-14

Family

ID=18181605

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1325876A Pending JPH03186927A (en) 1989-03-28 1989-12-18 Program alteration device for microcomputer

Country Status (1)

Country Link
JP (1) JPH03186927A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0615187A1 (en) 1993-03-11 1994-09-14 Olympus Optical Co., Ltd. One-chip microcomputer system having function for substantially correcting contents of program
US5408672A (en) * 1991-11-18 1995-04-18 Matsushita Electric Industrial Co. Microcomputer having ROM to store a program and RAM to store changes to the program
FR2714513A1 (en) * 1993-10-26 1995-06-30 Intel Corp Non-volatile memory e.g. flash EEPROM
JPH0876990A (en) * 1994-09-07 1996-03-22 Seikosha Co Ltd Control circuit for camera
US5574926A (en) * 1993-03-11 1996-11-12 Olympus Optical Co., Ltd. One-chip microcomputer system having function for substantially correcting contents of program
US5765184A (en) * 1993-10-26 1998-06-09 Intel Corporation Method and apparatus for programming an array controller in a flash memory device
JP2004090232A (en) * 2002-08-29 2004-03-25 Canon Inc Recorder and its control method
JP2005056546A (en) * 2003-08-06 2005-03-03 Samsung Electronics Co Ltd Combination system capable of compensating for driving information of one chip and method thereof
JP2005196266A (en) * 2003-12-26 2005-07-21 Matsushita Electric Ind Co Ltd Information processor
JP2010140469A (en) * 2008-12-12 2010-06-24 Genesys Logic Inc System and method for updating program having correction storage part

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5408672A (en) * 1991-11-18 1995-04-18 Matsushita Electric Industrial Co. Microcomputer having ROM to store a program and RAM to store changes to the program
EP0615187A1 (en) 1993-03-11 1994-09-14 Olympus Optical Co., Ltd. One-chip microcomputer system having function for substantially correcting contents of program
US5574926A (en) * 1993-03-11 1996-11-12 Olympus Optical Co., Ltd. One-chip microcomputer system having function for substantially correcting contents of program
FR2714513A1 (en) * 1993-10-26 1995-06-30 Intel Corp Non-volatile memory e.g. flash EEPROM
US5765184A (en) * 1993-10-26 1998-06-09 Intel Corporation Method and apparatus for programming an array controller in a flash memory device
JPH0876990A (en) * 1994-09-07 1996-03-22 Seikosha Co Ltd Control circuit for camera
JP2004090232A (en) * 2002-08-29 2004-03-25 Canon Inc Recorder and its control method
JP2005056546A (en) * 2003-08-06 2005-03-03 Samsung Electronics Co Ltd Combination system capable of compensating for driving information of one chip and method thereof
US7450829B2 (en) 2003-08-06 2008-11-11 Samsung Electronics Co., Ltd. Combination system capable of compensating for driving information of one chip and method thereof
JP2005196266A (en) * 2003-12-26 2005-07-21 Matsushita Electric Ind Co Ltd Information processor
JP2010140469A (en) * 2008-12-12 2010-06-24 Genesys Logic Inc System and method for updating program having correction storage part

Similar Documents

Publication Publication Date Title
US5357627A (en) Microcomputer having a program correction function
EP0554917B1 (en) Digital signal processing system having two instruction memories accessed by a processor under control of host
JP3795744B2 (en) Microcontroller
JP3563768B2 (en) ROM program change device
JPH03186927A (en) Program alteration device for microcomputer
US4321667A (en) Add-on programs with code verification and control
JPH06131171A (en) Mask programmable microprocessor
US6981109B2 (en) Digital signal processor system having programmable random access memory that executes processing during downloading of a program
JPH0333926A (en) Microcomputer
JPH0237600A (en) Testing of read-only-memory and device for executing the same
US6148362A (en) Microcomputer using nonvolatile semiconductor memory to store user code/data
JP3190945B2 (en) Micro program control circuit
JP2001022573A (en) Electronic equipment
JPS63184858A (en) One-chip microcomputer
JP3022608B2 (en) Microcomputer program change device
JPH0876990A (en) Control circuit for camera
JPH02199535A (en) Microprogram control
JPH01131927A (en) Program correcting method
JPH0226252B2 (en)
JPH0490032A (en) Microcomputer
JPH0991267A (en) Data writer for non-volatile memory
JPH04315231A (en) Microcompuer for evaluation
JPH1165856A (en) Microcomputer and its interruption processing method
JPH0323598A (en) Rom device
JPS62297940A (en) Data processor