JPH08314700A - Control system - Google Patents

Control system

Info

Publication number
JPH08314700A
JPH08314700A JP7116139A JP11613995A JPH08314700A JP H08314700 A JPH08314700 A JP H08314700A JP 7116139 A JP7116139 A JP 7116139A JP 11613995 A JP11613995 A JP 11613995A JP H08314700 A JPH08314700 A JP H08314700A
Authority
JP
Japan
Prior art keywords
program
area
code
program code
start address
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
JP7116139A
Other languages
Japanese (ja)
Inventor
Wataru Ono
渉 大野
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 JP7116139A priority Critical patent/JPH08314700A/en
Publication of JPH08314700A publication Critical patent/JPH08314700A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PURPOSE: To provide the control system which easily alters the operation of an electric equipment by modifying a software program. CONSTITUTION: A CPU 2 which controls the operation of the electric equipment 11 is connected to flash memories 6 and 7 for storing the program code through a data bus 3 and an address bus 4 and also connected to a communication device 5 connected to an external device by a communication line 12; and the program code sent from the external device by the communication device 5 is written in the flash memory 6 or 7 and the start address of a start address storage area is changed to make the CPU 2 operate according to a new program, thereby easily altering its operation without disassembling the electronic equipment 11.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、マイクロプロセッサを
用いて電気機器の制御を行う制御システムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control system for controlling electric equipment using a microprocessor.

【0002】[0002]

【従来の技術】近年、マイクロプロセッサを機器内に内
蔵してソフトウェアプログラムによって電気機器の制御
を行うものが主流になってきている。ソフトウェアによ
ってプログラムを行うことによって、ハードウェアでの
変更無しに電気機器の動作を変更することが容易にでき
る利点がある。
2. Description of the Related Art In recent years, a mainstream is one in which a microprocessor is built in a device to control an electric device by a software program. By programming with software, there is an advantage that the operation of the electric device can be easily changed without changing with hardware.

【0003】これは、記憶装置(メモリ)に記憶したソ
フトウェアプログラムに従ってマイクロプロセッサが周
辺素子を制御するもので、このメモリを交換するのみ
で、マイクロプロセッサの動作を変更することができ
る。
This is because the microprocessor controls the peripheral elements according to the software program stored in the storage device (memory), and the operation of the microprocessor can be changed only by replacing this memory.

【0004】[0004]

【発明が解決しようとする課題】ソフトウェアの変更は
メモリの交換で済むものであるが、メモリ素子自体は電
気機器内部に実装されているため、メモリ素子を交換す
るためには電気機器のカバー等を開けなければならな
い。
The software can be changed only by replacing the memory. However, since the memory element itself is mounted inside the electric device, the cover of the electric device is opened to replace the memory device. There must be.

【0005】このため、簡単なソフトウェアの変更にお
いても電気機器を分解してメモリを交換した後、再度組
立直さなければならない。これは手間のかかることであ
り、また一度電気機器を分解し、組み立てるときの信頼
性の確保などが問題となる。特に、医用電気機器などに
おいては、耐電圧や漏れ電流等の医用安全試験を再度行
わなければならず、保守の面で問題がある。
For this reason, even in the case of a simple software change, it is necessary to disassemble the electric equipment, replace the memory, and then reassemble it. This is troublesome, and there is a problem in that reliability is ensured when the electric device is disassembled and then assembled. In particular, in medical electrical equipment and the like, medical safety tests such as withstand voltage and leakage current must be performed again, which is a problem in terms of maintenance.

【0006】また、メモリの交換を可能にするために素
子用のソケットを用いるため、実装面積が大きくなるこ
とや、ソケットの分、価格が高くなるという欠点があ
る。
Further, since a socket for an element is used to enable replacement of the memory, there are drawbacks that the mounting area becomes large and the cost is increased due to the socket.

【0007】本発明はこれらの問題を鑑みてなされたも
のであり、容易にソフトウェアプログラムの変更により
電気機器の動作を変更できる制御システムを提供するこ
とを目的とする。
The present invention has been made in view of these problems, and an object of the present invention is to provide a control system capable of easily changing the operation of an electric device by changing a software program.

【0008】[0008]

【課題を解決するための手段及び作用】本発明は、マイ
クロプロセッサの作業手順を示すプログラムコードを記
憶する書換可能なフラッシュメモリと、電気機器外部か
らデータを受け取るインターフェースからなる。フラッ
シュメモリは複数の領域に分かれ、それぞれの領域には
複数種類のプログラムコードが記憶可能であり、これら
のプログラムコードのうち1つのプログラムコードを選
択的に実行する。
The present invention comprises a rewritable flash memory for storing a program code indicating a working procedure of a microprocessor, and an interface for receiving data from the outside of an electric device. The flash memory is divided into a plurality of areas, and a plurality of types of program codes can be stored in each area, and one of these program codes is selectively executed.

【0009】プログラムに変更が生じた場合には、この
プログラム或いは専用に設けたプログラムによって、電
気機器外部より通信で、またはバスから直接に新たなプ
ログラムコードを受取り、フラッシュメモリの残りの領
域の1つに書き込む。書き込みが終了した時点で、この
書き込んだ領域のプログラムコードにマイクロプロセッ
サの制御を渡すことで、プログラムの変更ができる。
When a change occurs in the program, this program or a specially-provided program receives a new program code from the outside of the electric device by communication or directly from the bus, and the remaining 1 area of the flash memory is read. Write in one. When the writing is completed, the program can be changed by passing control of the microprocessor to the program code in the written area.

【0010】[0010]

【実施例】以下、本発明の実施例を図面に基づいて説明
する。図1ないし図6は本発明の第1実施例に係り、図
1は第1実施例の制御システムの構成を示し、図2は第
1実施例の変形例の制御システムの構成を示し、図3は
メモリマップの構成を示し、図4はマイクロプロセッサ
の動作開始時の処理内容を示し、図5はプログラムコー
ドの書換或いは変更を行う処理内容を示し、図6は図5
の動作説明図を示す。
Embodiments of the present invention will be described below with reference to the drawings. 1 to 6 relate to a first embodiment of the present invention, FIG. 1 shows a configuration of a control system of the first embodiment, and FIG. 2 shows a configuration of a control system of a modified example of the first embodiment. 3 shows the structure of the memory map, FIG. 4 shows the processing contents when the operation of the microprocessor is started, FIG. 5 shows the processing contents for rewriting or changing the program code, and FIG.
The operation | movement explanatory drawing of is shown.

【0011】図1に示す本発明の第1実施例の制御シス
テム1は、通信を用いて書換を行うことのできるもので
あり、この制御システム1では制御システム全体の制御
を行うマイクロプロセッサ(以下、CPUと略記)2は
データバス3及びアドレスバス4を介して通信用デバイ
ス(或いは通信用素子)5、プログラムコードの格納に
使用される書換可能な記憶素子としてのフラッシュメモ
リ6及び7、データ及びスタック用のRAM8と接続さ
れている。
The control system 1 according to the first embodiment of the present invention shown in FIG. 1 is capable of rewriting using communication. In this control system 1, a microprocessor (hereinafter, referred to as "control system") for controlling the entire control system is used. , Abbreviated as CPU) 2 is a communication device (or communication element) 5 via a data bus 3 and an address bus 4, flash memories 6 and 7 as rewritable storage elements used for storing program codes, and data. And the RAM 8 for stacking.

【0012】これらのデバイス(つまり、通信用デバイ
ス5、フラッシュメモリ6及び7、RAM8)は、CP
U2からの読み書き用の信号と、アドレス信号からデコ
ーダ9によって生成される制御信号10でコントロール
される。
These devices (that is, the communication device 5, the flash memories 6 and 7, and the RAM 8) are CPs.
It is controlled by a read / write signal from U2 and a control signal 10 generated by a decoder 9 from an address signal.

【0013】また、CPU2によりその動作の全体或い
は少なくとも一部の動作が電気的に制御される電気機器
11も少なくとも一部等がデータバス3及びアドレスバ
ス4を介してCPU2と接続されると共に、デコーダ9
を介した制御信号10でCPU2からコントロールでき
る構成である。
Further, at least a part of the electric device 11 whose whole or at least a part of its operation is electrically controlled by the CPU 2 is connected to the CPU 2 through the data bus 3 and the address bus 4, and Decoder 9
The CPU 2 can be controlled by the control signal 10 via.

【0014】つまり、電気機器11はこのCPU2によ
りその動作が制御され、かつCPU2のプログラムを変
更することにより異なる動作或いは動作の変更がができ
る構造になっている。
That is, the electric device 11 has a structure in which its operation is controlled by the CPU 2 and a different operation or change of the operation can be performed by changing the program of the CPU 2.

【0015】通信用デバイス5は例えばシリアルの通信
ライン12を介して制御システム1の外部のパソコンな
どの外部装置と接続されるインタフェースとして機能
し、少なくとも外部装置からプログラムコードのデータ
を受け取る機能を有する。
The communication device 5 functions as an interface connected to an external device such as a personal computer outside the control system 1 via, for example, a serial communication line 12, and has at least a function of receiving program code data from the external device. .

【0016】図2の制御システム1′は、データバス
3、アドレスバス4を介して外部装置より直接、プログ
ラムコードのデータを受け取ることができる変形例を示
す。図1と同様に、CPU2はデータバス3及びアドレ
スバス4を介して通信用デバイス5、プログラムコード
格納用フラッシュメモリ6及び7データ及びスタック用
のRAM8が接続されると共に、電気機器11も接続さ
れている。
The control system 1'of FIG. 2 shows a modification in which the data of the program code can be directly received from an external device via the data bus 3 and the address bus 4. Similar to FIG. 1, the CPU 2 is connected with the communication device 5, the program code storage flash memories 6 and 7 via the data bus 3 and the address bus 4, and the RAM 8 for stacking data and the electric device 11. ing.

【0017】これらのデバイス及び電気機器11ははデ
コーダ9を介して制御信号によって制御される。また、
この変形例では外部装置からのデータはバスコントロー
ラ13によって入出力の制御が行われる。図3は制御シ
ステム1及び1′のメモリマップの構成を示す。
These devices and electric equipment 11 are controlled by control signals via the decoder 9. Also,
In this modification, the bus controller 13 controls input / output of data from an external device. FIG. 3 shows the structure of the memory maps of the control systems 1 and 1 '.

【0018】メモリは図のように大きく分けると、図1
或いは図2のRAM8により形成されたRAM領域と、
フラッシュメモリ6及び7で形成されたROM領域に分
かれる。RAM領域はプログラム実行中のデータ及びス
タックなどを記憶する領域で、ROM領域にはCPU2
の動作手順であるプログラムコードが格納される。
The memory is roughly divided as shown in FIG.
Alternatively, a RAM area formed by the RAM 8 of FIG.
It is divided into a ROM area formed by the flash memories 6 and 7. The RAM area is an area for storing data during execution of the program and a stack, and the ROM area is the CPU 2
The program code which is the operation procedure of is stored.

【0019】図3に示すようにROM領域は0番地(或
いは0アドレス)から始まるスタートアップルーチンエ
リア21、開始アドレス格納エリア22及び複数のコー
ドエリア、つまり第1コードエリア23a及び第2コー
ドエリア23bからなる。
As shown in FIG. 3, the ROM area includes a start-up routine area 21 starting from address 0 (or 0 address), a start address storing area 22 and a plurality of code areas, that is, a first code area 23a and a second code area 23b. Become.

【0020】図2では第1コードエリア23aの最終ア
ドレスに続いて第2コードエリア23bの開始アドレス
が設定され、第2コードエリア23bの最終アドレスに
続いてRAM領域のデータ・スタックエリア24の開始
アドレスが設定されるようにしている。例えば、フラッ
シュメモリ6でスタートアップルーチンエリア21、開
始アドレス格納エリア22及び第1コードエリア23a
が形成され、フラッシュメモリ7で第2コードエリア2
3bが形成されている。
In FIG. 2, the start address of the second code area 23b is set following the end address of the first code area 23a, and the start of the data stack area 24 of the RAM area is provided following the end address of the second code area 23b. The address is set. For example, in the flash memory 6, the startup routine area 21, the start address storage area 22 and the first code area 23a
And the second code area 2 is formed in the flash memory 7.
3b is formed.

【0021】そして、開始アドレス格納エリア22に格
納される開始アドレスが第1コードエリア23aの開始
アドレスの場合には第1コードエリア23aのプログラ
ムコードを実行し、開始アドレス格納エリア22に格納
される開始アドレスが第2コードエリア23bの開始ア
ドレスの場合には第2コードエリア23bのプログラム
コードを実行する。
When the start address stored in the start address storage area 22 is the start address of the first code area 23a, the program code of the first code area 23a is executed and stored in the start address storage area 22. When the start address is the start address of the second code area 23b, the program code of the second code area 23b is executed.

【0022】図4はCPU2の動作開始時の概略の処理
手順を示す。電源投入時にまずCPU2は、ステップS
1のスタートアップルーチン21を実行する。つまり、
0番地のスタートアップルーチン21を実行し、次にス
テップS2のメモリ及びレジスタの初期化を行う。
FIG. 4 shows a schematic processing procedure when the operation of the CPU 2 is started. When the power is turned on, the CPU 2 first executes the step S
The startup routine 21 of No. 1 is executed. That is,
The start-up routine 21 at the address 0 is executed, and then the memory and register in step S2 are initialized.

【0023】続いてステップS3のプログラムの開始ア
ドレス格納エリア22の格納内容、つまり開始アドレス
を参照し、その開始アドレスが示すプログラムコードを
実行する。このときの開始アドレスの値によってステッ
プS4aの第1コードエリア23a、またはステップS
4bの第2コードエリア23bに格納されているいずれ
かのプログラムが実行される。
Subsequently, the stored contents of the program start address storage area 22 in step S3, that is, the start address is referred to, and the program code indicated by the start address is executed. Depending on the value of the start address at this time, the first code area 23a in step S4a, or step S4a
One of the programs stored in the second code area 23b of 4b is executed.

【0024】従って、例えば開始アドレス格納エリア2
2に最初は第1コードエリア23aの開始アドレス値を
書き込んだ状態から第2コードエリア23bの開始アド
レス値に書き換えて変更することにより、第2コードエ
リア23bのプログラムを実行させることができる構成
にしている。
Therefore, for example, the start address storage area 2
In FIG. 2, the start address value of the first code area 23a is first written to the start address value of the second code area 23b so that the program in the second code area 23b can be executed. ing.

【0025】図5のフローチャートはこのプログラムコ
ードの変更の処理手順を示し、図6はその補助の説明図
を示す。図6(A)に示すように開始アドレス格納エリ
ア22には第1コードエリア23aの開始アドレス△△
△△が格納されているとすると、図5のプログラムスタ
ート時には、ステップS11の第1コードエリア23a
のプログラム(第1プログラムと記す)を実行する。こ
の場合、プログラム内容に応じて、データ・スタックエ
リア(その開始アドレスは図6(A)で□□□□で示し
ている)のデータ等を参照する。
The flowchart of FIG. 5 shows the processing procedure for changing the program code, and FIG. 6 shows an explanatory view of its assistance. As shown in FIG. 6A, the start address storage area 22 has a start address ΔΔ of the first code area 23a.
Assuming that ΔΔ is stored, the first code area 23a in step S11 is set at the program start time in FIG.
Program (referred to as a first program) is executed. In this case, the data in the data stack area (its start address is indicated by □□□□ in FIG. 6A) is referred to according to the program contents.

【0026】図6(A)は第1プログラムの実行位置を
示すプログラムカウンタを示し、この実行位置は第1コ
ードエリア23a内にある。なお、図6において、第1
コードエリア23a及び第2コードエリア23bの斜線
はプログラムコードが書き込まれていることを示し、図
6(A)の第2コードエリア23bの全体及び図6
(B)の第2コードエリア23bの一部の空白はプログ
ラムコードが書き込まれていない状態を示す。また、簡
単化のため、21〜23bの符号は図6(A)のみで示
し、図6(B)〜(G)では省略している。
FIG. 6A shows a program counter indicating the execution position of the first program, which execution position is in the first code area 23a. In addition, in FIG. 6, the first
The diagonal lines of the code area 23a and the second code area 23b indicate that the program code is written, and the entire second code area 23b of FIG. 6A and FIG.
A part of the blank in the second code area 23b in (B) shows a state where no program code is written. Further, for simplification, the reference numerals 21 to 23b are shown only in FIG. 6A and are omitted in FIGS. 6B to 6G.

【0027】第1プログラムの実行中に外部装置からの
外部命令が送られると、図1の通信用デバイス5は割り
込みなどによりCPU2にその外部命令を伝える。ま
た、図2の場合には外部装置からの外部命令が送られる
と、バスコントローラ13を介して割り込みなどにより
CPU2にその外部命令を伝える。
When an external command is sent from an external device during execution of the first program, the communication device 5 in FIG. 1 notifies the CPU 2 of the external command by an interrupt or the like. Further, in the case of FIG. 2, when an external command is sent from an external device, the external command is transmitted to the CPU 2 by an interrupt or the like via the bus controller 13.

【0028】CPU2はステップS12で外部命令がプ
ログラム変更の命令か否かの判断を行い、プログラム変
更でない場合にはステップS1を続行する。プログラム
変更の命令の場合にはCPU2はステップS13のよう
き通信/バスから新しいプログラムコード(第2プログ
ラムコードと記す)を受信し、ステップS14のフラッ
シュメモリ書込の処理を行う。
In step S12, the CPU 2 determines whether or not the external instruction is a program change instruction, and if it is not the program change, the step S1 is continued. In the case of a program change instruction, the CPU 2 receives a new program code (referred to as a second program code) from the communication / bus as in step S13, and performs the flash memory writing process in step S14.

【0029】つまり、図1の構成の場合には通信用デバ
イス5を介して外部装置から送られる第2プログラムコ
ードのデータを受け取り、例えばフラッシュメモリ7の
第2コードエリア23bに、例えば下位側のアドレスか
ら順次書き込む(フラッシュメモリ6には第1プログラ
ムコードが書き込まれているとする)。
That is, in the case of the configuration of FIG. 1, the data of the second program code transmitted from the external device is received via the communication device 5, and is stored in, for example, the second code area 23b of the flash memory 7 on the lower side. Data is sequentially written from the address (the first program code is written in the flash memory 6).

【0030】又、図2の構成の場合にはバスコントロー
ラ13はデータバス3及びアドレスバス4を介して送ら
れる第2プログラムコードのデータを受け取り、CPU
2は受け取った第2プログラムコードのデータを例えば
フラッシュメモリ7の第2コードエリア23bに、例え
ば下位側のアドレスから順次書き込む。
In the case of the configuration of FIG. 2, the bus controller 13 receives the data of the second program code sent via the data bus 3 and the address bus 4, and the CPU
2 sequentially writes the received data of the second program code into, for example, the second code area 23b of the flash memory 7 from the lower address.

【0031】図6(B)は第2コードエリア23bに書
き込んでいる途中の様子を示す。そして図5のステップ
S15で書込終了か否かの判断を行い、終了していない
場合にはステップS13に戻り、受信及び書込の処理を
続け、書込を終了するまで行う。図6(C)は第2コー
ドエリア23bに第2プログラムコードのデータの書込
が終了した状態を示す。
FIG. 6B shows a state in the middle of writing in the second code area 23b. Then, in step S15 of FIG. 5, it is determined whether or not the writing is completed. If the writing is not completed, the process returns to step S13 to continue the receiving and writing processes until the writing is completed. FIG. 6C shows a state in which the writing of the data of the second program code is completed in the second code area 23b.

【0032】この書込が終了した後に、ステップS16
のプログラムコード開始アドレス書換の処理を行う。C
PU2は図6(D)に示すように開始アドレス格納エリ
ア22の内容を第2コードエリア23bの開始アドレス
であるXXXXに書き換える。
After this writing is completed, step S16
The program code start address is rewritten. C
As shown in FIG. 6D, the PU 2 rewrites the contents of the start address storage area 22 to XXX which is the start address of the second code area 23b.

【0033】この書換が終了した後、ステップS17に
示すようにリセット又は電源の再投入の状態にする。つ
まり、制御システム1或いは1′のリセット又は電源の
再投入の状態にすることにより、現在のプログラム動作
をリセットして最初からプログラム動作を行う状態にす
る。
After the completion of this rewriting, as shown in step S17, it is reset or the power is turned on again. That is, by resetting the control system 1 or 1'or turning on the power again, the current program operation is reset and the program operation is performed from the beginning.

【0034】このリセット又は電源の再投入により、プ
ログラムカウンタは開始位置が0番地に戻り、ステップ
S18のスタートアップルーチンを実行する。図6
(E)はプログラムカウンタの開始位置が0番地に戻っ
た様子を示す。このスタートアップルーチンの実行によ
り、ステップS19の開始アドレス読込を行う。
By this reset or turning on the power again, the start position of the program counter returns to 0, and the start-up routine of step S18 is executed. Figure 6
(E) shows that the start position of the program counter has returned to address 0. By executing this startup routine, the start address of step S19 is read.

【0035】つまり、CPU2はスタートアップルーチ
ンを実行する。このスタートアップルーチンの実行によ
りプログラムコード格納エリア22の開始アドレスを参
照する(図6(F)は開始アドレスを参照している状態
を示す)が、この開始アドレス格納エリア22には第2
コードエリア23bの開始アドレスXXXXが書き込ま
れているため、第2コードエリア23bに格納されてい
る第2プログラムを実行する。
That is, the CPU 2 executes the startup routine. By executing this start-up routine, the start address of the program code storage area 22 is referenced (FIG. 6F shows the state where the start address is referenced).
Since the start address XXXX of the code area 23b is written, the second program stored in the second code area 23b is executed.

【0036】つまり、ステップS20の新プログラムス
タートになる。図6(G)は第2コードエリア23bに
格納されている第2プログラムを実行している様子を示
す。このようにして制御システムのプラグラムは第1プ
ログラムから第2プログラムに書き換えられ、書き換え
られた新しいプロブラムに従って電気機器11の動作が
制御されることになる。
That is, the new program starts in step S20. FIG. 6G shows a state in which the second program stored in the second code area 23b is being executed. In this way, the program of the control system is rewritten from the first program to the second program, and the operation of the electric device 11 is controlled according to the rewritten new program.

【0037】図5ではステップS20の新プログラムス
タートの後、再びステップS11に戻る。この場合、ス
テップS11の第1コードエリアのプログラム実行は第
2コードエリアのプログラム実行になり、外部命令によ
り第2コードエリアのプログラム実行をさらに変更する
こともできる。この変更を行う場合には第1コードエリ
ア23aに新しいプログラムを書込む、或いは書換を行
う。そして、全て書込んだ後に開始アドレスの書換を行
い、リセット或いは電源再投入によりさらに新しいプロ
グラムを実行することができる。
In FIG. 5, after the start of the new program in step S20, the process returns to step S11. In this case, the program execution in the first code area in step S11 becomes the program execution in the second code area, and the program execution in the second code area can be further changed by an external instruction. To make this change, a new program is written or rewritten in the first code area 23a. Then, after writing all, the start address is rewritten, and a new program can be executed by resetting or turning on the power again.

【0038】この第1実施例によれば、制御システム1
或いは1′の外部から新しいプログラムコードを受け取
る手段としての通信用デバイス5或いはバスコントロー
ラ13と、受け取った新しいプログラムコードを記憶す
るプログラム変更用の記憶デバイスとしてのフラッシュ
メモリ6或いは7と、新しいプログラムコードの開始ア
ドレスを示す開始アドレス格納エリア22を設けている
ので、電気機器11或いは制御システム1、1′のカバ
ーを開けてメモリの交換を行う分解作業を行うことなく
新しいプログラムコードでプログラムを走らせることが
でき、分解及び組立の手間を省くことができる。
According to this first embodiment, the control system 1
Alternatively, the communication device 5 or the bus controller 13 as a means for receiving a new program code from the outside of 1 ', the flash memory 6 or 7 as a program changing storage device for storing the received new program code, and the new program code. Since the start address storage area 22 indicating the start address of the electric equipment 11 is provided, the program can be run with a new program code without opening the cover of the electric device 11 or the control system 1, 1'and replacing the memory. Therefore, the labor of disassembly and assembly can be saved.

【0039】また、分解を行ったための電気機器11の
安全性などに関する試験を行うことも不要或い最小限に
できる。また、容易にプログラムの変更ができ、この変
更により電気機器11の動作の変更が容易にできる。さ
らに、分解後の誤組立の可能性を解消して電気機器11
の動作変更ができるので、信頼性れ及び保守性を向上で
きることにもなる。
Further, it is unnecessary or possible to minimize the test concerning the safety of the electric device 11 after the disassembly. In addition, the program can be easily changed, and the operation of the electric device 11 can be easily changed by this change. Furthermore, the possibility of incorrect assembly after disassembly is eliminated, and the electrical device 11
Since the operation of can be changed, reliability and maintainability can be improved.

【0040】次に本発明の第2実施例を説明する。図7
ないし図9は本発明の第2実施例に係り、図7は第2実
施例の制御システム29の構成を示し、図8はメモリマ
ップの構成を示し、図9はプログラムコード変更のフロ
ーチャートを示す。
Next, a second embodiment of the present invention will be described. Figure 7
9 to 20 relate to the second embodiment of the present invention, FIG. 7 shows the configuration of the control system 29 of the second embodiment, FIG. 8 shows the configuration of the memory map, and FIG. 9 shows a flow chart for changing the program code. .

【0041】図7に示す第2実施例の制御システム29
は外部装置から通信及びバスのいずれでもプログラムコ
ードの変更ができるように通信用デバイス5及びバスコ
ントローラ13を有する。
The control system 29 of the second embodiment shown in FIG.
Has a communication device 5 and a bus controller 13 so that the program code can be changed from an external device through either communication or bus.

【0042】また、第1実施例ではROM領域は2つの
フラッシュメモリ6及び7で形成されていたが、この実
施例ではROM領域が4つのROM(つまり第0ROM
30、第1ROM31,第2ROM32、第3ROM3
3)で形成されている。そして、図8に示すように第0
ROM30にはスタートアップルーチン及びプログラム
コードの書換プログラムが格納されている。
Further, in the first embodiment, the ROM area was formed by the two flash memories 6 and 7, but in this embodiment, the ROM area has four ROMs (that is, the 0th ROM).
30, first ROM 31, second ROM 32, third ROM 3
3). Then, as shown in FIG.
The ROM 30 stores a startup routine and a program code rewriting program.

【0043】さらに、第1ROM31〜第3ROM33
にはそれぞれ異なるメインプログラムコード(第1〜第
3メインプログラムコード)を書き込み可能にしてい
る。また、図8に示すように第1ROM31〜第3RO
M33は同じアドレスが設定されている。
Further, the first ROM 31 to the third ROM 33
Different main program codes (first to third main program codes) can be written in each. Further, as shown in FIG. 8, the first ROM 31 to the third RO
The same address is set in M33.

【0044】そして、図7に示すようにそれぞれチップ
セレクト端子CEがそれぞれ抵抗Rでプルアップされた
ディップスイッチ36と接続され、このディップスイッ
チ36の3つのスイッチDS1〜DS3で選択された1
つのROMをアクセスできる構成にし、その選択された
ROMに書き込まれたプログラムコードを走らせたり、
プログラムコードを書換えたりできるようにしている。
Then, as shown in FIG. 7, each chip select terminal CE is connected to a dip switch 36 pulled up by a resistor R, and one of the three switches DS1 to DS3 of the dip switch 36 is selected.
You can access two ROMs, run the program code written in the selected ROM,
The program code can be rewritten.

【0045】これら複数の第0ROM30〜第3ROM
33はフラッシュメモリで構成されている。つまり、図
8に示すようにこれら3つの第1ROM31〜第3RO
M33は同じアドレスに並列に接続され、前記ディップ
スイッチ36によって1つだけ選択される(図7ではス
イッチDS1が0であるので、第1ROM31が選択さ
れている)。
The plurality of 0th ROM 30 to 3rd ROM
Reference numeral 33 is a flash memory. That is, as shown in FIG. 8, these three first ROM 31 to third RO
M33 is connected in parallel to the same address, and only one is selected by the dip switch 36 (since the switch DS1 is 0 in FIG. 7, the first ROM 31 is selected).

【0046】なお、このディップスイッチ36は制御シ
ステム29の背面パネル等の外部から操作できる位置に
設置され、外部からの操作で、必要に応じて複数のプロ
グラムコードを切り換えて実行できる。
The DIP switch 36 is installed at a position such as a rear panel of the control system 29 that can be operated from the outside, and a plurality of program codes can be switched and executed as necessary by an operation from the outside.

【0047】図9はプログラムコード変更或いはプログ
ラム書換のフローチャートを示す。プログラムがスター
トすると、CPU2はステップS21の通常プログラム
を実行する。
FIG. 9 shows a flowchart for changing the program code or rewriting the program. When the program starts, the CPU 2 executes the normal program in step S21.

【0048】図7の設定ではディップスイッチ36によ
って第1ROM31が選択されているので、CPU2は
図8の第1ROM31のコードエリアの第1メインプロ
グラムを実行している。
Since the first ROM 31 is selected by the dip switch 36 in the setting of FIG. 7, the CPU 2 is executing the first main program in the code area of the first ROM 31 of FIG.

【0049】そして、ステップS22でプログラム変更
か否かの判断を行い、外部命令によってプログラムコー
ドの変更命令を受けると、CPU2はステップS23の
書換プログラムを実行する。つまり、プログラムカウン
タの実行位置は図8に示す書換プログラムの開始アドレ
ス(0200H)に設定される。
Then, in step S22, it is determined whether or not the program is changed, and when the program code change instruction is received by the external instruction, the CPU 2 executes the rewriting program in step S23. That is, the execution position of the program counter is set to the start address (0200H) of the rewriting program shown in FIG.

【0050】そして、ステップS24に示すように通信
又はバスからの新プログラムコードの受信を行い、ステ
ップS25に示すフラッシュメモリ書換の処理を行う。
ステップS25に示すフラッシュメモリ書換の処理を行
う前にディップスイッチ36を操作してスイッチDS2
を0或いはDS3を0にして書き込まれるROMを指定
する。
Then, as shown in step S24, the new program code is received from the communication or the bus, and the flash memory rewriting process shown in step S25 is performed.
Before performing the flash memory rewriting process shown in step S25, the DIP switch 36 is operated to operate the switch DS2.
Is set to 0 or DS3 is set to 0 to specify the ROM to be written.

【0051】次のステップS26で書換終了か否かの判
断を行い、終了していない場合にはステップS24に戻
り、通信又はバスからの新プログラムコードの受信及び
フラッシュメモリ書換の処理を行う。
In the next step S26, it is determined whether or not the rewriting has been completed. If the rewriting is not completed, the process returns to step S24, and the process of communication or receiving a new program code from the bus and rewriting the flash memory is performed.

【0052】そして、書換終了した後に、ステップS2
7のリセット又は電源再投入の処理を行うことによりC
PU2は書換後の新しいプログラムを、ステップS21
に示す通常プログラムとして実行する。
After the rewriting is completed, step S2
C by performing the process of 7 reset or power-on
PU2 executes the new program after rewriting in step S21.
It is executed as a normal program shown in.

【0053】なお、この書換により例えば第2ROM3
2に新しいプログラムを書込み、さらにこの通常プログ
ラムの実行中に外部命令により第3ROM33に新しい
プログラムを書込み、リセット又は電源再投入の場合
に、3つのスイッチDS1〜DS3を0にすることによ
り複数のプログラムの任意のプログラムを実行させるこ
とができる。
By this rewriting, for example, the second ROM 3
2 by writing a new program into the third ROM 33 by an external command during execution of this normal program, and by resetting or turning on the power again, the three switches DS1 to DS3 are set to 0, thereby a plurality of programs are written. Any program can be executed.

【0054】この第2実施例によれば、複数のスイッチ
の選択により複数のプログラムの任意の1つを実行させ
ることもできる。また、アドレスが同じ或いは一部のア
ドレスが重なる場合でも対応できる。また、外部装置か
ら通信及びバスのどちらを利用してもプログラムコード
を受け取ることができる。その他は第1実施例とほぼ同
様の効果を有する。
According to the second embodiment, it is possible to execute any one of the plurality of programs by selecting a plurality of switches. Further, it is possible to deal with the case where the addresses are the same or some of the addresses overlap. Also, the program code can be received from an external device by using either communication or a bus. Others have substantially the same effects as the first embodiment.

【0055】なお、上述の各実施例などの説明ではRA
M8のデータ・スタックは共通に使用されることを想定
しているが、RAMも複数の領域に分割するなどして、
実行されるプログラムに応じてデータも変更或いは書き
換えられるようにしても良い。
In the description of each of the above embodiments, RA
It is assumed that the M8 data stack will be used in common, but by dividing the RAM into multiple areas,
The data may be changed or rewritten according to the program to be executed.

【0056】[付記] 2.請求項1において、前記記憶素子が2つ以上の異な
るプログラムコードを記憶する領域と、1つの前記開始
番地を記憶する領域を有することを特徴とする制御シス
テム。
[Additional Notes] 2. 2. The control system according to claim 1, wherein the storage element has an area for storing two or more different program codes and an area for storing one start address.

【0057】3.付記2において、前記2つ以上の異な
るプログラムコードを切り換えて実行する手段を有する
ことを特徴とする制御システム。
3. The control system according to appendix 2, comprising means for switching and executing the two or more different program codes.

【0058】4.請求項1において、前記プログラムコ
ードを外部より受け取る手段が通信または外部に出され
たバスであることを特徴とする制御システム。
4. 2. The control system according to claim 1, wherein the means for receiving the program code from the outside is a bus that is communicated or output to the outside.

【0059】5.請求項1において、1つの記憶素子の
書換プログラムコードを格納する記憶素子と、プログラ
ムコードを格納した複数の前記書換可能な記憶素子と、
前記複数の記憶素子の中から1つの前記記憶素子を選択
する手段と、前記1つの記憶素子を実行、或いは前記記
憶素子書換プログラムに従って書き換える手段を有する
ことを特徴とする制御システム。
5. The storage element for storing a rewrite program code of one storage element, and the plurality of rewritable storage elements storing a program code according to claim 1.
A control system comprising: means for selecting one of the plurality of storage elements, and means for executing the one storage element or rewriting according to the storage element rewriting program.

【0060】[0060]

【発明の効果】以上説明したように本発明によれば、マ
イクロプロセッサを用いて電気機器の制御を行う制御シ
ステムにおいて、プログラムコードのデータを電気機器
の外部より受け取る手段と、前記プログラムコードを記
憶する書換可能な記憶素子と、前記記憶素子に記憶させ
た前記プログラムコードの開始番地を示す手段を具備し
ているので電気機器を分解することなく、前記プログラ
ムコードと書き換えることができるので、分解及び組立
に伴う手間を省くことができると共に、分解等に伴う安
全性の試験等も省くこともできて、電気機器の動作の変
更等を簡単に行うことができる。
As described above, according to the present invention, in a control system for controlling an electric device by using a microprocessor, a means for receiving data of a program code from the outside of the electric device and storing the program code. Since the rewritable storage element and the means for indicating the start address of the program code stored in the storage element are provided, the program code can be rewritten without disassembling the electric device. It is possible to save the labor required for assembling, and to omit the safety test due to the disassembly and the like, and it is possible to easily change the operation of the electric device.

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

【図1】本発明の第1実施例の制御システムの概略の構
成図。
FIG. 1 is a schematic configuration diagram of a control system according to a first embodiment of the present invention.

【図2】第1実施例の変形例の制御システムの概略の構
成図。
FIG. 2 is a schematic configuration diagram of a control system of a modified example of the first embodiment.

【図3】メモリマップを示す図。FIG. 3 is a diagram showing a memory map.

【図4】スタートアップルーチンの処理を示すフローチ
ャート図。
FIG. 4 is a flowchart showing processing of a startup routine.

【図5】第1実施例のプログラムコード変更の処理手順
を示すフローチャート図。
FIG. 5 is a flowchart showing a processing procedure for changing a program code according to the first embodiment.

【図6】図5の補助の説明図。FIG. 6 is an explanatory diagram of assistance of FIG.

【図7】本発明の第2実施例の制御システムの概略の構
成図。
FIG. 7 is a schematic configuration diagram of a control system according to a second embodiment of the present invention.

【図8】メモリマップを示す図。FIG. 8 is a diagram showing a memory map.

【図9】第2実施例のプログラムコード変更の処理手順
を示すフローチャート図。
FIG. 9 is a flowchart showing a processing procedure for changing a program code according to the second embodiment.

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

1,1′…制御システム 2…CPU 3…データバス 4…アドレスバス 5…通信用デバイス 6,7…フラッシュメモリ 8…RAM 9…デコーダ 10…制御信号 11…電気機器 12…通信ライン 13…バスコントローラ 21…スタートアップルーチンエリア 22…開始アドレ格納エリアス 23a…第1コードエリア 23b…第2コードエリア 24…データ・スタックエリア 1, 1 '... Control system 2 ... CPU 3 ... Data bus 4 ... Address bus 5 ... Communication device 6, 7 ... Flash memory 8 ... RAM 9 ... Decoder 10 ... Control signal 11 ... Electrical equipment 12 ... Communication line 13 ... Bus Controller 21 ... Startup routine area 22 ... Start address storage area 23a ... First code area 23b ... Second code area 24 ... Data stack area

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 マイクロプロセッサを用いて電気機器の
制御を行う制御システムにおいて、プログラムコードの
データを電気機器の外部より受け取る手段と、前記プロ
グラムコードを記憶する書換可能な記憶素子と、前記記
憶素子に記憶させた前記プログラムコードの開始番地を
示す手段を具備し、前記プログラムコードと前記開始番
地に従って動作することを特徴とする制御システム。
1. A control system for controlling an electric device using a microprocessor, means for receiving data of a program code from the outside of the electric device, a rewritable storage element for storing the program code, and the storage device. A control system comprising: means for indicating a start address of the program code stored in, and operating according to the program code and the start address.
JP7116139A 1995-05-15 1995-05-15 Control system Pending JPH08314700A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7116139A JPH08314700A (en) 1995-05-15 1995-05-15 Control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7116139A JPH08314700A (en) 1995-05-15 1995-05-15 Control system

Publications (1)

Publication Number Publication Date
JPH08314700A true JPH08314700A (en) 1996-11-29

Family

ID=14679709

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7116139A Pending JPH08314700A (en) 1995-05-15 1995-05-15 Control system

Country Status (1)

Country Link
JP (1) JPH08314700A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021144674A (en) * 2020-03-11 2021-09-24 ベイジン バイドゥ ネットコム サイエンス アンド テクノロジー カンパニー リミテッド Processing method for audio processing chip, apparatus, electronic device, computer readable storage medium, and computer program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021144674A (en) * 2020-03-11 2021-09-24 ベイジン バイドゥ ネットコム サイエンス アンド テクノロジー カンパニー リミテッド Processing method for audio processing chip, apparatus, electronic device, computer readable storage medium, and computer program

Similar Documents

Publication Publication Date Title
KR100198382B1 (en) Computer with multi-booting function
US4663707A (en) Multilevel bootstrap apparatus
JP3372964B2 (en) Computer system
US6115814A (en) Memory paging scheme for 8051 class microcontrollers
KR100248757B1 (en) Method of damaged rom bios recovery function
KR100280637B1 (en) Computer system capable of data update of fixed flash ROM and its control method
US5812867A (en) Integrated circuit comprising a microprocessor, a memory and internal configurable peripherals
US7613937B2 (en) Method and apparatus for utilizing a microcontroller to provide an automatic order and timing power and reset sequencer
JP3563768B2 (en) ROM program change device
JP3173407B2 (en) Microcomputer with built-in flash EEPROM
US20140312690A1 (en) System and method for sequentially distributing power among one or more modules
CN101158907A (en) Bootloader online upgrade method
US5732281A (en) Programmable power management circuit for a power supply in a computer system
JPH08314700A (en) Control system
JPH0237600A (en) Testing of read-only-memory and device for executing the same
US6182207B1 (en) Microcontroller with register system for the indirect accessing of internal memory via auxiliary register
JP2007122151A (en) Boot controller and boot control method
JP2000293376A (en) Circuit and method for switching boot program
KR100465610B1 (en) Microcomputer with embedded flash memory having on-chip programming capability and method of programming data into the embedded flash memory
JPH1131068A (en) Reset vector switching method and information processing apparatus using the same
JPH05204654A (en) Start-up program updating system for cpu incorrorating device
JPH05289855A (en) Method for installing software
JP3405239B2 (en) Initial value setting change device
JPH08307246A (en) Method for configuring integrated circuit device and logic circuit
KR20000000888A (en) Memory program changing and reading method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040624

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040713

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040913

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041102

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041220

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050215