JPH09265391A - Controller with program rom correction function, electronic equipment provided with the controller and correction method for program - Google Patents

Controller with program rom correction function, electronic equipment provided with the controller and correction method for program

Info

Publication number
JPH09265391A
JPH09265391A JP9746396A JP9746396A JPH09265391A JP H09265391 A JPH09265391 A JP H09265391A JP 9746396 A JP9746396 A JP 9746396A JP 9746396 A JP9746396 A JP 9746396A JP H09265391 A JPH09265391 A JP H09265391A
Authority
JP
Japan
Prior art keywords
program
program rom
volatile memory
numbers
cpu
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
JP9746396A
Other languages
Japanese (ja)
Inventor
Shizuo Ohira
志津雄 大平
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan 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 Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP9746396A priority Critical patent/JPH09265391A/en
Publication of JPH09265391A publication Critical patent/JPH09265391A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an electronic equipment without the need of simultaneously switching a microcomputer and a memory in the case of using a program ROM correction function and preparing nonvolatile memories for the same number as produced versions by a service department. SOLUTION: The correction data of the plural versions are paired with ID numbers and stored in the nonvolatile memory 24 corresponding to the version of a CPU 12 and collation with the ID number for indicating the version intrinsic to the CPU stored inside a program ROM 16 storing the operation procedure of the CPU is performed. When the ID numbers do not match with each other, the ID number paired with the correction data of the other version is read corresponding to an address stored along with the pertinent ID number of the nonvolatile memory and the collation is performed further. Only when the ID numbers match with each other, the correction of a program is executed.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明はマイクロコンピュー
タ(マイコン)を有するプログラムROM訂正機能付き
制御装置及び同制御装置を有する電子機器に関し、特に
不揮発性メモリとプログラムROM訂正機能を有するマ
イコンを有するプログラムROM訂正機能付き制御装置
及び同制御装置を有する電子機器に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control device having a program ROM correction function having a microcomputer and an electronic apparatus having the control device, and more particularly to a program ROM having a nonvolatile memory and a microcomputer having a program ROM correction function. The present invention relates to a control device with a correction function and an electronic device having the control device.

【0002】[0002]

【従来の技術】マイコンの低廉化と普及がすすむにつ
れ、種々の電子機器がマイコンで制御されるようになり
つつある。マイコンを搭載した電子機器としては、テレ
ビジョン受像機(テレビ)、VTR、CDプレーヤなど
があり、さらに、自動車のエンジンやブレーキの制御、
エアコンの制御、冷蔵庫、オーブン、電子レンジなどの
制御などマイコンが広く用いられている。かかる電子機
器に搭載されているマイコンは一般にCPUと、メモリ
などが1つのチップに組み込まれた、所謂ワンチップマ
イコンが用いられている。
2. Description of the Related Art As the price of microcomputers has become lower and popular, various electronic devices have come to be controlled by microcomputers. Electronic devices equipped with a microcomputer include a television receiver (television), a VTR, a CD player, and the like.
Microcomputers are widely used for controlling air conditioners, refrigerators, ovens, microwave ovens, and the like. A so-called one-chip microcomputer in which a CPU, a memory, and the like are incorporated in one chip is generally used as a microcomputer mounted on such an electronic device.

【0003】通常かかるマイコンを作製する場合には、
マスク品と呼ばれる変更不可能な最終製品ができる時期
より一定期間前にプログラムを作成し終わっている必要
がある。プログラムが完成してからマスク化するための
期間が数週間から数ヵ月程度必要であるためであるが、
この期間内にハード構成の変更によるプログラムの変
更、プログラムのバグなどの不具合点が発見されること
が多々ある。
Usually, when manufacturing such a microcomputer,
It is necessary to finish programming a certain period before the time when an unalterable final product called mask product is made. This is because it takes several weeks to several months to mask the program after it is completed.
During this period, it is often the case that defects such as program changes and program bugs due to hardware configuration changes are discovered.

【0004】このような場合にはROMコレクション
(ROM CORRECTION: ROM訂正)と呼ばれるプログラム
ROM訂正機能を使い、マスク化されているプログラム
の訂正を行うのが一般的である。ROMコレクションは
訂正データを不揮発性メモリ内に記憶させて、マスク化
されたプログラムの一部のデータを訂正する機能であ
る。方法としては、マイコン内蔵のハードウェアとプロ
グラムによって行う方法、すなわちプログラムの中の修
正したい箇所のアドレスの修正データを不揮発性メモリ
に保持しておきROMコレクションに対応したマイコン
ハードの機能を使いプログラム内のあるアドレスのデー
タを変更する方法や、メモリにプログラムを記憶させて
おいて、そのプログラムをRAMに読み込みRAM領域
をプログラム領域であるかの様に使用する方法などがあ
る。
In such a case, it is general to use a program ROM correction function called ROM CORRECTION (ROM correction) to correct the masked program. The ROM correction is a function of storing correction data in a non-volatile memory and correcting some data of the masked program. The method is to use the hardware built into the microcomputer and the program, that is, hold the correction data of the address of the part to be corrected in the program in the non-volatile memory and use the function of the microcomputer hardware corresponding to the ROM correction in the program. There is a method of changing data at a certain address, a method of storing a program in a memory and reading the program into a RAM and using the RAM area as if it were a program area.

【0005】いずれの場合も不揮発性メモリに記憶させ
る訂正データは訂正したいプログラム専用のデータであ
るためにプログラムと必ず対になっている必要がある。
プログラムがバージョンアップされた場合には前回のプ
ログラム用に不揮発性メモリに記憶されている訂正デー
タは機能しないようにしなくてはならない。
In any case, since the correction data stored in the non-volatile memory is data dedicated to the program to be corrected, it must be paired with the program.
When the program is upgraded, the correction data stored in the non-volatile memory for the previous program must be disabled.

【0006】その方法として従来は、マイコンのプログ
ラム内にデータとしてバージョン番号などのID番号を
保持しておき、不揮発性メモリ内に記憶しておくデータ
としては訂正データの他にマイコン内に保持されている
のと同じID番号を記憶しておく方法を取っていた。そ
して訂正データを読み込む前に、マイコンプログラム内
に保持してあるID番号と、不揮発性メモリ内に記憶し
てあるID番号をマッチングチェックし、等しければそ
のマイコン用の訂正データであるとしてそれを読み込み
データの訂正を行う。その場合のフローチャートを図4
に示す。
Conventionally, as a method, an ID number such as a version number is held as data in a program of a microcomputer, and data to be stored in a nonvolatile memory is stored in a microcomputer in addition to correction data. I was taking the method of remembering the same ID number that I had. Before reading the correction data, the ID number held in the microcomputer program and the ID number stored in the non-volatile memory are subjected to a matching check, and if they are equal, the correction data for the microcomputer is read. Correct the data. The flowchart in that case is shown in FIG.
Shown in

【0007】ステップS101でプログラムにて指定さ
れている不揮発性メモリのアドレスからID番号(メモ
リID)を読み出す。ステップS102でプログラム内
に保持されているID番号(マイコンID)と読みだし
たメモリIDが等しいかどうかマッチングチェックを行
う。ここで等しければステップS103にて不揮発性メ
モリより訂正データを読み込み、定常処理へと戻る。以
後プログラムの不具合点は訂正される。また、ステップ
S102でマイコンIDとメモリIDが異なっている場
合は、マイコンプログラムに適した訂正データでは無い
として不揮発性メモリから訂正データを読み出すこと無
く定常処理へと戻る。
In step S101, the ID number (memory ID) is read from the address of the non-volatile memory designated by the program. In step S102, a matching check is performed to determine whether the ID number (microcomputer ID) held in the program is equal to the read memory ID. If they are equal, the correction data is read from the non-volatile memory in step S103, and the process returns to the regular process. After that, the defects of the program will be corrected. If the microcomputer ID and the memory ID are different in step S102, it is determined that the correction data is not suitable for the microcomputer program, and the routine returns to the steady process without reading the correction data from the nonvolatile memory.

【0008】[0008]

【発明が解決しようとする課題】この方法によるとマイ
コンプログラムのバージョンの切り換わり時で、古いバ
ージョンでROMコレクションを使用していて、新しい
バージョンにも既に不具合点がありROMコレクション
を使用しなくてはならないような場合に、製造の場でマ
イコンのバージョンの切り換わりのタイミングと同じタ
イミングで、不揮発性メモリも訂正データ及びID番号
が新しいバージョンに対応しているものに変更しなくて
はならない。しかし、実際の製造過程においては、この
ように厳密にマイコンと不揮発性メモリの切り換わりタ
イミングを同じにすることは難しい。しかし、同時に切
り換わらないと、違うバージョンの訂正データが入って
いるために、訂正データがきちんと読み出されないセッ
トが出荷されてしまうことになる。
According to this method, when the version of the microcomputer program is switched, the ROM collection is used in the old version, and the new version already has a defect, so that the ROM collection is not used. In such a case, the nonvolatile memory must be changed to one in which the correction data and the ID number correspond to the new version at the same timing as the version switching of the microcomputer at the time of manufacture. However, in the actual manufacturing process, it is difficult to make the switching timings of the microcomputer and the non-volatile memory exactly the same in this way. However, if they are not switched at the same time, a different version of the correction data is included, and a set in which the correction data cannot be properly read will be shipped.

【0009】また、バージョンアップが数回なされた場
合でそれぞれに不具合点がある場合には、バージョン毎
に不揮発性メモリを持たなくてはならず、サービスなど
で対応する場合には、それぞれのバージョン毎に適した
不揮発性メモリを供給しなくてはならない。
In addition, if the version is updated several times and each has a defect, each version must have a non-volatile memory. A suitable non-volatile memory must be supplied for each case.

【0010】マスク化したマイコンにプログラムになん
らかの不具合点があり、ROMコレクションと呼ばれる
プログラムROM訂正機能を使用する場合に、従来の一
つのバージョンのプログラムに対してしか訂正データを
記憶できなかったために、バージョンの切り換わりで両
方のバージョンでROMコレクションを使用しなくては
ならないような場合に、マイコンとメモリの切り換えを
同時に行わなくてはならないという問題があった。
The masked microcomputer has some defects in the program, and when the program ROM correction function called ROM correction is used, the correction data can be stored only for one conventional version of the program. In the case where the ROM correction must be used in both versions due to the version switching, there was a problem that the microcomputer and the memory had to be switched at the same time.

【0011】また、訂正データをプログラムと対にして
おかなくてはならないために、あるバージョンに対して
決まったメモリを使用する必要があり、ROMコレクシ
ョンを使用した場合にはサービス部門が作成されたバー
ジョンと同じ数だけの不揮発性メモリを用意しておかな
くてはならないという問題があった。
Further, since the correction data must be paired with the program, it is necessary to use a fixed memory for a certain version, and when the ROM correction is used, a service department is created. There was a problem that it was necessary to prepare as many non-volatile memories as there were versions.

【0012】したがって本発明は、プログラムROM訂
正機能を使用する場合にマイコンとメモリの切り換えを
同時に行わなくてよく、かつサービス部門が作製された
バージョンと同じ数だけの不揮発性メモリを用意する必
要のないプログラムROM訂正機能付き制御装置及び同
制御装置を有する電子機器を提供することを目的とす
る。
Therefore, according to the present invention, when the program ROM correction function is used, it is not necessary to switch the microcomputer and the memory at the same time, and it is necessary for the service department to prepare the same number of nonvolatile memories as the prepared version. An object of the present invention is to provide a control device with a program ROM correction function and an electronic device having the control device.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するた
め、本発明では、不揮発性メモリにCPUのバージョン
に対応させて複数のバージョンの訂正データをID番号
と対にして記憶しておき、CPUの動作手順を記憶して
いるプログラムROM内に記憶されているそのCPU特
有のバージョンを示すID番号と照合し、ID番号同志
が一致しないときは、不揮発性メモリの当該ID番号と
共に記憶されているアドレスに従って他のバージョンの
訂正データと対となっているID番号を読み出して更に
照合を行い、ID番号同志が一致したときにのみプログ
ラムの訂正を実行するようにしている。
In order to achieve the above object, according to the present invention, a plurality of versions of correction data are stored in a non-volatile memory so as to correspond to CPU versions in pairs with ID numbers. When the ID numbers do not match each other, it is stored together with the ID number of the non-volatile memory. According to the address, the ID number paired with the correction data of another version is read and further collated, and the program is corrected only when the ID numbers match each other.

【0014】すなわち本発明によれば、CPUと、前記
CPUの動作手順を記憶しているプログラムROMと、
前記プログラムROMのバージョンに対応し、前記CP
UのID番号とプログラムROMの内容を訂正するため
のデータが書き込まれた不揮発性メモリと、前記不揮発
性メモリに記憶されているID番号を読み出す手段と、
読み出したID番号が前記プログラムROM内に記して
あるID番号と等しいか否かを判定する手段と、その判
定の結果、ID番号同志が等しい場合のみ前記不揮発性
メモリからプログラムに対応した訂正データを読み出す
ことを許可する手段と、を有するプログラムROM訂正
機能付き制御装置において、前記不揮発性メモリに予め
1つのID番号に対応して1つの所定アドレスが書き込
まれ、ID番号を判定した結果ID番号同志が等しくな
い場合には、前記不揮発性メモリに記憶されているID
番号と共に記憶されているアドレスから他のID番号を
読み出し、再びID番号同志が等しいか否かを判定する
手段と、その判定の結果、ID番号同志が等しい場合の
み前記不揮発性メモリからプログラムに対応した訂正デ
ータを読み出すことを許可する手段と、を有することを
特徴とするプログラムROM訂正機能付き制御装置が提
供される。
That is, according to the present invention, a CPU, a program ROM storing the operation procedure of the CPU,
Corresponding to the version of the program ROM, the CP
A nonvolatile memory in which data for correcting the U ID number and the contents of the program ROM is written; and a means for reading the ID number stored in the nonvolatile memory,
Means for determining whether the read ID number is equal to the ID number written in the program ROM, and, as a result of the determination, correct data corresponding to the program from the non-volatile memory only when the ID numbers are equal. In a control device with a program ROM correction function having a means for permitting reading, one predetermined address is written in advance in the nonvolatile memory in correspondence with one ID number, and the result of determining the ID number If the two are not equal, the IDs stored in the non-volatile memory
Means for reading another ID number from the address stored together with the number and determining again whether or not the ID numbers are the same, and as a result of the determination, correspond to the program from the nonvolatile memory only when the ID numbers are the same. And a means for permitting reading of the corrected data, and a control device with a program ROM correction function is provided.

【0015】さらに、本発明によれば、制御対象器を有
する電子機器であって、CPUと、前記CPUの動作手
順を記憶しているプログラムROMと、前記プログラム
ROMのバージョンに対応し、前記CPUのID番号と
プログラムROMの内容を訂正するためのデータが書き
込まれた不揮発性メモリと、前記不揮発性メモリに記憶
されているID番号を読み出す手段と、読み出したID
番号が前記プログラムROM内に記してあるID番号と
等しいか否かを判定する手段と、その判定の結果、ID
番号同志が等しい場合のみ前記不揮発性メモリからプロ
グラムに対応した訂正データを読み出すことを許可する
手段と、を有するプログラムROM訂正機能付き制御装
置によって前記制御対象器が制御されるよう構成されて
いる電子機器において、前記不揮発性メモリに予め1つ
のID番号に対応して1つの所定アドレスが書き込ま
れ、ID番号を判定した結果ID番号同志が等しくない
場合には、前記不揮発性メモリに記憶されているID番
号と共に記憶されているアドレスから他のID番号を読
み出し、再びID番号同志が等しいか否かを判定する手
段と、その判定の結果、ID番号同志が等しい場合のみ
前記不揮発性メモリからプログラムに対応した訂正デー
タを読み出すことを許可する手段と、を有することを特
徴とするプログラムROM訂正機能付き制御装置を有す
る電子機器が提供される。
Further, according to the present invention, there is provided an electronic device having a controlled device, which corresponds to a CPU, a program ROM storing the operation procedure of the CPU, and a version of the program ROM. ID number and the data for correcting the contents of the program ROM are written in the nonvolatile memory, a means for reading the ID number stored in the nonvolatile memory, and the read ID
Means for determining whether the number is equal to the ID number written in the program ROM, and the result of the determination, the ID
An electronic device configured to control the control target device by a control device with a program ROM correction function, which has a means for permitting reading of correction data corresponding to a program from the nonvolatile memory only when the numbers are the same. In the device, one predetermined address corresponding to one ID number is written in advance in the non-volatile memory, and if the ID numbers are not equal as a result of judging the ID numbers, they are stored in the non-volatile memory. Means for reading another ID number from the address stored together with the ID number and determining again whether or not the ID numbers are the same, and only when the determination results show that the ID numbers are the same, the nonvolatile memory stores a program. And a means for permitting reading of corresponding correction data. An electronic device having a OM correction function control device is provided.

【0016】さらに、本発明によれば、CPUと、前記
CPUの動作手順を記憶しているプログラムROMと、
前記プログラムROMのプログラムの訂正データが書き
込まれた不揮発性メモリが着脱自在に装着可能な不揮発
性メモリ接続部とを有するマイコンの、前記プログラム
ROMのプログラムの訂正方法において、前記不揮発性
メモリに予め複数の訂正バージョンの訂正データを書き
込んでおき、各訂正バージョンに1つのID番号を付し
て併せて書き込んでおき、前記プログラムROMのプロ
グラムの訂正を実行するときは、前記不揮発性メモリを
前記不揮発性メモリ接続部に装着するステップと、前記
不揮発性メモリに記憶されているID番号を読み出すス
テップと、読み出したID番号が前記プログラムROM
内に記してあるID番号と等しいか否かを判定するステ
ップと、その判定の結果、ID番号同志が等しい場合の
み前記不揮発性メモリからプログラムに対応した訂正デ
ータを読み出すことを許可するステップと、ID番号を
判定した結果ID番号同志が等しくない場合には、前記
不揮発性メモリに記憶されているID番号と共に記憶さ
れているアドレスから他のID番号を読み出し、再びI
D番号同志が等しいか否かを判定するステップと、その
判定の結果、ID番号同志が等しい場合のみ前記不揮発
性メモリからプログラムに対応した訂正データを読み出
すことを許可するステップとを有することを特徴とする
プログラム訂正方法が提供される。
Further, according to the present invention, a CPU, a program ROM storing the operation procedure of the CPU,
In a method for correcting a program in a program ROM of a microcomputer having a nonvolatile memory connection portion to which a nonvolatile memory in which correction data of a program in the program ROM is written can be detachably mounted, a plurality of nonvolatile memories are previously stored in the nonvolatile memory. When the correction data of the corrected version is written, and each correction version is written together with one ID number, and the program of the program ROM is corrected, the nonvolatile memory is set to the nonvolatile memory. Attaching to the memory connection part, reading the ID number stored in the non-volatile memory, and reading the ID number from the program ROM.
And a step of permitting reading of the correction data corresponding to the program from the nonvolatile memory only when the ID numbers are equal as a result of the determination. If the ID numbers are not equal as a result of the determination of the ID numbers, another ID number is read from the address stored together with the ID number stored in the non-volatile memory, and the I number is read again.
The method further comprises a step of determining whether or not the D numbers are the same, and a step of permitting the correction data corresponding to the program to be read from the non-volatile memory only when the ID numbers are the same as a result of the determination. A method for correcting a program is provided.

【0017】本発明によれば不揮発性メモリにID番号
と修正データだけでなくID番号のマッチングチェック
の結果等しくないと判断された場合に、不揮発性メモリ
内の別のID番号が記されているアドレスの情報を持つ
ことにより、複数のID番号と、それに付随した複数の
修正データを不揮発性メモリ内に記憶しておき、マイコ
ンのID番号とマッチングチェックした不揮発性メモリ
から適した修正データを読み出すことができる。また、
製造時のマイコンのバージョン変更があるような場合
で、前のバージョンと後のバージョンでそれぞれ修正デ
ータが必要な場合に、前もって両方のデータの入った不
揮発性メモリに変更しておけば、マイコンと不揮発性メ
モリの切り換えタイミングを厳密に一致させなくても、
それぞれのバージョンに適した修正データを組み込むこ
とができる。
According to the present invention, another ID number in the non-volatile memory is recorded when it is determined that the non-equalities are not equal to each other in the non-volatile memory as a result of matching check of the ID number and the correction data. By having address information, a plurality of ID numbers and a plurality of correction data associated therewith are stored in the non-volatile memory, and suitable correction data is read from the non-volatile memory subjected to matching check with the ID number of the microcomputer. be able to. Also,
If there is a need to change the version of the microcomputer at the time of manufacture, and if you need correction data for both the previous version and the later version, change it to a nonvolatile memory that contains both data in advance. Even if the switching timing of the non-volatile memory does not exactly match,
You can incorporate the correct modification data for each version.

【0018】[0018]

【発明の実施の形態】以下図面とともに本発明プログラ
ムROM訂正機能付き制御装置及び同制御装置を有する
電子機器の実施の形態を好ましい実施例によって説明す
る。図2は本発明のプログラムROM訂正機能付き制御
装置の全体と同制御装置を有する電子機器の一部を示す
ブロック図である。電子機器20としては、一例として
テレビとし、その一部である制御対象機器22とこれを
制御するマイコン10が示されている。制御対象機器2
2としては、例えばテレビのチューナーの周波数設定、
AVセレクタなどがあるが、制御対象機器22の内容は
本発明とは直接は関係がないので、その説明は省略す
る。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of a control device with a program ROM correction function and an electronic apparatus having the control device according to the present invention will be described below with reference to the accompanying drawings. FIG. 2 is a block diagram showing the entire control device with a program ROM correction function of the present invention and a part of electronic equipment having the control device. The electronic device 20 is, for example, a television, and a controlled device 22 that is a part of the electronic device 20 and a microcomputer 10 that controls the device 22 are shown. Controlled device 2
2, for example, the frequency setting of the tuner of the TV,
Although there is an AV selector and the like, the content of the control target device 22 is not directly related to the present invention, and therefore its explanation is omitted.

【0019】マイコン10は中央演算処理装置であるC
PU12と書き込み可能なメモリであるRAM14、読
み出し専用メモリであるROM16、入出力のインター
フェース(I/F)18を有していて、これらの素子は
1つの基板に組み込まれ、1チップマイコンとして構成
されている。マイコン10はインターフェース18を介
して制御対象機器22と信号授受が可能であり、さらに
同様に不揮発性メモリ24とも信号授受が可能である。
不揮発性メモリ24は、それ自身が1チップの単体であ
り電子機器20の図示省略の基板などに設けられたソケ
ットに対して着脱可能となっている。
The microcomputer 10 is a central processing unit C
It has a PU 12, a RAM 14 as a writable memory, a ROM 16 as a read-only memory, and an input / output interface (I / F) 18, and these elements are built in one board and configured as a one-chip microcomputer. ing. The microcomputer 10 can send and receive signals to and from the controlled device 22 via the interface 18, and also can send and receive signals to and from the nonvolatile memory 24.
The non-volatile memory 24 itself is a single-chip unit, and is attachable to and detachable from a socket provided on a substrate (not shown) of the electronic device 20.

【0020】ROM16には通常のコンピュータ同様、
CPU12の動作手順がプログラムとして記憶されてい
て、CPU12はこのプログラムを読み出して、その指
示に従った動作を行って制御対象機器22に対する所定
の制御を実行する。また、CPU12は、量産されるも
のであるが、そのハード構成すなわちアーキテクチャー
は随時必要に応じて改良されるので同一形式のCPUで
あっても内容が一部異なることがある。この改良は一般
にバージョンアップと言われ、CPUのケーシングの外
側に印字される、そのチップ固有のシリアルナンバーか
ら識別可能である。CPUのバージョンはROM16の
プログラムを訂正するとき、すなわち不揮発性メモリ2
4を用いて、あたかもROM16のプログラム自体を変
更したかのような訂正を行う場合に必要であるので、R
OM16の所定エリアに予め書き込んである。
The ROM 16 has the same contents as a normal computer.
The operation procedure of the CPU 12 is stored as a program, and the CPU 12 reads this program and performs an operation according to the instruction to execute a predetermined control for the controlled device 22. Although the CPU 12 is mass-produced, the hardware configuration, that is, the architecture, is improved as needed, and therefore the contents may be partially different even if the CPUs are of the same type. This improvement is generally referred to as a version upgrade, and can be identified from the chip-specific serial number printed on the outside of the CPU casing. The CPU version is the one used when correcting the program in the ROM 16, that is, the nonvolatile memory 2
It is necessary to make a correction as if the program itself of the ROM 16 was changed by using 4.
It is written in a predetermined area of the OM 16 in advance.

【0021】不揮発性メモリ24は、ROM16のプロ
グラムの訂正が必要なときに、その訂正のためのデータ
が記憶されているが、図3に示すようにCPU12の複
数のバージョンに対応して複数のバージョンの訂正デー
タが記憶されている。いま、図3のように訂正データ
、訂正データという2つのバージョンの訂正データ
群がそれぞれID番号、ID番号と対応して記憶さ
れている。さらに、ID番号の記憶エリアには次のI
D番号であるID番号のアドレスが併せて記憶されて
いる。この例では2つの訂正データ群なので、ID番号
のエリアには次のID番号のアドレスを記憶する必要
はないが、例えば合計4つの訂正データ群を記憶してい
る場合は、1番目から3番目のID番号のエリアにはそ
れぞれ次のID番号、すなわち2番目から4番目のID
番号のアドレスが併せて記憶されることとなる。なお、
ID番号には4バイト、アドレスには2バイトを割当て
ているが必要に応じて増減することはできる。
The non-volatile memory 24 stores data for correction when the program of the ROM 16 needs to be corrected. As shown in FIG. 3, a plurality of data corresponding to a plurality of versions of the CPU 12 are stored. The correction data of the version is stored. Now, as shown in FIG. 3, two versions of the correction data group, correction data and correction data, are stored in correspondence with the ID number and the ID number, respectively. Further, the storage area for the ID number has the following I
The address of the ID number, which is the D number, is also stored. Since there are two correction data groups in this example, it is not necessary to store the address of the next ID number in the ID number area. However, if a total of four correction data groups are stored, the first to third The following ID numbers, that is, the second to fourth IDs, are stored in the ID number areas
The address of the number will be stored together. In addition,
Although 4 bytes are assigned to the ID number and 2 bytes are assigned to the address, the number can be increased or decreased as necessary.

【0022】いま、ROM16のプログラムの訂正バー
ジョンが2つあるものとして、図3に示すように2つの
訂正データ群が記憶されている不揮発性メモリ24を不
揮発性メモリ用ソケットに差し込むものとする。この状
態で電子機器20の電源をオンとすると、CPU12は
起動して図1に示すフローチャートに従って動作を実行
する。ステップS201で不揮発性メモリ24内の決め
られたアドレスからID番号(メモリID)を読み出
す。ここでメモリIDは不揮発性メモリ24に書き込ま
れたID番号で所定のCPUのバージョンに対応する訂
正データ群を示すものである。ステップS202でプロ
グラム内に保持されているID番号(マイコンID)、
すなわちROM16から読み出されたID番号とメモ
リIDのマッチングチェック(照合)を行う。マイコ
ンIDはROM16に予め記憶されたID番号で、その
CPUのバージョンを示すものである。この照合の結
果、ID番号同志が等しければステップS203で不揮
発性メモリから訂正データを読み出し、定常処理へと
戻る。以後プログラムの不具合点は訂正される。
Now, assuming that there are two corrected versions of the program in the ROM 16, the non-volatile memory 24 in which two groups of correction data are stored is inserted into the non-volatile memory socket as shown in FIG. When the power of the electronic device 20 is turned on in this state, the CPU 12 is activated and executes the operation according to the flowchart shown in FIG. In step S201, the ID number (memory ID) is read from the determined address in the nonvolatile memory 24. Here, the memory ID is an ID number written in the non-volatile memory 24 and indicates a correction data group corresponding to a predetermined CPU version. The ID number (microcomputer ID) held in the program in step S202,
That is, a matching check (collation) between the ID number read from the ROM 16 and the memory ID is performed. The microcomputer ID is an ID number stored in advance in the ROM 16 and indicates the version of the CPU. As a result of this comparison, if the ID numbers are the same, the correction data is read from the non-volatile memory in step S203, and the routine returns. After that, the defects of the program will be corrected.

【0023】一方、ステップS202でマッチングチェ
ックした結果メモリIDとマイコンIDが等しくない
場合には、メモリIDと共に記憶されている飛び先ア
ドレスを読み込む(ステップS204)。そしてステ
ップS205ではステップS204で読み込んだ飛び先
アドレスに書かれているメモリIDを読み出す。ス
テップS206で再びマイコンIDとメモリIDのマ
ッチングチェック(照合)をして、等しければステップ
S207で不揮発性メモリから訂正データを読み出し
て定常処理へと戻る。ステップS206でマイコンID
とメモリIDが異なる場合は、マイコンプログラムに
適したROMコレクションは無いものとして定常処理へ
と戻る。
On the other hand, if the memory ID and the microcomputer ID are not equal as a result of the matching check in step S202, the jump destination address stored together with the memory ID is read (step S204). Then, in step S205, the memory ID written in the jump destination address read in step S204 is read. In step S206, the microcomputer ID and the memory ID are again checked for matching (matching). If they are equal, the correction data is read from the nonvolatile memory in step S207 and the routine returns. Microcomputer ID in step S206
And the memory ID are different, it is determined that there is no ROM collection suitable for the microcomputer program, and the routine returns to the regular processing.

【0024】ここでは便宜的に、ステップS206でマ
ッチングチェックした結果が異なる場合、定常処理へと
戻るとしたが、前述のように3つ以上の訂正データ群が
あるときは、メモリIDと共に再び飛び先アドレス
を書き込んでおけば飛び先アドレスに書かれているメ
モリIDを読み出すことができる。これを繰り返して
いけばいくつものバージョンの訂正データを記憶してお
くことができる。実際使用する場合には、あまり多くの
バージョンに対応する必要もないと思われるし、誤動作
対策という意味でも、飛び先アドレスの指定は数回程度
と回数を決めておく方が望ましいといえる。したがっ
て、例えば、飛び先アドレスの指定回数が4に達したと
きは、それ以上のジヤンプは行わず、定常処理に強制的
に戻るようにすることができる。あるいは、強制的に飛
び先アドレスがないことを知らせるために、例えば所定
のデータである16進法表記のFFが記されていたら処
理を抜けるのも一つの方法である。
Here, for the sake of convenience, if the result of the matching check in step S206 is different, the process returns to the steady process. However, as described above, when there are three or more correction data groups, the process is skipped again together with the memory ID. By writing the destination address, the memory ID written in the destination address can be read. By repeating this, it is possible to store several versions of correction data. When actually used, it seems that it is not necessary to support a large number of versions, and it can be said that it is desirable to set the jump address several times or so in order to prevent malfunctions. Therefore, for example, when the number of times the destination address has been designated reaches 4, it is possible to forcibly return to the regular processing without further jumping. Alternatively, in order to compulsorily notify that there is no jump destination address, for example, if an FF in hexadecimal notation that is predetermined data is written, the process is exited.

【0025】[0025]

【発明の効果】以上説明したように本発明のプログラム
ROM訂正機能付き制御装置及び同制御装置を有する電
子機器によれば、不揮発性メモリにID番号だけでな
く、飛び先アドレスも記しておくことにより、ROM訂
正機能を使用する場合のID番号のマッチングチェック
を複数回行うことができる。よって、マイコンのプログ
ラムのバージョン変更が製造のラインで行われるような
場合で、その両方のバージョンにROM訂正機能を使用
する場合に、マイコンと不揮発性メモリの交換を同時に
行わなくても、バージョンが変更される前に両方のバー
ジョンの訂正データが記憶されている不揮発性メモリに
交換しておけば、適した訂正データが適したバージョン
のマイコンにのみ使用されるため、製造時にバージョン
が異なるために適した修正データが入らなくなる心配が
なくなる。
As described above, according to the control device with a program ROM correction function and the electronic device having the control device of the present invention, not only the ID number but also the jump destination address are recorded in the nonvolatile memory. Thus, the ID number matching check can be performed a plurality of times when the ROM correction function is used. Therefore, when the version of the microcomputer program is changed on the manufacturing line and the ROM correction function is used for both versions, the version can be changed without replacing the microcomputer and the nonvolatile memory at the same time. If you replace it with a non-volatile memory that stores both versions of the correction data before it is changed, the correct correction data will be used only for the correct version of the microcomputer, so the versions will differ during manufacturing. There is no need to worry that suitable correction data will not be entered.

【0026】また、訂正データをプログラムと対にして
おかなくてはならないために、作成されたバージョンと
同じ数だけの不揮発性メモリを用意しておかなくても新
しいバージョンの訂正データができたら全てのバージョ
ンの訂正データを次々と不揮発性メモリに記憶していけ
ば最終的に一つの不揮発性メモリで全てのバージョンを
カバーすることができ、煩わしさがなくなる。
Further, since the correction data must be paired with the program, it is not necessary to prepare the same number of non-volatile memories as the created version, and if a new version of the correction data is created, all If the corrected data of the versions are sequentially stored in the non-volatile memory, all the versions can be finally covered by one non-volatile memory, and the trouble is eliminated.

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

【図1】本発明のプログラムROM訂正機能付き制御装
置及び同制御装置を有する電子機器の好ましい実施例に
おけるCPUの動作を示すフローチャートである。
FIG. 1 is a flowchart showing an operation of a CPU in a preferred embodiment of a control device with a program ROM correction function and an electronic device having the control device according to the present invention.

【図2】本発明の電子機器の好ましい実施例を示すブロ
ック図である。
FIG. 2 is a block diagram showing a preferred embodiment of the electronic device of the present invention.

【図3】本発明プログラムROM訂正機能付き制御装置
及び同制御装置を有する電子機器に用いられる不揮発性
メモリの内容を模式的に示す図である。
FIG. 3 is a diagram schematically showing the contents of a nonvolatile memory used in a control device with a program ROM correction function of the present invention and an electronic device having the control device.

【図4】従来の制御装置あるいは電子機器におけるCP
Uの動作を示すフローチャートである。
FIG. 4 CP in a conventional control device or electronic device
6 is a flowchart showing the operation of U.

【図5】図4の従来装置に用いられる不揮発性メモリの
内容を模式的に示す図である。
5 is a diagram schematically showing the contents of a non-volatile memory used in the conventional device of FIG.

【符号の説明】[Explanation of symbols]

10 マイコン 12 CPU(ID番号を読み出す手段、判定する手
段、許可する手段) 14 RAM 16 ROM(プログラムROM) 18 インターフェース 20 電子機器 22 制御対象機器 24 不揮発性メモリ
10 Microcomputer 12 CPU (means for reading ID number, means for judging, means for permitting) 14 RAM 16 ROM (program ROM) 18 Interface 20 Electronic equipment 22 Controlled equipment 24 Nonvolatile memory

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 CPUと、前記CPUの動作手順を記憶
しているプログラムROMと、前記プログラムROMの
バージョンに対応し、前記CPUのID番号とプログラ
ムROMの内容を訂正するためのデータが書き込まれた
不揮発性メモリと、 前記不揮発性メモリに記憶されているID番号を読み出
す手段と、 読み出したID番号が前記プログラムROM内に記して
あるID番号と等しいか否かを判定する手段と、 その判定の結果、ID番号同志が等しい場合のみ前記不
揮発性メモリからプログラムに対応した訂正データを読
み出すことを許可する手段と、 を有するプログラムROM訂正機能付き制御装置におい
て、 前記不揮発性メモリに予め1つのID番号に対応して1
つの所定アドレスが書き込まれ、ID番号を判定した結
果ID番号同志が等しくない場合には、前記不揮発性メ
モリに記憶されているID番号と共に記憶されているア
ドレスから他のID番号を読み出し、再びID番号同志
が等しいか否かを判定する手段と、 その判定の結果、ID番号同志が等しい場合のみ前記不
揮発性メモリからプログラムに対応した訂正データを読
み出すことを許可する手段と、 を有することを特徴とするプログラムROM訂正機能付
き制御装置。
1. A CPU, a program ROM storing the operation procedure of the CPU, and data for correcting the ID number of the CPU and the contents of the program ROM corresponding to the version of the program ROM. A non-volatile memory, means for reading the ID number stored in the non-volatile memory, means for determining whether the read ID number is equal to the ID number written in the program ROM, and its determination As a result, in a program ROM correction function control device having means for permitting reading of correction data corresponding to a program from the non-volatile memory only when the ID numbers are the same, one ID is previously stored in the non-volatile memory. 1 corresponding to the number
If two predetermined addresses are written and the ID numbers are not equal as a result of determining the ID numbers, another ID number is read from the address stored together with the ID number stored in the nonvolatile memory, and the ID number is read again. A means for determining whether or not the numbers are the same, and a means for permitting reading of the correction data corresponding to the program from the nonvolatile memory only when the results of the determination indicate that the ID numbers are the same. A control device with a program ROM correction function.
【請求項2】 制御対象器を有する電子機器であって、
CPUと、前記CPUの動作手順を記憶しているプログ
ラムROMと、前記プログラムROMのバージョンに対
応し、前記CPUのID番号とプログラムROMの内容
を訂正するためのデータが書き込まれた不揮発性メモリ
と、 前記不揮発性メモリに記憶されているID番号を読み出
す手段と、 読み出したID番号が前記プログラムROM内に記して
あるID番号と等しいか否かを判定する手段と、 その判定の結果、ID番号同志が等しい場合のみ前記不
揮発性メモリからプログラムに対応した訂正データを読
み出すことを許可する手段と、 を有するプログラムROM訂正機能付き制御装置によっ
て前記制御対象器が制御されるよう構成されている電子
機器において、 前記不揮発性メモリに予め1つのID番号に対応して1
つの所定アドレスが書き込まれ、ID番号を判定した結
果ID番号同志が等しくない場合には、前記不揮発性メ
モリに記憶されているID番号共に記憶されているアド
レスから他のID番号を読み出し、再びID番号同志が
等しいか否かを判定する手段と、 その判定の結果、ID番号同志が等しい場合のみ前記不
揮発性メモリからプログラムに対応した訂正データを読
み出すことを許可する手段と、 を有することを特徴とするプログラムROM訂正機能付
き制御装置を有する電子機器。
2. An electronic device having a controlled device, comprising:
A CPU, a program ROM storing the operation procedure of the CPU, and a nonvolatile memory corresponding to the version of the program ROM and in which data for correcting the ID number of the CPU and the contents of the program ROM are written , Means for reading the ID number stored in the non-volatile memory, means for determining whether the read ID number is equal to the ID number written in the program ROM, and the result of the determination, the ID number An electronic device configured such that the control target device is controlled by a control device with a program ROM correction function, which has a means for permitting the correction data corresponding to the program to be read from the non-volatile memory only when the two are equal. In the non-volatile memory, 1 corresponding to one ID number in advance
If two predetermined addresses are written and the ID numbers are judged to be unequal to each other, another ID number is read from the address stored together with the ID number stored in the nonvolatile memory, and the ID number is read again. A means for determining whether or not the numbers are the same, and a means for permitting reading of the correction data corresponding to the program from the nonvolatile memory only when the results of the determination indicate that the ID numbers are the same. And an electronic device having a control device with a program ROM correction function.
【請求項3】 CPUと、前記CPUの動作手順を記憶
しているプログラムROMと、前記プログラムROMの
プログラムの訂正データが書き込まれた不揮発性メモリ
が着脱自在に装着可能な不揮発性メモリ接続部とを有す
るマイコンの、前記プログラムROMのプログラムの訂
正方法において、 前記不揮発性メモリに予め複数の訂正バージョンの訂正
データを書き込んでおき、各訂正バージョンに1つのI
D番号を付して併せて書き込んでおき、前記プログラム
ROMのプログラムの訂正を実行するときは、前記不揮
発性メモリを前記不揮発性メモリ接続部に装着するステ
ップと、 前記不揮発性メモリに記憶されているID番号を読み出
すステップと、 読み出したID番号が前記プログラムROM内に記して
あるID番号と等しいか否かを判定するステップと、 その判定の結果、ID番号同志が等しい場合のみ前記不
揮発性メモリからプログラムに対応した訂正データを読
み出すことを許可するステップと、 ID番号を判定した結果ID番号同志が等しくない場合
には、前記不揮発性メモリに記憶されているID番号と
共に記憶されているアドレスから他のID番号を読み出
し、再びID番号同志が等しいか否かを判定するステッ
プと、 その判定の結果、ID番号同志が等しい場合のみ前記不
揮発性メモリからプログラムに対応した訂正データを読
み出すことを許可するステップとを有することを特徴と
するプログラム訂正方法。
3. A CPU, a program ROM that stores the operating procedure of the CPU, and a non-volatile memory connection portion to which a non-volatile memory in which the correction data of the program of the program ROM is written is detachably mountable. In the method of correcting a program in the program ROM of a microcomputer having: a plurality of correction versions of correction data are written in advance in the nonvolatile memory, and one I version is provided for each correction version.
When the program of the program ROM is corrected by writing it together with a D number, the step of mounting the non-volatile memory in the non-volatile memory connection part, and storing the non-volatile memory in the non-volatile memory The read ID number, a step of determining whether the read ID number is equal to the ID number written in the program ROM, and the result of the determination is that the ID numbers are equal to each other, the nonvolatile memory From the step of permitting the reading of the correction data corresponding to the program from the step of, and if the result of judging the ID numbers is not the same, the address stored together with the ID number stored in the non-volatile memory is used. A step of reading out another ID number and determining again whether the ID numbers are the same, Constant results, program correcting method characterized by a step of permitting to read the correction data corresponding to the program from the nonvolatile memory only if the ID number comrades are equal.
JP9746396A 1996-03-27 1996-03-27 Controller with program rom correction function, electronic equipment provided with the controller and correction method for program Pending JPH09265391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9746396A JPH09265391A (en) 1996-03-27 1996-03-27 Controller with program rom correction function, electronic equipment provided with the controller and correction method for program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9746396A JPH09265391A (en) 1996-03-27 1996-03-27 Controller with program rom correction function, electronic equipment provided with the controller and correction method for program

Publications (1)

Publication Number Publication Date
JPH09265391A true JPH09265391A (en) 1997-10-07

Family

ID=14193002

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9746396A Pending JPH09265391A (en) 1996-03-27 1996-03-27 Controller with program rom correction function, electronic equipment provided with the controller and correction method for program

Country Status (1)

Country Link
JP (1) JPH09265391A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006139507A (en) * 2004-11-11 2006-06-01 Sharp Corp Program-correcting method, electronic appliance, and microcomputer
US7257954B2 (en) 2001-09-25 2007-08-21 Daikin Industries, Ltd. Function switching method, function switching apparatus, data storage method, data storage apparatus, device, and air conditioner
EP2246784A1 (en) 2009-04-28 2010-11-03 Sanyo Electric Co., Ltd. Program update system and electronic device with program update function
WO2018193561A1 (en) * 2017-04-19 2018-10-25 三菱電機株式会社 Air conditioner
WO2018212081A1 (en) * 2017-05-15 2018-11-22 日本電気株式会社 Update control unit, update control device, update control system, and update control method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7257954B2 (en) 2001-09-25 2007-08-21 Daikin Industries, Ltd. Function switching method, function switching apparatus, data storage method, data storage apparatus, device, and air conditioner
JP2006139507A (en) * 2004-11-11 2006-06-01 Sharp Corp Program-correcting method, electronic appliance, and microcomputer
EP2246784A1 (en) 2009-04-28 2010-11-03 Sanyo Electric Co., Ltd. Program update system and electronic device with program update function
US8694717B2 (en) 2009-04-28 2014-04-08 Semiconductor Components Industries, Llc Program update system and electronic device with program update function
WO2018193561A1 (en) * 2017-04-19 2018-10-25 三菱電機株式会社 Air conditioner
WO2018212081A1 (en) * 2017-05-15 2018-11-22 日本電気株式会社 Update control unit, update control device, update control system, and update control method

Similar Documents

Publication Publication Date Title
US4769767A (en) Memory patching system
US20010042243A1 (en) Arrangements having firmware support for different processor types
US7039799B2 (en) Methods and structure for BIOS reconfiguration
US6539474B2 (en) System and method for selectively executing different boot routines depending on whether an error is detected
US7174537B2 (en) Microcomputer control system in which programs can be modified and newer versions of the modified programs being detected and executed
US6546517B1 (en) Semiconductor memory
US20030084229A1 (en) Methods and apparatus for modifying programs stored in read only memory
US6530005B2 (en) Circuit arrangement and method for creating and retrieving patch data from memory
US7003656B2 (en) Automatic selection of firmware for a computer that allows a plurality of process types
US6401201B2 (en) Arrangements offering firmware support for different input/output (I/O) types
JPH09265391A (en) Controller with program rom correction function, electronic equipment provided with the controller and correction method for program
JPH0939212A (en) Controller for printing machine
US7047444B2 (en) Address selection for testing of a microprocessor
US20050289336A1 (en) Method and apparatus for switching among multiple initial execution addresses
JPH10333898A (en) Microcomputer
JP3358214B2 (en) Electronic equipment
JPH1011277A (en) Computer device with electrically rewritable nonvolatile memory and nonvolatile semiconductor memory
JP2003044305A (en) Electronic equipment and correcting method
JPH1125006A (en) Memory tester
JP2928216B1 (en) Semiconductor integrated circuit
JPH1050086A (en) Microcomputer having eeprom and its rewriting method
JPH05143315A (en) Version up method for firmware
CN116610363A (en) Micro control unit, dynamic address remapping method and storage medium
JP3001464B2 (en) Microprocessor device
JP2005327112A (en) Information processor, program execution method and program

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20010925