JP4647010B2 - Electronic control unit - Google Patents

Electronic control unit Download PDF

Info

Publication number
JP4647010B2
JP4647010B2 JP2009016665A JP2009016665A JP4647010B2 JP 4647010 B2 JP4647010 B2 JP 4647010B2 JP 2009016665 A JP2009016665 A JP 2009016665A JP 2009016665 A JP2009016665 A JP 2009016665A JP 4647010 B2 JP4647010 B2 JP 4647010B2
Authority
JP
Japan
Prior art keywords
data
section
constant
memory
written
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.)
Active
Application number
JP2009016665A
Other languages
Japanese (ja)
Other versions
JP2010176280A (en
Inventor
晃弘 石井
祥三 常數
光司 橋本
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2009016665A priority Critical patent/JP4647010B2/en
Priority to DE102009038641.6A priority patent/DE102009038641B4/en
Publication of JP2010176280A publication Critical patent/JP2010176280A/en
Application granted granted Critical
Publication of JP4647010B2 publication Critical patent/JP4647010B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7202Allocation control and policies
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/10Programming or data input circuits
    • G11C16/102External programming circuits, e.g. EPROM programmers; In-circuit programming or reprogramming; EPROM emulators

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Description

この発明は、マイクロプロセッサと協働する揮発性のRAMメモリと不揮発データメモリを備え、RAMメモリに格納された学習制御定数を不揮発データメモリに退避しておくように構成された例えば車載エンジンの制御装置或いは変速機制御装置などの電子制御装置に関し、不揮発データメモリとして使用されたフラッシュメモリの一括消去回数を抑制するための改良に関するものである。   The present invention includes a volatile RAM memory and a non-volatile data memory that cooperate with a microprocessor, and is configured to save a learning control constant stored in the RAM memory in the non-volatile data memory, for example. The present invention relates to an electronic control device such as a device or a transmission control device, and relates to an improvement for suppressing the number of batch erases of a flash memory used as a nonvolatile data memory.

入力信号回路と出力信号回路とが接続されるマイクロプロセッサと、当該マイクロプロセッサと協働する不揮発プログラムメモリと揮発性のRAMメモリと不揮発データメモリとを備え、前記不揮発プログラムメモリに転送書込みされた入出力制御プログラムと、前記不揮発データメモリに格納された制御定数の値と、前記入力信号回路の信号状態に応動して前記出力信号回路に制御出力信号を送出する電子制御装置であって、前記不揮発データメモリとしてブロック単位で個別に一括消去が可能な複数の分割ブロックを有するフラシュメモリを使用することは公知である。   A microprocessor connected to the input signal circuit and the output signal circuit; a non-volatile program memory cooperating with the microprocessor; a volatile RAM memory; and a non-volatile data memory. An electronic control device for sending a control output signal to the output signal circuit in response to an output control program, a value of a control constant stored in the nonvolatile data memory, and a signal state of the input signal circuit, the nonvolatile memory As a data memory, it is known to use a flash memory having a plurality of divided blocks that can be individually erased in units of blocks.

又、従来、フラッシュメモリに代わるものとして、1バイト(8ビット)単位で電気的に読書が行えるEEPROMメモリを使用したものもあるが、フラッシュメモリの場合には安価で大容量のメモリ容量を得ることができる反面で、データの書込・書換を行う前に多数バイトのブロック単位で一括消去を行う必要があることと、一括消去の回数が寿命的に制限されている問題がある。   Conventionally, as an alternative to the flash memory, there is an EEPROM memory that can electrically read in units of 1 byte (8 bits). However, in the case of a flash memory, an inexpensive and large-capacity memory capacity is obtained. On the other hand, there is a problem that it is necessary to perform batch erase in units of blocks of many bytes before data writing / rewriting, and the number of batch erases is limited in terms of lifetime.

例えば下記の特許文献1「車載電子制御装置」によれば、不揮発フラッシュメモリの第一ブロックはプログラムメモリとして使用され、第二・第三ブロックがデータメモリとして使用されていて、取り扱われる制御定数は次のとおりに分類されている。先ず、制御装置固有情報は、車載電子制御装置に内蔵された定電圧電源装置の出力電圧精度やAD変換器の変換精度等の部品バラツキを補正するための校正値情報であって、製品個々では異なる値であっても初期測定値として一旦格納されるとその後の変化が無い半固定制御定数である。   For example, according to the following Patent Document 1 “In-vehicle electronic control device”, the first block of the non-volatile flash memory is used as a program memory, and the second and third blocks are used as a data memory. They are classified as follows. First, the control device specific information is calibration value information for correcting component variations such as the output voltage accuracy of the constant voltage power supply device built in the in-vehicle electronic control device and the conversion accuracy of the AD converter. Even if it is a different value, it is a semi-fixed control constant that does not change thereafter once stored as an initial measurement value.

次に、車両固有情報は、車載電子制御装置が搭載された車両の制御仕様を選択決定するための車種情報或いは車載電子制御装置に外部接続された車載センサの特性精度情報等の環境情報であって、搭載車両の個々では異なる値であっても初期値又は初期測定値として一旦格納されると外部接続された部品の交換が行われるまではその後の変化が無い制御定数であり、可変制御定数又は半固定制御定数の何れかに属して扱われる。   Next, the vehicle-specific information is environmental information such as vehicle type information for selecting and determining a control specification of a vehicle on which the vehicle-mounted electronic control device is mounted, or characteristic accuracy information of a vehicle-mounted sensor externally connected to the vehicle-mounted electronic control device. Even if it is a different value for each vehicle, once it is stored as an initial value or initial measured value, it is a control constant that does not change thereafter until the externally connected parts are replaced. Or they belong to either semi-fixed control constants.

更に、学習記憶情報は、車両の運転特性を実測した結果として得られる運転制御情報、或いは車載センサ・電気負荷の特性劣化情報等の変動情報であって、運転開始時に初期値として一旦格納された後、所定範囲内での変動が想定される可変制御定数である。又、異常発生履歴情報は、車両の運転中に発生した各種の異常情報を異常発生区分に基づいて集計した区分別の異常発生回数データであって、一種の可変制御定数として扱われている。   Further, the learning storage information is driving control information obtained as a result of actually measuring the driving characteristics of the vehicle, or fluctuation information such as on-vehicle sensor / electric load characteristic deterioration information, and is temporarily stored as an initial value at the start of driving. Thereafter, the variable control constant is assumed to fluctuate within a predetermined range. The abnormality occurrence history information is data on the number of occurrences of abnormality for each category obtained by aggregating various types of abnormality information generated during the operation of the vehicle based on the category of occurrence of abnormality, and is handled as a kind of variable control constant.

又、基準データは、前記半固定制御定数又は可変制御定数に対する許容上下限値と初期設定値となる初期値データであって、これは固定制御定数として扱われる。更に、プログラム固有情報は、入出力制御プログラムに付随して決定された一定不変の設計定数となる固定制御定数である。   The reference data is initial value data that is an allowable upper / lower limit value and an initial set value for the semi-fixed control variable or the variable control constant, and is treated as a fixed control constant. Further, the program specific information is a fixed control constant that is a constant design constant determined in association with the input / output control program.

前記第一ブロックには外部ツールから入出力制御プログラムと共に固定制御定数が格納され、車載電子制御装置の出荷調整運転後に半固定制御定数が追加格納される。   In the first block, fixed control constants are stored together with an input / output control program from an external tool, and semi-fixed control constants are additionally stored after the shipment adjustment operation of the in-vehicle electronic control device.

前記第二・第三ブロックの一方には可変制御定数のみが格納され、第二ブロック又は第三ブロックの一方のブロックに逐次追加書込みされた書込み回数が所定値に達した満杯状態で、他方のブロックに書込みされていた全てのデータを消去してから当該他方のブロックに対して逐次追加書込みされるように構成されている。従って、書込み頻度が少ない固定制御定数と半固定制御定数を第一ブロックに書込むことによって、第二・第三ブロックに書込まれるデータ量を削減して、可変制御定数をなるべく多くの回数で追加書込みすることができるように構成されている。   Only the variable control constant is stored in one of the second and third blocks, and when the number of times the additional writing is sequentially performed in one of the second block or the third block reaches a predetermined value, After all data written in the block is erased, additional writing is sequentially performed on the other block. Therefore, by writing fixed control constants and semi-fixed control constants with low writing frequency to the first block, the amount of data written to the second and third blocks is reduced, and variable control constants are made as many times as possible. It is configured so that additional writing can be performed.

尚、特許文献1に於いて、第一ブロックに書込まれる固定・半固定制御定数は、後述の本願発明に於ける第一・第二定数に相当し、第二・第三ブロックの一方に交替書込みされる可変制御定数は本願における第三定数に相当している。   In Patent Document 1, the fixed / semi-fixed control constant written in the first block corresponds to the first and second constants in the present invention to be described later, and one of the second and third blocks. The variable control constant to be alternately written corresponds to the third constant in the present application.

更に、下記の特許文献2「フラッシュメモリの書込み回数の増加方法」には、データ記憶領域がセクタ単位(一括消去が可能な最小単位であり本願発明に於けるブロックに相当する)に分割され、前記セクタ単位でデータ消去可能なフラッシュメモリを備え、組込まれたマイクロプロセッサにより内部回路が制御される制御装置に於いて、フラッシュメモリのセクタA〜Fには制御プログラムが書込まれ、セクタGには書換頻度が少ない生産時に設定される行程調整データが書込まれ、セクタHには書換頻度が多いユーザ調整データが書込まれるようにした制御装置が示されている。   Furthermore, in the following Patent Document 2 “Method for increasing the number of times of writing to the flash memory”, the data storage area is divided into sector units (minimum unit capable of batch erasure and corresponding to a block in the present invention). In a control device having a flash memory capable of erasing data in units of sectors and having an internal circuit controlled by an embedded microprocessor, a control program is written in sectors A to F of the flash memory, and 1 shows a control device in which process adjustment data set at the time of production with a low rewrite frequency is written, and user adjustment data with a high rewrite frequency is written in the sector H.

そして、特許文献2には、ユーザが使用時に該制御装置の最適動作を指示するため等の目的で随時与えるユーザ調整データを格納するため前記セクタHを、更に前記ユーザ調整データのデータサイズと等しいかそれ以上のサイズの記憶ブロック(書込/読出単位となるものであり本願発明に於けるセクションに相当する)に複数分割し、前記ユーザ調整データの更新毎に前記記憶ブロック単位で未書込み領域に順次前記ユーザ調整データの書込みを行い、未書込み領域が前記セクタ内に存在しない場合には、前記ユーザ調整データを格納している前記セクタ全体のデータを一括消去して再度前記ユーザ調整データの書込みを可能にするフラッシュメモリの書込み保証回数の増加方法が開示されている。   Further, in Patent Document 2, the sector H is stored to store user adjustment data that is given whenever necessary for the purpose of instructing the optimum operation of the control device at the time of use, and the data size of the user adjustment data is further equal. A plurality of divided storage blocks (which are write / read units and correspond to sections in the present invention) are divided into a plurality of storage blocks, and unwritten areas are stored in units of the storage blocks every time the user adjustment data is updated. When the user adjustment data is sequentially written, and there is no unwritten area in the sector, the entire sector data storing the user adjustment data is collectively erased and the user adjustment data is stored again. A method of increasing the guaranteed number of write times of a flash memory that enables writing is disclosed.

この方法によれば、同一のフラッシュメモリに装置制御用のプログラムと装置の調整データを格納し、書換え頻度の高い調整データについては、フラッシュメモリの分割単位である1セクタを更に複数記憶ブロックに分割し、調整データの変更毎に未書込み記憶ブロックに書込んで行き、1セクタ分全て書込まれたら最新調整データをRAMメモリに退避させた後にそのセクタを一活消去して新たに記憶ブロック単位で書込めるようにすることにより、従来使用していたEEPROMが不要となり、コストダウン、部品点数の削減、高速データ読出しが可能となり、なおかつ書込み保証回数を実質的に大幅に増加させることができるので信頼性の高い制御装置を提供することが可能となるとされている。   According to this method, a device control program and device adjustment data are stored in the same flash memory. For adjustment data having a high rewrite frequency, one sector, which is a division unit of the flash memory, is further divided into a plurality of storage blocks. Each time adjustment data is changed, the data is written to an unwritten storage block. When all of one sector is written, the latest adjustment data is saved in the RAM memory, and then the sector is erased once and a new storage block unit is written. By making it possible to write in, it becomes unnecessary to use the EEPROM used in the past, cost reduction, reduction of the number of parts, high-speed data reading is possible, and the number of write guarantees can be substantially increased substantially. It is said that a highly reliable control device can be provided.

尚、特許文献2に於いて、セクタGに書込まれるステップ調整データは、後述の本願発明に於ける第一定数に相当し、セクタHに順次書込みされるユーザ調整データは本願に於ける第二定数に相当している。   In Patent Document 2, the step adjustment data written in the sector G corresponds to the first constant in the present invention described later, and the user adjustment data sequentially written in the sector H is in this application. It corresponds to the second constant.

特開2006―072461号公報(図4、請求項2、請求項3)Japanese Patent Laid-Open No. 2006-072461 (FIG. 4, claim 2, claim 3) 特開2002−007221号公報(図1、要約、・段落[0014])Japanese Patent Laid-Open No. 2002-007221 (FIG. 1, Abstract, Paragraph [0014])

(1) 従来技術の課題の説明
前記特許文献1による「車載電子制御装置」では、入出力制御プログラムが書込まれる第一ブロック内に固定制御定数と半固定制御定数とを書込みするように構成されているので、第二・第三ブロックのデータ量を削減することができるが、例えば保守点検を行うサービス店に於いて半固定制御定数を残したままで入出力制御プログラムのみを変更したり、入出力制御プログラムを残したままで半固定制御定数のみを一括変更することが困難となる問題点がある。
(1) Description of problems in the prior art The “on-vehicle electronic control device” according to Patent Document 1 is configured to write a fixed control constant and a semi-fixed control constant in a first block in which an input / output control program is written. Therefore, it is possible to reduce the amount of data in the second and third blocks. For example, in a service store that performs maintenance and inspection, only the input / output control program is changed while leaving the semi-fixed control constant, There is a problem that it is difficult to collectively change only the semi-fixed control constant while leaving the input / output control program.

又、前記特許文献2による「フラッシュメモリの書込み保証回数の増加方法」によれば、制御プログラム領域と行程調整データ領域とユーザ調整データ領域とが異なる一括消去単位のセクタに書込まれているので、個別に書換変更することが容易となるけれども、未書込み領域がセクタ内に存在しない場合にセクタ全体のデータを一括消去した時点で停電すると、過去の調整データが消失する問題点がある。又、データ量の少ない行程調整データ領域のために専用のセクタGを配分する必要があって、メモリの利用効率が低下する問題点がある。   Further, according to the “method for increasing the guaranteed number of writing of flash memory” according to Patent Document 2, the control program area, the stroke adjustment data area, and the user adjustment data area are written in different sectors in a batch erase unit. Although it becomes easy to individually rewrite and change the data, if there is no unwritten area in the sector and there is a power failure at the time of erasing the data of the entire sector, the past adjustment data is lost. In addition, it is necessary to allocate a dedicated sector G for the process adjustment data area with a small amount of data, and there is a problem in that the memory utilization efficiency is lowered.

(2)発明の目的の説明
この発明は、このような従来の装置に於ける問題点を解消して、フラッシュメモリである不揮発データメモリの利用効率を高め、一括消去回数を抑制して目標とする寿命を確保することができる電子制御装置を提供することを目的としてなされたものである。
(2) Description of the object of the invention The present invention eliminates the problems in the conventional apparatus, increases the use efficiency of the nonvolatile data memory, which is a flash memory, and suppresses the number of batch erases. The present invention has been made for the purpose of providing an electronic control device that can ensure a long service life.

この発明による電子制御装置は、
入力信号回路と出力信号回路とが接続されるマイクロプロセッサと、当該マイクロプロセッサと協働する不揮発プログラムメモリと揮発性のRAMメモリと不揮発データメモリとを備え、前記不揮発プログラムメモリに書込みされた入出力制御プログラムと、前記不揮発データメモリに格納された制御定数の値と、前記入力信号回路の信号状態とに応動して前記出力信号回路に制御出力信号を送出する電子制御装置であって、
前記不揮発データメモリは、ブロック単位で個別に一括消去が可能な複数の分割ブロックを有する不揮発性のメモリにより構成され、
前記各分割ブロックは、書込み頻度又は書込み時期が異なる複数のデータ格納領域に仕分けされ、
前記各データ格納領域は、読出/書込単位となる複数のセクションにより構成され、当該セクションには複数の個別データが所定順序で書込まれ、一つの前記セクションのデータ容量は、書込みされる個別データの個数に対応したバイト数に構成され、
前記複数のセクションには、対象となる前記分割ブロックの一括消去を行った後に順次新たなデータがセクション単位で格納され、当該対象分割ブロックの中のどれかのデータ格納領域が満杯となってデータが書込まれていない空セクションが無くなったときには、予め一括消去された他の分割ブロックの該当データ格納領域の先頭セクションに新たなデータが書込まれ、
元の分割ブロックの中の他のデータ格納領域に書込まれていた最新のデータは、新たな分割ブロックの該当データ格納領域の先頭セクションに転送格納され、
元の分割ブロック内のデータは、少なくとも前記新たな分割ブロックへの最新データの転送書込みが完了した後に一括消去されるものであると共に、
前記データ格納領域内のセクション数は、書込み頻度の多いものほど多くのセクションが割り当てられている
ことを特徴とするものである。
An electronic control device according to the present invention includes:
A microprocessor to which an input signal circuit and an output signal circuit are connected, a nonvolatile program memory that cooperates with the microprocessor, a volatile RAM memory, and a nonvolatile data memory, and an input / output written in the nonvolatile program memory An electronic control device for sending a control output signal to the output signal circuit in response to a control program, a value of a control constant stored in the nonvolatile data memory, and a signal state of the input signal circuit,
The non-volatile data memory is constituted by a non-volatile memory having a plurality of divided blocks that can be collectively erased in units of blocks,
Each of the divided blocks is sorted into a plurality of data storage areas having different writing frequencies or writing times,
Each of the data storage areas is composed of a plurality of sections serving as read / write units. A plurality of individual data is written in a predetermined order in the section, and the data capacity of one section is individually written. It is composed of the number of bytes corresponding to the number of data,
In the plurality of sections, new data is sequentially stored in section units after batch erasure of the target divided blocks, and any data storage area in the target divided blocks becomes full. When there is no empty section to which no data has been written, new data is written to the top section of the corresponding data storage area of another divided block that has been erased in advance,
The latest data written in the other data storage area in the original divided block is transferred and stored in the first section of the corresponding data storage area in the new divided block.
The data in the original divided block is erased at least after the transfer writing of the latest data to the new divided block is completed, and
The number of sections in the data storage area is such that a larger number of sections are allocated as the frequency of writing increases.

この発明による電子制御装置によれば、マイクロプロセッサと協働する不揮発データメモリとして、ブロック単位で個別に一括消去が可能な複数の分割ブロックを有する不揮発メモリが使用され、各分割ブロックは更に複数のセクションで構成された複数のデータ格納領域に仕分けされ、各データ格納領域内のセクションの数は書込み頻度の多いものほど多くのセクションが割り当てられているので、入出力プログラムと同じブロックに書き込まれていた半固定制御定数を不揮発データメモリの分割ブロック内のひとつのデータ格納領域に保存することが可能となり、半固定制御定数を残したままで入出力プログラムのみを変更したり、入出力制御プログラムを残したままで半固定定数のみを一括変更することが可能となる。   According to the electronic control unit of the present invention, as the nonvolatile data memory that cooperates with the microprocessor, a nonvolatile memory having a plurality of divided blocks that can be individually erased in units of blocks is used, and each divided block further includes a plurality of divided blocks. As the number of sections in each data storage area is allocated more frequently, the more sections are allocated, the data is written in the same block as the I / O program. Semi-fixed control constants can be stored in a single data storage area in a non-volatile data memory division block, and only the I / O program can be changed while the semi-fixed control constants are left. It is possible to change only the semi-fixed constants at once.

更に、書込み頻度の少ない半固定制御定数を保存するデータ格納領域のセクション数を少なく設定することにより、特定のデータ格納領域において空きセクションが無くなって、新たな分割ブロックへ移行するときに、他のデータ格納領域に残された空きセクションは残りが少なくなっていて、不必要な一括消去が行われる空セクションの数が削減され、全体としてフラッシュメモリの一括消去回数を削減して、その寿命を延長することができる効果がある。   Furthermore, by setting the number of sections in the data storage area for storing semi-fixed control constants with low writing frequency, when there is no empty section in a specific data storage area and a transition is made to a new divided block, The number of empty sections remaining in the data storage area is small, and the number of empty sections that are erased unnecessarily at one time is reduced. As a whole, the number of times flash memory is erased is reduced, extending its lifetime. There is an effect that can be done.

又、複数の分割ブロック間では最新データの転送保存を行ってから元の分割ブロックが一括消去されるので、転送処理中に停電したような場合にデータが消失しない効果がある。   In addition, since the original divided block is erased all at once after the latest data is transferred and stored between a plurality of divided blocks, there is an effect that data is not lost when a power failure occurs during the transfer process.

この発明の実施の形態1による電子制御装置の全体構成を示すブロック図である。1 is a block diagram showing an overall configuration of an electronic control device according to Embodiment 1 of the present invention. FIG. この発明の実施の形態1による電子制御装置に於ける不揮発データメモリのセクション構成図である。It is a section block diagram of the non-volatile data memory in the electronic controller by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの消去・書込処理の説明図である。It is explanatory drawing of the erasing / writing process of the non-volatile data memory in the electronic control apparatus by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの検索・読出処理の説明図である。It is explanatory drawing of the search / read-out process of the non-volatile data memory in the electronic controller by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの異常処理の説明図である。It is explanatory drawing of the abnormal process of the non-volatile data memory in the electronic controller by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける全体動作のフローチャートである。It is a flowchart of the whole operation | movement in the electronic controller by Embodiment 1 of this invention.

この発明の実施の形態1による電子制御装置に於けるデータ書込み処理の全体フローチャートである。It is a whole flowchart of the data write-in process in the electronic controller by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの初期化処理のフローチャートである。It is a flowchart of the initialization process of the non-volatile data memory in the electronic control apparatus by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの書込み処理のフローチャートである。It is a flowchart of the write-in process of the non-volatile data memory in the electronic controller by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける全ブロック消去処理のフローチャートである。It is a flowchart of the all block erase process in the electronic control apparatus by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける移行処理のフローチャートである。It is a flowchart of the transfer process in the electronic control apparatus by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於けるデータ読出し処理の全体フローチャートである。It is a whole flowchart of the data read-out process in the electronic controller by Embodiment 1 of this invention.

この発明の実施の形態1による電子制御装置に於ける最新データ検索処理のフローチャートである。It is a flowchart of the newest data search process in the electronic control apparatus by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける最新ブロック検索処理のフローチャートである。It is a flowchart of the newest block search process in the electronic control apparatus by Embodiment 1 of this invention. この発明の実施の形態1による電子制御装置に於ける最新セクション検索処理のフローチャートである。It is a flowchart of the newest section search process in the electronic control apparatus by Embodiment 1 of this invention. この発明の実施の形態2による電子制御装置の全体構成を示すブロック図である。It is a block diagram which shows the whole structure of the electronic controller by Embodiment 2 of this invention. この発明の実施の形態2による電子制御装置に於ける不揮発データメモリのセクション構成図である。It is a section block diagram of the non-volatile data memory in the electronic controller by Embodiment 2 of this invention.

実施の形態1.
(1)構成の詳細な説明
以下、この発明の実施の形態1による電子制御装置の構成を、その全体構成を示すブロック図である図1と、不揮発データメモリのセクション構成図である図2に基づいて詳細に説明する。
Embodiment 1 FIG.
(1) Detailed Description of Configuration Hereinafter, the configuration of the electronic control device according to Embodiment 1 of the present invention will be described with reference to FIG. 1 which is a block diagram showing the overall configuration and FIG. 2 which is a section configuration diagram of a nonvolatile data memory. This will be described in detail.

先ず、図1に於いて、電子制御装置100Aは、マイクロプロセッサ110Aと不揮発プログラムメモリ111Aと、揮発性のRAMメモリ112Aと、フラッシュメモリである不揮発データメモリ113Aを主体として構成され、実態としては例えばエンジン制御装置等の車載電子制御装置を構成しており、車載バッテリである外部電源101Aから電源リレー102を介して給電されている。尚、電源リレー102は、図示しない電源スイッチが投入されると即時に閉路し、電源スイッチが遮断されると所定の遅延給電期間をおいてから開路するように構成されている。   First, in FIG. 1, an electronic control unit 100A is composed mainly of a microprocessor 110A, a nonvolatile program memory 111A, a volatile RAM memory 112A, and a nonvolatile data memory 113A that is a flash memory. An in-vehicle electronic control device such as an engine control device is configured, and power is supplied from an external power source 101A, which is an in-vehicle battery, via a power relay 102. The power relay 102 is configured to close immediately when a power switch (not shown) is turned on, and to open after a predetermined delay power feeding period when the power switch is turned off.

入力信号回路103は、図示しないコネクタを介して接続された開閉センサ或いはアナログセンサであり、当該入力信号回路103は、図示しない入力インタフェース回路と入力信号バス130を介してマイクロプロセッサ110Aに接続されている。出力信号回路104は、図示しないコネクタを介して接続された駆動機器或いは表示器等の電気負荷であり、当該出力信号回路104は、図示しない出力インタフェース回路と出力信号バス140を介してマイクロプロセッサ110Aに接続されている。   The input signal circuit 103 is an open / close sensor or an analog sensor connected via a connector (not shown). The input signal circuit 103 is connected to the microprocessor 110A via an input interface circuit (not shown) and an input signal bus 130. Yes. The output signal circuit 104 is an electric load such as a driving device or a display connected via a connector (not shown). The output signal circuit 104 is connected to the microprocessor 110A via an output interface circuit and an output signal bus 140 (not shown). It is connected to the.

第一ツール105Aは、電子制御装置100Aの出荷調整・検査或いは保守点検時に、シリアル信号バス150を介してマイクロプロセッサ110Aに対して接続されるものであり、当該第一ツール105Aは、図示しないキーボード、及び表示器を備えた携帯機器により構成されている。第二ツール106Aは、第一ツール105Aに代わって電子制御装置100Aにシリアル接続されるものであり、当該第二ツール106Aは、電子制御装置100Aが組みまれる車両等の合体製品の製造メーカが当該合体製品の出荷調整を行う時点に於いて出荷調整設備として準備されものであるか、或いは電子制御装置100Aを使用するユ−ザの設備管理部門が、設備の据付調整時点で使用するものであって、図示しないキーボード、表示器を備えた携帯機器により構成されている。尚、設備管理部門と合体製品の製造メーカとは同じ範疇のものであり、以下の説明では、これらを合体製品の製造メーカと称して説明する。   The first tool 105A is connected to the microprocessor 110A via the serial signal bus 150 at the time of shipment adjustment / inspection or maintenance inspection of the electronic control unit 100A. The first tool 105A is a keyboard (not shown). And a portable device provided with a display. The second tool 106A is serially connected to the electronic control device 100A in place of the first tool 105A, and the second tool 106A is manufactured by a manufacturer of a combined product such as a vehicle in which the electronic control device 100A is assembled. It is prepared as a shipping adjustment facility at the time of shipping adjustment of the combined product, or used by the facility management department of the user who uses the electronic control unit 100A at the time of installation adjustment of the facility. Therefore, it is constituted by a portable device provided with a keyboard and a display (not shown). The equipment management department and the manufacturer of the combined product belong to the same category, and in the following description, these will be referred to as the manufacturer of the combined product.

又、第二ツール106Aは、第一ツール105Aと同様の構成であり、例えば電子制御装置100Aの製造メーカから提供され、単に機能を分担して使用されるものとなっている。第一ツール105Aには電子制御装置100Aで使用される入出力制御制御プログラム107Aが格納されており、マイクロプロセッサ110AはマスクROMメモリ111aに格納されたブートプログラムによって当該入出力制御プログラム107Aを不揮発プログラムメモリ111Aへ転送するように構成されている。   The second tool 106A has the same configuration as the first tool 105A. For example, the second tool 106A is provided by the manufacturer of the electronic control device 100A and is used by simply sharing functions. The first tool 105A stores an input / output control control program 107A used in the electronic control unit 100A. The microprocessor 110A uses the boot program stored in the mask ROM memory 111a to store the input / output control program 107A in a nonvolatile program. It is configured to transfer to the memory 111A.

尚、入出力制御制御プログラム107Aは、第一ツール105Aと第二ツール106Aとに対する交信処理プログラムを包含している。又、入出力制御制御プログラム107Aは、当該入出力制御プログラム107Aに対して一定不変の固定定数を包含すると共に、不揮発データメモリ112Aに格納される後述の第一定数108a、第二定数108b、第三定数108cに関連する参考定数107aとを包含している。   The input / output control control program 107A includes a communication processing program for the first tool 105A and the second tool 106A. Further, the input / output control control program 107A includes fixed constants that do not change with respect to the input / output control program 107A, and the first constant 108a, the second constant 108b, which will be described later, stored in the nonvolatile data memory 112A, And a reference constant 107a related to the third constant 108c.

この参考定数107aは、第一定数108a、第二定数108b、第三定数108cの中の変動情報の一部、又は運転特性の学習情報の一部に関する許容変動範囲である上下限値データと、前記第一定数108a、第二定数108b、第三定数108cの中の未確定定数に対して適用される初期設定データであり、当該初期値設定データは、少なくとも前記電子制御装置100Aの初回運転開始前に後述の第1分割ブロック113a、第2分割ブロック113b、第3分割ブロック113c、第4分割ブロック113dの一つの中の第一定数領域S10、第二定数領域S20、第三定数領域S300の先頭セクションに転送格納されるように構成されている。   This reference constant 107a includes upper and lower limit value data that is an allowable fluctuation range relating to a part of fluctuation information in the first constant 108a, the second constant 108b, and the third constant 108c, or a part of learning information of driving characteristics. , Initial setting data applied to uncertain constants among the first constant 108a, the second constant 108b, and the third constant 108c. The initial value setting data is at least the first time of the electronic control unit 100A. Before the start of operation, a first constant area S10, a second constant area S20, and a third constant in one of a first divided block 113a, a second divided block 113b, a third divided block 113c, and a fourth divided block 113d described later. It is configured to be transferred and stored in the first section of the area S300.

第一ツール105Aは、更に、不揮発データメモリ113Aに転送される第一定数108aを包含し、当該第一定数108aは、前記電子制御装置100A自体の機種区分に対応した制御定数又は入出力制御プログラム107Aの一部の選択番号情報、或いは当該電子制御装置100Aの内部の部品特性のバラツキ変動を補正するための校正定数、当該電子制御装置の製造番号などの制御装置固有情報となっている。尚、入出力制御プログラム107Aは、様々な制御仕様を想定した様々な部分プログラムや定数テーブルを備えており、現実の制御仕様に対応してどの部分プログラムや定数テーブルを選択使用するのかを決定するのが前記選択番号情報の意味である。   The first tool 105A further includes a first constant 108a transferred to the non-volatile data memory 113A. The first constant 108a is a control constant or input / output corresponding to the model classification of the electronic control unit 100A itself. This is control device specific information such as a part of the selection number information of the control program 107A, a calibration constant for correcting variation in variations in the component characteristics inside the electronic control device 100A, and the manufacturing number of the electronic control device. . The input / output control program 107A includes various partial programs and constant tables assuming various control specifications, and determines which partial program or constant table is selected and used in accordance with the actual control specifications. This is the meaning of the selection number information.

第一定数108aは、第一ツール105Aに設けられた転送用の操作キーを押した時点で第一ツール105Aから不揮発データメモリ113Aへ転送されるか、又は、第一ツール105Aの転送用の操作キーを押したときにRAMメモリ112Aへ転送され、電子制御装置100Aに対する電源スイッチが開路されて、電源リレー102による遅延給電が行われているタイミングでRAMメモリ112Aから不揮発データメモリ113Aへ転送される。   The first constant 108a is transferred from the first tool 105A to the non-volatile data memory 113A at the time when a transfer operation key provided in the first tool 105A is pressed, or for transfer of the first tool 105A. When the operation key is pressed, the data is transferred to the RAM memory 112A, and the power switch for the electronic control device 100A is opened, and the data is transferred from the RAM memory 112A to the nonvolatile data memory 113A at the timing when the delay power is supplied by the power relay 102. The

第二ツール106Aは、不揮発データメモリ113Aに転送される第二定数108bを包含し、当該第二定数108bは、電子制御装置100Aが組込まれる合体製品・設備の型名・機種に対応した制御定数、又は入出力制御プログラム107Aの一部の選択番号情報、或いは前記電子制御装置100Aに接続された入出力部品の部品特性のバラツキ変動を補正する校正定数などの合体製品固有情報となっている。   The second tool 106A includes a second constant 108b transferred to the non-volatile data memory 113A. The second constant 108b is a control constant corresponding to the model name / model of the combined product / equipment in which the electronic control unit 100A is incorporated. Or part of selection number information of the input / output control program 107A, or united product unique information such as a calibration constant for correcting variation in the component characteristics of the input / output components connected to the electronic control unit 100A.

第二定数108bの転送タイミングは第一定数108aの場合と同様であり、第二ツール106Aに設けられた転送用の操作キーを押した時点で第二ツール106Aから不揮発データメモリ113Aへ転送されるか、又は、第二ツール106Aの転送用の操作キーを押したときにRAMメモリ112Aへ転送され、電子制御装置100Aに対する電源スイッチが開路されて、電源リレー102による遅延給電が行われているタイミングでRAMメモリ112Aから不揮発データメモリ113Aへ転送される。   The transfer timing of the second constant 108b is the same as that of the first constant 108a, and is transferred from the second tool 106A to the non-volatile data memory 113A when a transfer operation key provided on the second tool 106A is pressed. Or, when the operation key for transfer of the second tool 106A is pressed, it is transferred to the RAM memory 112A, the power switch for the electronic control unit 100A is opened, and the power supply relay 102 performs delayed power feeding. The data is transferred from the RAM memory 112A to the nonvolatile data memory 113A at the timing.

不揮発プログラムメモリ111Aに格納された入出力制御プログラム107Aによって運転動作を行うマイクロプロセッサ110Aは、電子制御装置100Aの内蔵部品又は外部接続部品の特性変動情報、或いは改善された運転特性を得るための学習情報、或いは異常発生履歴情報等の第三定数108cを生成してRAMメモリ112Aに格納する。不揮発データメモリ113Aは、ブロック単位で一括消去が行われるフラッシュメモリであり、第1分割ブロック113a、第2分割ブロック113b、第3分割ブロック113c、第4分割ブロック113dを備えている。   The microprocessor 110A that performs the driving operation by the input / output control program 107A stored in the nonvolatile program memory 111A learns to obtain the characteristic variation information of the built-in component or the external connection component of the electronic control unit 100A or the improved driving characteristic. The third constant 108c such as information or abnormality occurrence history information is generated and stored in the RAM memory 112A. The non-volatile data memory 113A is a flash memory that is collectively erased in units of blocks, and includes a first divided block 113a, a second divided block 113b, a third divided block 113c, and a fourth divided block 113d.

各分割ブロック113a〜113d内の構成を示す図2に於いて、第1分割ブロック113a〜第4分割ブロック113dは、夫々同様の構成であり、チェック領域S0と、データ格納領域となる第一定数領域S10と、第二定数領域S20と、第三定数領域S300を備えている。チェック領域S0は、例えば16バイトのデータ容量C0を持つセクションS1と、当該セクションS1が異常となった場合に代替使用される予備セクションS2によって構成されている。   In FIG. 2 showing the configuration in each of the divided blocks 113a to 113d, the first divided block 113a to the fourth divided block 113d have the same configuration, and are the check area S0 and the first fixed block that becomes the data storage area. A number region S10, a second constant region S20, and a third constant region S300 are provided. The check area S0 is composed of, for example, a section S1 having a data capacity C0 of 16 bytes and a spare section S2 that is used as a substitute when the section S1 becomes abnormal.

第一定数領域S10は、例えば32バイトのデータ容量C10を持つ2つのセクションS11、S12によって構成されており、従がってセクション数N10[=2]であり、全体のデータ容量としては[C10×N10=32×2=64]バイトとなっている。   The first constant area S10 is composed of, for example, two sections S11 and S12 having a data capacity C10 of 32 bytes. Accordingly, the number of sections N10 [= 2], and the overall data capacity is [ C10 × N10 = 32 × 2 = 64] bytes.

第二定数領域S20は、例えば96バイトのデータ容量C20を持つ4つのセクションS21、S22、S23、S24によって構成されており、従がってセクション数N20[=4]であり、全体のデータ容量としては[C20×N20=96×4=384]バイトとなっている。   The second constant area S20 is composed of, for example, four sections S21, S22, S23, and S24 having a data capacity C20 of 96 bytes. Accordingly, the number of sections is N20 [= 4], and the entire data capacity Is [C20 × N20 = 96 × 4 = 384] bytes.

第三定数領域S300は、例えば384バイトのデータ容量C300を持つ20個のセクションS301、S302、S303・・・S320によって構成されており、従がってセクション数N300[=20]であり、全体のデータ容量としては[C300×N300=384×20=7680]バイトとなっている。   The third constant area S300 is composed of, for example, 20 sections S301, S302, S303,... S320 having a data capacity C300 of 384 bytes, and therefore the number of sections is N300 [= 20]. The data capacity is [C300 × N300 = 384 × 20 = 7680] bytes.

前述の各セクションは、書込/読出の最小単位となるものであり、各セクションには複数の個別データが所定順序で書込まれ、一つのセクションのデータ容量C10・C20・C300の値は書込みされる個別データの個数に対応したバイト数となっている。尚、各セクションには複数の個別データに加えて符号誤り検出のためのサムデータ、或いは誤り訂正符号データが付加されている。   Each section described above is a minimum unit of writing / reading, a plurality of individual data is written in a predetermined order in each section, and the values of the data capacities C10, C20, and C300 of one section are written. The number of bytes corresponds to the number of individual data to be processed. Each section is added with sum data for detecting a code error or error correcting code data in addition to a plurality of individual data.

又、この実施の形態1に於いては、分割ブロック113a〜113dの中で、セクション数N10・N20・N300とデータ容量C10・C20・C300の積が最も大きい主たるデータ格納領域S300の合計データ容量A[=N300×C300=20×384=7680]と、その他の従となるデータ格納領域S0・S10・S20全体のセクション数とデータ容量の積である合計データ容量B[=N0×C0+N10×C10+N20×C20=16×2+32×2+96×4=480]との比率B/(A+B)[=480/(7680+480)=0.06]は前記分割ブロックの個数N=4の逆数よりも小さい値となっている。   In the first embodiment, among the divided blocks 113a to 113d, the total data capacity of the main data storage area S300 having the largest product of the number of sections N10, N20, and N300 and the data capacity C10, C20, and C300. A [= N300 × C300 = 20 × 384 = 7680] and the total data capacity B [= N0 × C0 + N10 × C10 + N20, which is a product of the number of sections and the data capacity of the other subordinate data storage areas S0, S10, and S20. The ratio B / (A + B) [= 480 / (7680 + 480) = 0.06] with × C20 = 16 × 2 + 32 × 2 + 96 × 4 = 480] is smaller than the reciprocal of the number of divided blocks N = 4. ing.

図1に戻り、消去/書込制御回路114は、マイクロプロセッサ110Aから各種の指令信号COMnを受けて不揮発データメモリ113Aを制御し、不揮発データメモリ113Aから得られた回答信号ANSnをマイクロプロセッサ110Aに返信するように構成されている。指令信号のうち、指令信号COM1は一括消去指令であり、一括消去されるブロック番号はアドレス信号ADRによって消去/書込制御回路114に入力される。消去/書込制御回路114は、指定ブロック番号を記憶して不揮発データメモリ113Aの指定ブロックを一括消去し、消去が完了すると消去完了の回答信号ANS1を発生するように構成されている。   Returning to FIG. 1, the erase / write control circuit 114 receives various command signals COMn from the microprocessor 110A to control the nonvolatile data memory 113A, and sends the answer signal ANSn obtained from the nonvolatile data memory 113A to the microprocessor 110A. It is configured to reply. Of the command signals, the command signal COM1 is a batch erase command, and the block number to be batch erased is input to the erase / write control circuit 114 by the address signal ADR. The erase / write control circuit 114 is configured to store the designated block number, erase the designated block of the nonvolatile data memory 113A at once, and generate an erase completion reply signal ANS1 when the erase is completed.

指令信号COM2は消去確認指令(ブランクチェック)であり、消去確認されるブロック番号とセクション番号とはアドレス信号ADRによって消去/書込制御回路114に入力される。消去/書込制御回路114は、指定ブロック番号と指定セクション番号を記憶して、不揮発データメモリ113Aの指定ブロックに於ける指定セクションが消去されているかどうかを点検し、点検完了すると点検結果に応じた回答信号ANS2を発生するように構成されている。   The command signal COM2 is an erase confirmation command (blank check), and the block number and section number to be confirmed for erase are input to the erase / write control circuit 114 by the address signal ADR. The erase / write control circuit 114 stores the designated block number and the designated section number, and checks whether or not the designated section in the designated block of the nonvolatile data memory 113A is erased. The response signal ANS2 is generated.

指令信号COM3は書込指令であり、書込対象となるブロック番号とセクション番号とはアドレス信号ADRによって消去/書込制御回路114に入力される。消去/書込制御回路114は、指定ブロック番号と指定セクション番号を記憶して不揮発データメモリ113Aの指定ブロックの指定セクションに対して書込データWRDを書込みし、書込みが完了すると書込完了の回答信号ANS3を発生するように構成されている。   The command signal COM3 is a write command, and the block number and section number to be written are input to the erase / write control circuit 114 by the address signal ADR. The erase / write control circuit 114 stores the designated block number and the designated section number, writes the write data WRD to the designated section of the designated block of the nonvolatile data memory 113A, and when the writing is completed, the write completion reply The signal ANS3 is generated.

指令信号COM4は読出指令であり、読出対象となるブロック番号とセクション番号とはアドレス信号ADRによって消去/書込制御回路114に入力される。消去/書込制御回路114は、指定ブロック番号と指定セクション番号を記憶して不揮発データメモリ113Aの指定ブロックの指定セクションに格納されている読出データRDDを読出し、読出しが完了すると読出完了の回答信号ANS4を発生するように構成されている。   The command signal COM4 is a read command, and the block number and section number to be read are input to the erase / write control circuit 114 by the address signal ADR. The erase / write control circuit 114 stores the designated block number and the designated section number, reads the read data RDD stored in the designated section of the designated block of the nonvolatile data memory 113A, and when the reading is completed, the read completion reply signal It is configured to generate ANS4.

尚、書込データWRDと読出データRDDとは、図示しないダイレクト・メモリアクセス・コントローラを介してRAMメモリ112Aとの間で授受が行われるように構成されている。   The write data WRD and read data RDD are configured to be exchanged with the RAM memory 112A via a direct memory access controller (not shown).

RAMメモリ112Aはイメージメモリ領域108を備え、このイメージメモリ108は、第一ツール105Aから第一定数108aを不揮発データメモリ113Aへ転送するときの中継メモリとして使用されたり、第二ツール106Aから第二定数108bを不揮発データメモリ113Aへ転送するときの中継メモリとして使用されたり、マイクロプロセッサ110Aの運転中に生成される第三定数108Cが格納されるように構成されている。   The RAM memory 112A includes an image memory area 108. The image memory 108 is used as a relay memory when transferring the first constant 108a from the first tool 105A to the nonvolatile data memory 113A, or from the second tool 106A. The third constant 108C is configured to be used as a relay memory when transferring the two constants 108b to the nonvolatile data memory 113A, or to store a third constant 108C generated during operation of the microprocessor 110A.

RAMメモリ112Aは、不揮発データメモリ113Aの消去・書込状態に対応したデータが書込まれるステータスメモリ112aを包含し、このステータスメモリ112aには、少なくとも現在時点で書込が進行している最新の分割ブロック113a〜113dの識別番号情報と、当該最新分割ブロック内の各データ格納領域S10・S20・S300に於いて最新データが書込まれたセクション番号情報とが格納されるように構成されている。   The RAM memory 112A includes a status memory 112a in which data corresponding to the erase / write state of the non-volatile data memory 113A is written. The status memory 112a includes at least the latest data that is currently being written. The identification number information of the divided blocks 113a to 113d and the section number information in which the latest data is written in each of the data storage areas S10, S20, and S300 in the latest divided block are stored. .

尚、イメージメモリ領域108やステータスメモリ112aは、消去/書込制御回路114の中に設けられたバッファメモリを使用することも可能である。   The image memory area 108 and the status memory 112a can use a buffer memory provided in the erase / write control circuit 114.

電源回路109Aは、例えば車載バッテリである外部電源101Aから運転用電源スイッチが閉路されたことによって付勢される電源リレー102の出力接点と、駆動電源端子102aとを介して給電されると共に、電源リレー102の出力接点を介在せずに外部バッテリとなる外部電源101Aから補助電源端子101aを介して給電されるように構成されている。   The power supply circuit 109A is supplied with power via an output contact of the power supply relay 102 energized when the driving power supply switch is closed from an external power supply 101A, for example, an in-vehicle battery, and a drive power supply terminal 102a. Power is supplied from an external power source 101A serving as an external battery via an auxiliary power source terminal 101a without an output contact of the relay 102.

電源回路109Aは、電源リレー102が付勢されているときには、例えばDC5[V]の安定化された制御電圧Vccを発生して、マイクロプロセッサ110A、不揮発プログラムメモリ111A、RAMメモリ112A、不揮発データメモリ113Aに供給する。又、電源回路109Aは、電源リレー102が付勢されていないときには、例えばDC3[V]の安定化された保持電圧Vupを発生して、バックアップ電源としてRAMメモリ112Aに供給する。   The power supply circuit 109A generates a stabilized control voltage Vcc of, for example, DC5 [V] when the power supply relay 102 is energized, and the microprocessor 110A, the nonvolatile program memory 111A, the RAM memory 112A, and the nonvolatile data memory To 113A. Further, when the power supply relay 102 is not energized, the power supply circuit 109A generates a stabilized holding voltage Vup of, for example, DC3 [V] and supplies it as a backup power to the RAM memory 112A.

電源リレー102が消勢されている期間に於いて補助電源となる車載バッテリ101Aの電圧が異常低下するか、又は補助電源回路が遮断されて、RAMメモリ112Aの記憶内容が消失したとき、又はステータスメモリ112aの内容が異常であるときに、電源リレー102が付勢されてマイクロプロセッサ110Aが運転を開始したとき、又はマイクロプロセッサ110Aの運転中に不揮発データメモリ113Aの中の少なくとも第三データ格納領域S300に書込まれた最新セクションの内容がRAMメモリ112Aのイメージメモリ領域108に転送されて、マイクロプロセッサ110Aはイメージメモリ領域108に書込まれた第三定数108cに基づいて入出力の制御を行なう。   When the voltage of the in-vehicle battery 101A serving as an auxiliary power supply is abnormally reduced during the period when the power supply relay 102 is turned off, or the auxiliary power supply circuit is shut off and the stored contents of the RAM memory 112A are lost, or the status At least the third data storage area in the non-volatile data memory 113A when the contents of the memory 112a are abnormal, when the power relay 102 is energized and the microprocessor 110A starts operation, or during the operation of the microprocessor 110A The contents of the latest section written in S300 are transferred to the image memory area 108 of the RAM memory 112A, and the microprocessor 110A controls input / output based on the third constant 108c written in the image memory area 108. .

尚、実態としてはマイクロプロセッサ110Aが運転開始したときには、第三定数108cだけではなく、第一・第二定数108a・108bも不揮発データメモリ113AからRAMメモリ112Aへ転送読出しして、マイクロプロセッサ110AはRAMメモリ112Aのイメージメモリ領域108を参照しながら制御を行なうように構成されている。   Actually, when the microprocessor 110A starts operation, not only the third constant 108c but also the first and second constants 108a and 108b are transferred and read from the nonvolatile data memory 113A to the RAM memory 112A, and the microprocessor 110A Control is performed while referring to the image memory area 108 of the RAM memory 112A.

又、ステータスメモリ112aの異常としては、現在時点で書込が進行している最新の分割ブロック113a〜113dの識別番号情報が格納されていないか、又は当該最新分割ブロック内の各データ格納領域S10・S20・S300に於いて最新データが書込まれたセクション番号情報が格納されていない状態であり、その他にRAMメモリ112A全体としての符号誤りによってビット情報の混入・欠落が発生している場合も含まれる。   Further, as an abnormality of the status memory 112a, the identification number information of the latest divided block 113a to 113d that is currently being written is not stored, or each data storage area S10 in the latest divided block is stored. In S20 and S300, the section number information in which the latest data is written is not stored, and there are cases where bit information is mixed or missing due to a code error in the RAM memory 112A as a whole. included.

次に、この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの消去・書込処理について、その処理方法の概念を説明する。図3は、この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの消去・書込処理の説明図であり、第一ブロック113aの第三定数領域S300が満杯となった場合の書込処理の概念を、(A)、(B)、(C)の順で示したものである。   Next, the concept of a processing method for erasing / writing processing of the nonvolatile data memory in the electronic control apparatus according to Embodiment 1 of the present invention will be described. FIG. 3 is an explanatory diagram of the erasing / writing process of the nonvolatile data memory in the electronic control device according to the first embodiment of the present invention, in the case where the third constant region S300 of the first block 113a is full. The concept of the writing process is shown in the order of (A), (B), and (C).

図3の(A)は、現に書込みが行われていた第一ブロック113aの内容を示しており、チェック領域S0のセクションS1には、ブランクブロックではないことを示す所定の確定定数と、過去の累積一括消去回数を示すチェックデータCが格納されている。又、第一定数領域S10のセクションS11には、第一ツール105AからRAMメモリ112Aを媒介して転送された第一定数108aが初回データF1として格納され、セクションS12は、まだデータが書込まれていない空セクション(ブランク)となっている。   (A) of FIG. 3 shows the contents of the first block 113a that has been actually written. The section S1 of the check area S0 includes a predetermined fixed constant indicating that it is not a blank block, Stored is check data C indicating the cumulative batch erase count. Further, in the section S11 of the first constant area S10, the first constant 108a transferred from the first tool 105A through the RAM memory 112A is stored as the initial data F1, and the section S12 is still written with data. It is an empty section (blank) that is not included.

又、第二定数領域S20のセクションS21には、第二ツール106AからRAMメモリ112Aを媒介して転送された第二定数108bが初回データSe1として格納され、セクションS22には、2度目に転送された第二定数108bが次回データSe2として格納され、セクションS23・S24は、まだデータが書込まれていない空セクション(ブランク)となっている。   In the section S21 of the second constant area S20, the second constant 108b transferred from the second tool 106A through the RAM memory 112A is stored as the initial data Se1, and transferred to the section S22 for the second time. The second constant 108b is stored as the next data Se2, and the sections S23 and S24 are empty sections (blanks) in which data has not yet been written.

更に、第三定数領域S300のセクションS301には、RAMメモリ112Aに格納されている第三定数108cが電子制御装置100Aの運転停止の直後に初回データT1として格納され、セクションS302には、電子制御装置100Aの次回の運転停止直後に次回データT2として格納され、以下同様にして、20回目の運転停止直後の第三定数108cが20回目の格納データT20として格納され、まだデータが書込まれていない空セクションがなくなった満杯状態となっている。   Further, in the section S301 of the third constant area S300, the third constant 108c stored in the RAM memory 112A is stored as initial data T1 immediately after the electronic controller 100A is stopped, and in the section S302, the electronic control is performed. Immediately after the next operation stop of the apparatus 100A, it is stored as the next data T2, and in the same manner, the third constant 108c immediately after the 20th operation stop is stored as the 20th stored data T20, and the data is not yet written. No empty section is full.

図3の(B)は、次々順位の分割ブロック113cの内容を示しており、この分割ブロック113cには既にデータが書込まれていても、分割ブロック113aが満杯となって次のデータを書込む必要が発生した時点で次々順位の分割ブロック113cが先ず一括消去され、チェック領域S0・第一定数領域S10・第二定数領域S20・第三定数領域S300内の全てのセクションは空セクションとなっている。   FIG. 3B shows the contents of the divided blocks 113c in order, and even if data has already been written in the divided blocks 113c, the divided blocks 113a are full and the next data is written. At the time when it is necessary to insert, the divided blocks 113c of the next order are erased all at once, and all sections in the check area S0, first constant area S10, second constant area S20, and third constant area S300 are empty sections. It has become.

図3の(C)は、次順位の分割ブロック113bの内容を示しており、この分割ブロック113bは既に一括消去が行なわれているが、確認処理として再度一括消去を行い、続いて現在の分割ブロック113aで満杯となった次の第三定数108cが、第三定数領域S300の先頭セクションS301に書込まれる。次に、分割ブロック113aの第二定数領域S20の中の最新データ(最後に書込まれた第二定数108b)である格納データSe2が、分割ブロック113bの第二定数領域S20の中の先頭セクションS21に移動して転送される。   FIG. 3C shows the contents of the divided block 113b of the next order, and this divided block 113b has already been erased in batch, but the batch erase is performed again as a confirmation process, and then the current divided block 113b. The next third constant 108c that is full in the block 113a is written in the first section S301 of the third constant area S300. Next, the storage data Se2 which is the latest data (second constant 108b written last) in the second constant area S20 of the divided block 113a is the first section in the second constant area S20 of the divided block 113b. Transferred to S21.

次に、分割ブロック113aの第一定数領域S10の中の最新データ(最後に書込まれた第一定数108a)である格納データF1が、分割ブロック113bの第一定数領域S10の中の先頭セクションS11に転送される。最後に、分割ブロック113bのチェック領域S0には、分割ブロック113bがブランクブロックではないことを示す所定の確定定数と、一括消去回数の累積値が格納される。   Next, the stored data F1, which is the latest data (first constant 108a written last) in the first constant area S10 of the divided block 113a, is stored in the first constant area S10 of the divided block 113b. To the first section S11. Finally, a predetermined definite constant indicating that the divided block 113b is not a blank block and a cumulative value of the batch erase count are stored in the check area S0 of the divided block 113b.

このようにして分割ブロック113aは、分割ブロック113bへ移行し、分割ブロック113bが新たな現在ブロックとなるものである。   In this way, the divided block 113a moves to the divided block 113b, and the divided block 113b becomes a new current block.

チェック領域S0内の一つのセクションS1の前半領域には、分割ブロック113a〜113dの一括消去が行われてから、データ格納領域S10・S20・S300の全てのデータ格納領域内で少なくとも一つのセクションに対して有効なデータが書込まれた時点で所定の確定定数が書込まれると共に、どれか一つのデータ格納領域であっても当該データ格納領域内のどのセクションにも有効なデータが書込まれていない場合には前記確定定数が書込まれていないブランクブロックの状態となる。   In the first half area of one section S1 in the check area S0, the divided blocks 113a to 113d are collectively erased, and then the data is stored in at least one section in all the data storage areas of the data storage areas S10, S20, and S300. On the other hand, when a valid data is written, a predetermined fixed constant is written, and even if any one data storage area, valid data is written to any section in the data storage area. If not, a blank block state in which the fixed constant is not written is obtained.

チェック領域S0内の一つのセクションS1の後半領域には、前記確定定数が書込まれた時点で当該分割ブロックに対する一括消去回数データが書込まれ、分割ブロックの移行が行われときには移行後の分割ブロックの一括消去回数は移行直前の現在の分割ブロックのチェック領域に書込まれていた一括消去回数に1を加算した値となる。   In the second half area of one section S1 in the check area S0, the batch erasure count data for the divided block is written when the definite constant is written, and when the divided block is transferred, the divided area after the transfer is transferred. The number of batch erases of a block is a value obtained by adding 1 to the number of batch erases written in the check area of the current divided block immediately before the transfer.

尚、各分割ブロック113a〜113dの一つは、前回の分割ブロックの移行過程と今回の分割ブロックの移行過程で一括消去が行われるが、初回の一括消去によって全セクションが消去されておれば、2回目の一括消去を行っても寿命回数に影響を与えないものであり、チェック領域S0に格納される一括消去回数は2度目の一括消去による1回分の一括消去回数となっている。   One of each of the divided blocks 113a to 113d is erased at once in the transition process of the previous divided block and the transition process of the current divided block, but if all the sections are erased by the first batch erase, Even if the second batch erase is performed, the number of lifetimes is not affected, and the number of batch erases stored in the check area S0 is the number of batch erases for one by the second batch erase.

次に、この発明の実施の形態1による電子制御装置に於ける検索・読出処理について、その処理方法の概念についてを説明する。図4は、この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの検索・読出処理の説明図であリ、図4の(A)は、データの読出しが行われる最新ブロックの検索要領を示し、図4の(B)は、データの読出しが行われる最新セクションの検索要領を示したものである。 Next, the concept of the processing method for search / read processing in the electronic control apparatus according to Embodiment 1 of the present invention will be described. FIG. 4 is an explanatory diagram of the search / read processing of the nonvolatile data memory in the electronic control unit according to Embodiment 1 of the present invention. FIG. 4 (A) shows the latest block in which data is read. The search procedure is shown, and FIG. 4B shows the search procedure for the latest section from which data is read.

データの読出しが行われる最新ブロックの検索要領を示す図4の(A)に於ける(1)は、第1〜第4ブロックの全てが一括消去された後、第1ブロック113aにデータが書込まれている場合であり、最新ブロックNはチェック領域S0がブランクであるブランクブロックを検索し、ブランクブロックの前のブランクブロックでないブロックを最新ブロックとして検索される。   In (1) of FIG. 4A showing the search procedure for the latest block from which data is read, the data is written to the first block 113a after all of the first to fourth blocks are erased at once. The latest block N is searched for a blank block whose check area S0 is blank, and a block that is not a blank block before the blank block is searched as the latest block.

図4の(A)に於ける(2)は、第1ブロック113aの第一・第二・第三領域S10・S20・S300のどれかが満杯となって第2ブロック113bに最新データが移行した場合の図であり、最新ブロックNはブランクブロックである第3ブロック113cの前にある第2ブロック113bとなり、第1ブロック113aは最新の一つ前のブロックN−1となっている。   In (2) in FIG. 4A, one of the first, second, and third areas S10, S20, and S300 of the first block 113a is full and the latest data is transferred to the second block 113b. The latest block N is the second block 113b before the third block 113c, which is a blank block, and the first block 113a is the latest previous block N-1.

図4の(A)に於ける(3)は、第2ブロック113bのどれかの領域が満杯となって第3ブロック113cに最新データが移行した場合の図であり、最新ブロックNはブランクブロックである第4ブロック113dの前にある第3ブロック113cとなり、第1ブロック113aは最新の二つ前のブロックN−2となり、第2ブロック113bは最新の一つ前のブロックN−1となっている。   (3) in FIG. 4A is a diagram in the case where any area of the second block 113b is full and the latest data is transferred to the third block 113c. The latest block N is a blank block. Is the third block 113c before the fourth block 113d, the first block 113a is the latest two previous blocks N-2, and the second block 113b is the latest previous block N-1. ing.

図4の(A)に於ける(4)は、第3ブロック113cのどれかの領域が満杯となって第4ブロック113dに最新データが移行した場合の図であり、この場合にはまず第3ブロック113cの二つ後にある第1ブロック113aの一括消去を行っておいてから第4ブロックへの移行が行われる。そのため、最新ブロックNは、ブランクブロックである第1ブロック113aの前にある第4ブロック113dとなり、第2ブロック113bは最新の二つ前のブロックN−2となり、第3ブロック113cは最新の一つ前のブロックN−1となっている。   (4) in FIG. 4A is a diagram in the case where any area of the third block 113c is full and the latest data is transferred to the fourth block 113d. The first block 113a, which is two blocks after the third block 113c, is collectively erased, and then the transition to the fourth block is performed. Therefore, the latest block N is the fourth block 113d before the first block 113a, which is a blank block, the second block 113b is the latest two previous block N-2, and the third block 113c is the latest one. This is the previous block N-1.

図4の(A)に於ける(5)は、第4ブロック113dのどれかの領域が満杯となって第1ブロック113aに最新データが移行した場合の図であり、この場合にはまず第4ブロックの二つ後の第2ブロック113bの一括消去を行っておいてから第1ブロック113aへの移行が行われる。そのため、最新ブロックNは、ブランクブロックである第2ブロック113bの前にある第1ブロック113aとなり、第3ブロック113cは最新の二つ前のブロックN−2となり、第4ブロック113dは最新の一つ前のブロックN−1となっている。   (5) in FIG. 4A is a diagram in the case where any area of the fourth block 113d is full and the latest data is transferred to the first block 113a. After the second block 113b, which is two blocks after the four blocks, is collectively erased, the transition to the first block 113a is performed. Therefore, the latest block N becomes the first block 113a before the second block 113b, which is a blank block, the third block 113c becomes the latest two previous block N-2, and the fourth block 113d becomes the latest one. This is the previous block N-1.

図4の(A)に於ける(6)は、第1ブロック113aのどれかの領域が満杯となって第2ブロック113bに最新データが移行した場合の図であり、この場合には先ず第1ブロックの二つ後の第3ブロック113cの一括消去を行っておいてから第2ブロック113bへの移行が行われる。そのため、最新ブロックNは、ブランクブロックである第3ブロック113cの前にある第2ブロック113bとなり、第4ブロック113dは最新の二つ前のブロックN−2となり、第1ブロック113aは最新の一つ前のブロックN−1となっている。   In FIG. 4A, (6) is a diagram when one of the areas of the first block 113a is full and the latest data is transferred to the second block 113b. After the batch erasure of the third block 113c two blocks after the one block is performed, the transition to the second block 113b is performed. Therefore, the latest block N is the second block 113b before the third block 113c, which is a blank block, the fourth block 113d is the latest two previous block N-2, and the first block 113a is the latest one. This is the previous block N-1.

図4の(A)の(6)に於いて、第2ブロック113bのどれかの領域が満杯となって第3ブロック113cに移行する場合には、先ず第2ブロック113bの二つ後の第4ブロック113dの一括消去を行っておいてから第3ブロック113cへの移行が行われるので、図4の(A)に於ける(3)の状態へ移行することになる。   In (6) of FIG. 4A, when any area of the second block 113b is full and the process proceeds to the third block 113c, first, the second block 113b two after the second block 113b. Since the transition to the third block 113c is performed after the batch erasure of the four blocks 113d, the transition to the state (3) in FIG.

尚、分割ブロックの移行を行うときには、移行先の分割ブロックも念のため一括消去
を行ってから書込みが開始されるように構成されている。
Note that when the divided block is transferred, writing is started after performing batch erasure of the transferred divided block as a precaution.

以上のとおり、不揮発データメモリ113Aは、少なくとも3個以上の分割ブロック113a〜113dを備え、現在書込みが行われている分割ブロック113aの中のどこかのデータ格納領域S10・S20・S300に於いて空セクションが無くなった場合には、先ず次次順位の分割ブロック113cの一括消去を行い、続いて確認処理として次順位の分割ブロック113bの一括消去を行い、当該次順位の分割ブロック113bの該当データ格納領域の先頭セクションに新たなデータが書込まれ、元の分割ブロック113aの中の他のデータ格納領域に書込まれていた最新のデータは、前記次順位の分割ブロック113bの該当データ格納領域の先頭セクションに転送格納され、分割ブロック113a〜113dの移行に当たっては、一括消去済であるブランクブロックの前にあるブランクブロックの分割ブロックへ移行するように構成されている。   As described above, the non-volatile data memory 113A includes at least three or more divided blocks 113a to 113d, and in any of the data storage areas S10, S20, and S300 in the divided block 113a currently being written. When there is no empty section, first, the next-order divided block 113c is collectively erased, and then the next-order divided block 113b is collectively erased as a confirmation process. New data is written in the first section of the storage area, and the latest data written in the other data storage areas in the original divided block 113a is the corresponding data storage area of the next divided block 113b. In the transfer of the divided blocks 113a to 113d, the first section is transferred and stored. Is configured to shift to divide blocks of blank blocks in front of the blank block is already erased.

データの読出しが行われる最新セクションの検索要領を示した図4の(B)に於いて、チェック領域S0にはブランクブロックではないことを示す確定定数と一括消去回数がデータCとして書込まれている。第一定数領域S10の先頭セクションS11には、第一定数108aの最新データF1が書込まれていて、続くセクションS12は未書込み状態となっている。   In FIG. 4B showing the search procedure of the latest section from which data is read, a definite constant indicating that it is not a blank block and the number of batch erases are written as data C in the check area S0. Yes. In the first section S11 of the first constant area S10, the latest data F1 of the first constant 108a is written, and the subsequent section S12 is in an unwritten state.

第二定数領域S20の先頭セクションS21には、第二定数108bの前回データSe1が書込まれ、続くセクションS22には第二定数108bの最新データSe2が書込まれ、続くセクションS23・S24は未書込み状態となっている。   In the first section S21 of the second constant area S20, the previous data Se1 of the second constant 108b is written, the latest data Se2 of the second constant 108b is written in the subsequent section S22, and the subsequent sections S23 and S24 are not yet stored. Write status.

第三定数領域S300の先頭セクションS301には、第三定数108cの初回データT1が書込まれ、続くセクションS302には第三定数108cの2回目データT2が書込まれ、続くセクションS303には第三定数108cの3回目データT3が書込まれているが、書込み途中で停電し、セクションS303の一部領域がブランクとなっている。続くセクションS304〜S320は未書込み状態となっている。   The first section T301 of the third constant 108c is written in the first section S301 of the third constant area S300, the second data T2 of the third constant 108c is written in the succeeding section S302, and the second section T303 is followed by the second section T303. The third data T3 of the three constants 108c is written, but a power failure occurs during the writing, and a partial area of the section S303 is blank. Subsequent sections S304 to S320 are in an unwritten state.

マイクロプロセッサ110Aは、不揮発データメモリ113Aに対する一括消去指令信号とブランクチェック指令信号(消去確認指令信号)を発生し、当該ブランクチェック指令を受信した不揮発データメモリ113Aは、少なくとも前記セクション単位で消去済であるか否かの判定情報を返信する。   The microprocessor 110A generates a batch erase command signal and a blank check command signal (erase confirmation command signal) for the nonvolatile data memory 113A, and the nonvolatile data memory 113A that has received the blank check command has been erased at least for each section. The determination information of whether or not there is returned.

前記マイクロプロセッサ110Aは、一括消去を行うことによって、消去済となったセクションは空セクションであると判定し、一括消去を行っても消去できなかったセクションがあるか、又は不揮発データメモリ113Aに対するデータの書込み中に停電が発生したことが原因となって、一つのセクションの中でデータの書込み部分と未書込み部分が混在していることが検出された場合には、当該セクションは無効セクションであると判定すると共に、セクション内にデータが存在して無効セクションではないセクションを有効セクションであると判定する。   The microprocessor 110A determines that the erased section is an empty section by performing batch erase, and there is a section that cannot be erased even after batch erase, or data for the nonvolatile data memory 113A. If it is detected that a data write part and a non-write part are mixed in one section due to a power failure during writing, the section is an invalid section. And a section that is not an invalid section because data exists in the section is determined to be a valid section.

マイクロプロセッサ110Aは、不揮発データメモリ113Aの読出しを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて有効セクションを検索し、初めて検出された有効セクションに格納されたデータを読出しする。   When reading data from the nonvolatile data memory 113A, the microprocessor 110A searches for a valid section from the last section to the top section of each data storage area, and reads data stored in the valid section detected for the first time.

次に、この発明の実施の形態1による電子制御装置に於ける異常処理について、その処理方法の概念についてを説明する。図5は、この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの異常処理の説明図であり、図5の(A)は書込み異常が発生した場合の処理方法を示しており、図5の(B)は分割ブロックの一括消去に於いて消去異常が発生した場合の処理方法を示している。   Next, the concept of the processing method for abnormality processing in the electronic control apparatus according to Embodiment 1 of the present invention will be described. FIG. 5 is an explanatory diagram of the abnormal processing of the nonvolatile data memory in the electronic control unit according to Embodiment 1 of the present invention, and FIG. 5A shows a processing method when a writing abnormality occurs. FIG. 5B shows a processing method in the case where an abnormal erasure occurs in the batch erase of the divided blocks.

書込み異常が発生した場合の処理方法を示す図5の(A)に於いて、ここではセクションS302にセルの異常があるか又はデータが書込まれていて、無効セクションとなっている場合を示している。マイクロプロセッサ110Aは、不揮発データメモリ113Aの書込みを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて有効セクションを検索し、初めて検出された有効セクションから逆方向に検索して初めて検出された空セクションにデータを書込みすると共に、当該空セクションに正しくデータの書込みが行えなかった場合には、更に逆方向に検索して新たに検出された空セクションにデータを書込みするように構成されている。   In FIG. 5A showing a processing method when a writing abnormality occurs, here, a case where there is a cell abnormality in the section S302 or data has been written and an invalid section is shown. ing. When writing to the nonvolatile data memory 113A, the microprocessor 110A searches for a valid section from the last section to the top section of each data storage area, and searches for a valid section that was detected for the first time in the reverse direction. When data is written to the section and data cannot be correctly written to the empty section, the search is further performed in the reverse direction and the data is written to the newly detected empty section.

図5の(B)に示すブロック消去で異常となったときには、1回だけリトライを実施するが、リトライしてもブロック消去が異常であればチェック領域のブランクチェックを行い、ブランクであればブロック消去正常と見なすようになっている。これは、セクション内に未消去部分があっても、次のセクションに書込みするため実害がないためである。   When an error occurs in the block erase shown in FIG. 5B, a retry is performed only once. However, if the block erase is abnormal even after retrying, a blank check is performed on the check area. The erasure is considered normal. This is because even if there is an unerased portion in a section, the next section is written and there is no actual harm.

(2)作用・動作の詳細な説明
次に、この発明の実施の形態1による電子制御装置の動作・作用について説明する。図6は、この発明の実施の形態1による電子制御装置に於ける全体動作のフローチャートである。図6に於いて、先ずステップ600aにより、図示しない電源スイッチが投入されると、電源リレー102が付勢されて電子制御装置100Aが給電駆動され、ステップ601に於いてマイクロプロセッサ110Aが動作を開始する。
(2) Detailed Description of Action / Operation Next, the operation / action of the electronic control apparatus according to Embodiment 1 of the present invention will be described. FIG. 6 is a flowchart of the overall operation in the electronic control apparatus according to Embodiment 1 of the present invention. In FIG. 6, first, when a power switch (not shown) is turned on in step 600a, the power relay 102 is energized and the electronic control unit 100A is driven to supply power. In step 601, the microprocessor 110A starts its operation. To do.

続くステップ602aは、不揮発プログラムメモリ111Aに対して入出力プログラム107Aを転送したいのかどうかを人為的に判断して、転送したいのであれば第一ツール105Aを接続してからその転送操作キーを押すことによってYesの判定が行われてステップブロック602bへ移行し、転送操作キーが押されていないか、又は不揮発プログラムメモリ111Aに対して入出力プログラム107Aが既に書込みされている場合にはNoの判定を行ってステップ603aへ移行する判定ステップである。   In the subsequent step 602a, it is artificially determined whether or not the input / output program 107A is to be transferred to the non-volatile program memory 111A. If transfer is desired, the first tool 105A is connected and then the transfer operation key is pressed. Yes, and the process proceeds to step block 602b. If the transfer operation key has not been pressed or if the input / output program 107A has already been written to the nonvolatile program memory 111A, the determination of No is made. This is a determination step to go to step 603a.

ステップブロック602bは、マスクROMメモリ111aに格納されているブートプログラムによって第一ツール105Aに格納されている入出力プログラム107Aが不揮発プログラムメモリ111Aに転送格納して行程603aへ移行するステップであり、入出力制御プログラム107Aにはプログラムに固有の一定不変の固定定数や参考定数107aが包含されている。   Step block 602b is a step in which the input / output program 107A stored in the first tool 105A is transferred and stored in the nonvolatile program memory 111A by the boot program stored in the mask ROM memory 111a, and the process proceeds to step 603a. The output control program 107A includes fixed constants that are specific to the program and reference constants 107a.

行程603aは、第1〜第4ブロックのどれかの分割ブロックでチェック領域S0に設定確定数値が書込まれているものがあるかどうかを判定することによって分割ブロックの初期化が行われているかどうかを判定し、初期化が行われておればYesの判定を行ってステップ604aへ移行し、初期化が行われていなければNoの判定を行ってステップ603bへ移行する判定ステップである。   In step 603a, whether the divided block is initialized by determining whether any of the divided blocks of the first to fourth blocks has a set fixed value written in the check area S0. In this determination step, if the initialization is performed, the determination of Yes is performed and the process proceeds to step 604a. If the initialization is not performed, the determination of No is performed and the process proceeds to step 603b.

行程603bでは先ずRAMメモリ112Aのイメージメモリ領域108に対して、第一定数108a・第二定数108b・第三定数108cの初期設定値を書込むが、この初期設定値は不揮発プログラムメモリ111Aに格納されている参考定数107aが適用され、参考定数が与えられていない個別データに関しては例えば数値0等の任意の定数が仮定数として書込まれるように構成されている。   In step 603b, first, initial setting values of the first constant 108a, the second constant 108b, and the third constant 108c are written into the image memory area 108 of the RAM memory 112A. The initial setting values are written in the nonvolatile program memory 111A. The stored reference constant 107a is applied, and for the individual data to which no reference constant is given, for example, an arbitrary constant such as a numerical value 0 is written as an assumed number.

ステップ604aは、RAMメモリ112Aに対して第一定数108aを転送したいのかどうかを人為的に判断して、転送したいのであれば第一ツール105Aを接続してからその転送操作キーを押すことによってYesの判定が行われてステップ605aへ移行し、転送操作キーが押されていないか又は第一ツール105Aが接続されていなければNoの判定を行ってステップ604bへ移行する判定ステップである。   Step 604a artificially determines whether or not to transfer the first constant 108a to the RAM memory 112A, and if so, connects the first tool 105A and then presses the transfer operation key. If the determination of Yes is made and the process proceeds to step 605a and the transfer operation key is not pressed or the first tool 105A is not connected, the determination of No is performed and the process proceeds to step 604b.

ステップ605aは、第一ツール105Aから得られる第一定数108aをRAMメモリ112Aのイメージメモリ領域108へ転送してからステップ606へ移行するステップである。   Step 605a is a step in which the first constant 108a obtained from the first tool 105A is transferred to the image memory area 108 of the RAM memory 112A, and then the process proceeds to step 606.

ステップ604bは、RAMメモリ112Aに対して第一定数108bを転送したいのかどうかを人為的に判断して、転送したいのであれば第二ツール106Aを接続してからその転送操作キーを押すことによってYesの判定が行われてステップ605bへ移行し、転送操作キーが押されていないか又は第二ツール106Aが接続されていなければNoの判定を行ってステップ604cへ移行する判定ステップである。   Step 604b artificially determines whether or not to transfer the first constant 108b to the RAM memory 112A, and if so, connects the second tool 106A and then presses the transfer operation key. If the determination of Yes is made and the process proceeds to step 605b and the transfer operation key is not pressed or the second tool 106A is not connected, the determination of No is performed and the process proceeds to step 604c.

行程605bは、第二ツール106Aから得られる第二定数108bをRAMメモリ112Aのイメージメモリ領域108へ転送してから行程606へ移行するステップである。行程604cは、電子制御装置100Aの実用運転中に於いて、RAMメモリ112Aに対して書込みしたい学習記憶情報が発生したときにYesの判定が行われてステップ605cへ移行し、学習記憶情報が発生していないときにばNoの判定を行ってステップ606へ移行する判定ステップである。   In step 605b, the second constant 108b obtained from the second tool 106A is transferred to the image memory area 108 of the RAM memory 112A, and then the process proceeds to step 606. In step 604c, when the learning memory information to be written to the RAM memory 112A is generated during the practical operation of the electronic control unit 100A, the determination of Yes is made and the process proceeds to step 605c, and the learning memory information is generated. If not, it is a determination step of determining No and proceeding to Step 606.

ステップ605cは、電子制御装置100Aの実用運転中に得られる学習情報を第三定数108cをRAMメモリ112Aのイメージメモリ領域108へ書込みしてからステップ606へ移行するステップである。ステップ606は、電源スイッチの投入/遮断状態を判定するステップであり、電源スイッチが投入されておればNoの判定となって動作終了行程609へ移行し、電源スイッチが遮断された所定時間内ではYesの判定が行われてステップブロック700へ移行するように構成されている。   Step 605c is a step in which the learning information obtained during the practical operation of the electronic control unit 100A is written with the third constant 108c in the image memory area 108 of the RAM memory 112A, and then the process proceeds to step 606. Step 606 is a step for determining whether the power switch is turned on or off. If the power switch is turned on, the determination is No and the operation shifts to step 609, and within a predetermined time when the power switch is turned off. A determination of Yes is made and the process proceeds to step block 700.

ステップブロック700は、図7に於いて後述するデータメモリの書込み処理ステップであり、このステップブロックではステップ605a・605b・605cでRAMメモリ112Aのイメージメモリ領域108に書込まれていた第一定数108a又は第二定数108b又は第三定数108cの全てが不揮発データメモリ113Aの第一定数領域S10又は第二定数領域S20又は第三定数領域S300に転送書込みされてからステップ600cへ移行するように構成されている。   The step block 700 is a data memory write processing step which will be described later with reference to FIG. 7. In this step block, the first constant written in the image memory area 108 of the RAM memory 112A in steps 605a, 605b and 605c. 108a or the second constant 108b or the third constant 108c is transferred and written to the first constant area S10, the second constant area S20 or the third constant area S300 of the non-volatile data memory 113A, and then the process proceeds to step 600c. It is configured.

尚、RAMメモリ112Aのイメージメモリ領域108に対しては、ステップブロック603bに於いて仮の値である初期設定値が書込まれていて、その後にステップ605a・605b・605cに於いて順次更新書換が行われているので、ステップブロック700に於いて不揮発データメモリ113Aに転送されるデータは更新書込みされたデータであり、行程605a・605b・605cのどれかがまだ実行されていない場合には第一定数108a・第二定数108b・第三定数108cのどれかはステップ603bで設定された初期設定値となっている。 The initial setting value, which is a temporary value, is written in the step block 603b in the image memory area 108 of the RAM memory 112A, and then updated and rewritten sequentially in steps 605a, 605b, and 605c. In step block 700, the data transferred to the non-volatile data memory 113A is the updated data, and if any of the processes 605a, 605b, and 605c has not been executed yet, Any one of the first constant 108a, the second constant 108b, and the third constant 108c is the initial set value set in step 603b.

ステップ600cでは電源リレー102が消勢されて電子制御装置100Aに対する給電が停止される。動作終了ステップ609では他の制御プログラムを実行して、所定時間以内には再度動作開始ステップ601へ復帰して、以下同様の制御が繰返して実行されるように構成されている。   In step 600c, the power supply relay 102 is de-energized and power supply to the electronic control unit 100A is stopped. In the operation end step 609, another control program is executed, and the operation is returned to the operation start step 601 again within a predetermined time. Thereafter, the same control is repeatedly executed.

図6のフローチャートは、異なる時期で実行される各種の処理を合併して、概括表現したものである。先ず第一の処理としては、ステップ600aからステップブロック602b・ステップ603b・ステップ605a・ステップブロック700・ステップ600cが実行されて、入出力制御プログラム107Aの転送と、不揮発データメモリ113Aに対する第一定数108aの転送と、第二・第三定数に対する初期設定値の転送処理が行われる。   The flowchart of FIG. 6 is a general representation of a combination of various processes executed at different times. First, as a first process, step 600a to step block 602b, step 603b, step 605a, step block 700, and step 600c are executed to transfer the input / output control program 107A and the first constant for the nonvolatile data memory 113A. The transfer of 108a and the transfer process of the initial setting values for the second and third constants are performed.

続く第二の処理としては、ステップ600a・ステップ605b・ステップブロック700・ステップ600cが実行されて、不揮発データメモリ113Aに対する第二定数108bが転送される。同様に、第三の処理としては、行程600a・ステップ605c・ステップブロック700・ステップ600cが実行されて、不揮発データメモリ113Aに対する第三定数108cが転送されるが、第三定数108cに関してはステップ601・ステップ605c・ステップ606・ステップ609・ステップ601を循環しながら多数の個別データが順次RAMメモリ112Aに拡充格納され、電源スイッチが遮断された直後にステップブロック700によって一括して不揮発データメモリ113Aへ転送されることになる。   As the subsequent second processing, Step 600a, Step 605b, Step Block 700, and Step 600c are executed, and the second constant 108b for the nonvolatile data memory 113A is transferred. Similarly, as the third process, the process 600a, step 605c, step block 700, and step 600c are executed and the third constant 108c for the non-volatile data memory 113A is transferred, but for the third constant 108c, step 601 is performed. A large number of individual data are sequentially expanded and stored in the RAM memory 112A while circulating through step 605c, step 606, step 609, and step 601, and immediately after the power switch is turned off, the step block 700 collectively transfers to the nonvolatile data memory 113A. Will be transferred.

図7は、この発明の実施の形態1による電子制御装置に於けるデータ書込み処理の全体フローチャートである。図7に於いて、ステップ700は、データメモリに対するデータの書込み開始ステップである。続くステップ701は、不揮発データメモリ113Aの初期化を行うかどうかを判定するステップであり、このステップ701では分割ブロックの全てにデータが書込まれていて、次に書込むべき分割ブロックが特定できない状態になっているとき、又は全ブロックのどこにも有効なデータが書かれていないときに初期化要であるYesと判定してステップブロック800へ移行し、図14により後述する最新ブロックの検索が行えたときには初期化不要であるNoと判定してステップブロック900へ移行するように構成されている。   FIG. 7 is an overall flowchart of data write processing in the electronic control apparatus according to Embodiment 1 of the present invention. In FIG. 7, step 700 is a step of starting data writing to the data memory. The subsequent step 701 is a step of determining whether or not to initialize the nonvolatile data memory 113A. In this step 701, data is written in all of the divided blocks, and the divided block to be written next cannot be specified. When it is in a state or when valid data is not written anywhere in all blocks, it is determined that the initialization is necessary and the process proceeds to step block 800, and the latest block search described later with reference to FIG. If it can be done, it is determined that initialization is not required and the process proceeds to step block 900.

ステップブロック800は、図8により後述するデータメモリの初期化処理ステップである。続くステップ702は、ステップブロック800による初期化処理が正常に終了したときはYesの判定を行ってステップブロック900へ移行し、非正常であったときにはNoの判定を行ってステップ707へ移行する判定ステップである。   Step block 800 is a data memory initialization process step, which will be described later with reference to FIG. In the subsequent step 702, when the initialization process by the step block 800 is normally completed, a determination of Yes is made and the process proceeds to the step block 900. When the initialization process is not normal, a determination of No is performed and the process proceeds to step 707. It is a step.

ステップブロック900は、図9により後述するデータメモリのデータ書込処理ステップである。続くステップ703は、ステップブロック900による書込処理が正常に終了したときはYesの判定を行ってステップ704へ移行し、非正常(ブロック内に空セクションが無い)であったときにはNoの判定を行ってステップブロック1100へ移行する判定ステップである。   Step block 900 is a data write processing step of the data memory described later with reference to FIG. In the subsequent step 703, when the writing process by the step block 900 is normally completed, a determination of Yes is made and the process proceeds to step 704, and when it is abnormal (there is no empty section in the block), a determination of No is made. This is a determination step to go to step block 1100.

ステップ704は、RAMメモリ112Aに設けられたステータスメモリ112aに於ける読出しセクション番号を更新してステップ705へ移行するステップである。ステップブロック1100は、図11により後述する分割ブロックの移行処理ステップである。続くステップ706は、ステップブロック1100による移行処理が正常に終了したときはYesの判定を行ってステップ705へ移行し、非正常であったときにはNoの判定を行って行程700へ移行する判定ステップである。ステップ705は、書込み正常終了ステップであり、ステップ707は書込み異常終了ステップである。   In step 704, the read section number in the status memory 112a provided in the RAM memory 112A is updated, and the process proceeds to step 705. The step block 1100 is a divided block transition processing step which will be described later with reference to FIG. The subsequent step 706 is a determination step in which a Yes determination is made when the transfer process by the step block 1100 has been completed normally, and the process proceeds to step 705. is there. Step 705 is a writing normal end step, and step 707 is a writing abnormal end step.

この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの初期化処理のフローチャートである。図8に於いて、ステップ801は、初期化処理の開始ステップである。続くステップブロック1000は、図10により後述する全ブロックの一括消去処理ステップである。続くステップ802は、ステップブロック1000による消去処理が正常に終了したときはYesの判定を行ってステップ803へ移行し、非正常であったときにはNoの判定を行ってステップ811へ移行する判定ステップである。   It is a flowchart of the initialization process of the non-volatile data memory in the electronic control apparatus by Embodiment 1 of this invention. In FIG. 8, step 801 is a start step of the initialization process. A subsequent step block 1000 is a batch erasure processing step for all blocks, which will be described later with reference to FIG. The subsequent step 802 is a determination step in which a Yes determination is made when the erasing process by the step block 1000 is normally completed, and the process proceeds to step 803, and a No determination is performed when the erase process is not normal, and the process proceeds to step 811. is there.

ステップ803は、書込みセクションを先頭ブロックである第1ブロック113aに決定してからステップブロック900へ移行するステップである。ステップブロック900は、図9により後述する書込処理ステップであり、第1ブロック113aの第一定数領域S10の先頭セクションS11と、第二定数領域S20の先頭セクションS21と、第三定数領域S300の先頭セクションS301に対して初期設定値を書込む。   In step 803, the writing section is determined to be the first block 113a which is the first block, and then the process proceeds to step block 900. Step block 900 is a writing process step which will be described later with reference to FIG. 9, and the first section S11 of the first constant area S10, the first section S21 of the second constant area S20, and the third constant area S300 of the first block 113a. The initial setting value is written into the first section S301 of the.

続くステップ804は、ステップブロック900による書込処理が正常に終了したときはYesの判定を行ってステップ805へ移行し、非正常であったときにはNoの判定を行ってステップ811へ移行する判定ステップである。   In the subsequent step 804, when the writing process by the step block 900 is normally completed, a determination of Yes is made and the process proceeds to step 805. When the writing process is not normal, a determination of No is performed and the process proceeds to step 811. It is.

ステップ805は、ステップブロック900に於いて各データ格納領域の先頭セクションに対するデータの書込みが完了したかどうかを判定し、未完了であればNoとなってステップ803へ復帰移行し、完了であればYesとなってステップ806へ移行する判定ステップである。ステップ806は、第1ブロック113aのチェック領域S0に設けられたセクションS1に対して、所定の確定数値と一括消去回数「1」を書込むステップである。   In step 805, it is determined whether or not the writing of data to the first section of each data storage area is completed in step block 900. If it is not completed, the determination is No and the process returns to step 803, and if completed, This is a determination step in which the determination becomes Yes and the process proceeds to step 806. Step 806 is a step of writing a predetermined fixed numerical value and the number of batch erasures “1” into the section S1 provided in the check area S0 of the first block 113a.

続くステップ807は、ステップ806によるチェック領域の書込処理が正常に終了したときはYesの判定を行ってステップ808へ移行し、非正常であったときにはnoの判定を行ってステップ811へ移行する判定ステップである。ステップ808は、RAMメモリ112Aに設けられたステータスメモリ112aに於ける最新ブロックのブロック番号を先頭ブロック番号としてからステップ809へ移行するステップである。   In the subsequent step 807, if the check area writing process in step 806 has been completed normally, a determination of Yes is made and the process proceeds to step 808. If it is not normal, a determination of no is performed and the process proceeds to step 811. This is a determination step. In step 808, the block number of the latest block in the status memory 112a provided in the RAM memory 112A is set as the head block number, and then the process proceeds to step 809.

ステップ809は、RAMメモリ112Aに設けられたステータスメモリ112aに於ける読出しセクション番号を先頭先頭番号としてからステップ810へ移行するステップである。ステップ810は、初期化正常終了ステップであり、ステップ811は初期化異常終了ステップである。   Step 809 is a step in which the read section number in the status memory 112a provided in the RAM memory 112A is set as the head start number, and then the process proceeds to step 810. Step 810 is an initialization normal end step, and step 811 is an initialization abnormal end step.

図9は、この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの書込み処理のフローチャートである。図9に於いて、ステップ901は、書込み処理の開始ステップである。続くステップ902は、現在の書込みブロックに空セクションがの残されているかどうかをRAMメモリ112A内のステータスメモリ112aの内容によって判定し、空セクションがあればYesの判定を行ってステップ903へ移行し、空セクションがなければNoの判定を行ってステップ911へ移行する判定ステップである。   FIG. 9 is a flowchart of the writing process of the nonvolatile data memory in the electronic control apparatus according to Embodiment 1 of the present invention. In FIG. 9, step 901 is the start step of the writing process. In the subsequent step 902, whether or not an empty section remains in the current write block is determined based on the contents of the status memory 112a in the RAM memory 112A. If there is an empty section, the determination is Yes and the process proceeds to step 903. If there is no empty section, No is determined and the process proceeds to step 911.

ステップ903は、書込みしたいセクションが空セクションであるかどうかを確認するためのブランクチェックを行うステップである。続くステップ904は、ステップ903によるブランクチェックの結果として書込みしたいセクションが空セクションであればYesの判定を行ってステップ905へ移行し、空セクションでなければNoの判定を行ってステップ907へ移行する判定ステップである。   Step 903 is a step of performing a blank check to confirm whether the section to be written is an empty section. In the subsequent step 904, if the section to be written as a result of the blank check in step 903 is an empty section, the determination of Yes is performed and the process proceeds to step 905. If not, the determination of No is performed and the process proceeds to step 907. This is a determination step.

ステップ905は、書込みセクションにデータの書込みを実施してからステップ906へ移行するステップである。ステップ906は、ステップ905によるデータの書込みが正常であればYesの判定を行ってステップ910へ移行し、非正常であればNoの判定を行ってステップ907へ移行する判定ステップである。   In step 905, data is written in the writing section, and then the process proceeds to step 906. Step 906 is a determination step in which a determination of Yes is made if the data writing in step 905 is normal and the process proceeds to step 910, and a determination of No is made if the data writing is not normal and the process proceeds to step 907.

ステップ907は、書込みセクション番号を進行させてからステップ902へ復帰移行するステップであり、書込み異常である場合には書込みセクションを進め、再度ブランクチェックと書込みを実施して、ブロック内に空セクションが無くなればステップ911による異常終了となり、正常書込みされた場合はステップ910による正常終了となる。   Step 907 is a step in which the write section number is advanced and then the process returns to step 902. If the write is abnormal, the write section is advanced, blank check and write are performed again, and an empty section is found in the block. If it disappears, the process ends abnormally in step 911, and if it is normally written, it ends normally in step 910.

図10は、この発明の実施の形態1による電子制御装置に於ける全ブロック消去処理のフローチャートであり、指定された分割ブロックの消去処理を示している。図10に於いて、ステップ1001は、消去処理の開始ステップである。続くステップ1002は、リトライカウンタの現在値を「0」にしてからステップ1003へ移行するステップである。   FIG. 10 is a flowchart of the all block erasing process in the electronic control apparatus according to Embodiment 1 of the present invention, and shows the erasing process of the designated divided block. In FIG. 10, step 1001 is a starting step of the erasing process. In the subsequent step 1002, the current value of the retry counter is set to “0”, and then the process proceeds to step 1003.

ステップ1003は、分割ブロックの消去を実施してからステップ1004へ移行するステップである。ステップ1004は、ブランクチェックを行うことによって指定された分割ブロックの消去が行われたかどうかを判定し、消去されておればYesの判定を行ってステップ1010へ移行し、消去されていなければNoの判定を行ってステップ1005へ移行する判定ステップである。   Step 1003 is a step in which the process proceeds to Step 1004 after erasing the divided blocks. In step 1004, it is determined whether or not the designated divided block has been erased by performing a blank check. If erased, the determination is Yes and the process proceeds to step 1010. In this determination step, the determination is made and the process proceeds to step 1005.

ステップ1005は、リトライカウンタの現在値に「1」を加算してからステップ1006へ移行するステップである。ステップ1006は、リトライカウンタの現在値が「2」未満であればリトライを許可するYesの判定を行ってステップ1003へ復帰し、現在値が「2」以上であればリトライを不許可とするNoの判定を行ってステップ1007へ移行する判定ステップである。   Step 1005 is a step in which “1” is added to the current value of the retry counter, and then the process proceeds to Step 1006. In Step 1006, if the current value of the retry counter is less than “2”, the determination of Yes to permit the retry is performed, and the process returns to Step 1003. If the current value is “2” or more, the retry is not permitted. This is a determination step in which the determination is made and the process proceeds to step 1007.

ステップ1007は、チェック領域S0のブランクチェックを行うステップである。続くステップ1008は、ステップ1007によるブランクチェックの結果として、チェック領域S0がブランクであればYesの判定を行って正常終了ステップ1010へ移行し、チェック領域S0がブランクでなければNoの判定を行って異常終了ステップ1011へ移行する判定ステップとなっている。   Step 1007 is a step of performing a blank check of the check area S0. In the subsequent step 1008, if the check area S0 is blank as a result of the blank check in step 1007, the determination is Yes and the process proceeds to the normal end step 1010. If the check area S0 is not blank, the determination is No. This is a determination step for shifting to the abnormal end step 1011.

尚、チェック領域がブランクであれば、最新ブロックの検索は正常に動作し、書き込み処理において空セクションでなければ次のセクションに書き込む処理があるためチェック領域以外で消去さていない部分が存在しても機能的な影響はない。そのため、リトライ後の消去異常時に、チェック領域がブランクであれば正常終了とするように構成されている。   If the check area is blank, the search for the latest block works normally, and if there is a process that writes to the next section if it is not an empty section in the write process, there are parts that are not erased outside the check area. There is no functional impact. For this reason, if the check area is blank at the time of erasure abnormality after retry, it is configured to terminate normally.

図11は、この発明の実施の形態1による電子制御装置に於ける移行処理のフローチャートであり、分割ブロックの移行処理を示している。図11に於いて、ステップ1101は、ブロック移行処理の開始ステップである。ステップブロック1000aは、図10により前述したデータメモリのブロック消去のステップであり、ここでは2つ先の分割ブロックの一括消去が行われる。   FIG. 11 is a flowchart of the migration process in the electronic control apparatus according to Embodiment 1 of the present invention, and shows the division block migration process. In FIG. 11, step 1101 is a start step of block migration processing. The step block 1000a is a step of erasing the data memory block described above with reference to FIG.

続くステップ1102aは、ステップブロック1000aによる消去処理が正常に終了したときはYesの判定を行ってステップブロック1000bへ移行し、非正常であったときにはNoの判定を行って異常終了ステップ1111へ移行する判定ステップである。ステップブロック1000bは、図10により前述したデータメモリのブロック消去のステップであり、ここでは1つ先の分割ブロックの一括消去が行われる。   In the subsequent step 1102a, when the erasing process by the step block 1000a is normally completed, a determination of Yes is made and the process proceeds to the step block 1000b. This is a determination step. The step block 1000b is a block erase step of the data memory described above with reference to FIG. 10, and here, the previous divided block is collectively erased.

続くステップ1102bは、ステップブロック1000bによる消去処理が正常に終了したときはYesの判定を行ってステップ1103aへ移行し、非正常であったときにはNoの判定を行って異常終了行程1111へ移行する判定ステップである。   In the subsequent step 1102b, when the erasing process by the step block 1000b is normally completed, a determination of Yes is made and the process proceeds to step 1103a, and when it is not normal, a determination of No is performed and the process proceeds to the abnormal end process 1111. It is a step.

ステップ1103aは、満杯となって分割ブロックの移行が行われたデータ格納領域を指定領域として、指定領域の書込みセクション番号を先頭セクションに更新するステップである。続くステップブロック900aは図9により前述したデータ書込みのステップであり、ここでは満杯となって分割ブロックの移行が行われたデータ格納領域に関して、新たに発生したデータが書込まれるように構成されている。   Step 1103a is a step of updating the write section number of the designated area to the first section using the designated data storage area where the divided blocks have been migrated as a designated area. The subsequent step block 900a is the data writing step described above with reference to FIG. 9, and is configured such that newly generated data is written in the data storage area that is full and the divided block is transferred. Yes.

続くステップ1102cは、ステップブロック900aによる書込処理が正常に終了したときはYesの判定を行ってステップ1103bへ移行し、非正常であったときにはNoの判定を行って異常終了ステップ1111へ移行する判定ステップである。ステップ1103bは、満杯となって分割ブロックの移行が行われたデータ格納領域以外のデータ格納領域の一つについて、移行前の分割ブロックに格納されていた最新データを移行後の分割ブロックの先頭セクションに転送するように書込みセクション番号を更新するステップである。   In the subsequent step 1102c, when the writing process by the step block 900a is normally completed, the determination of Yes is performed and the process proceeds to step 1103b. When the writing process is not normal, the determination of No is performed and the process proceeds to the abnormal termination step 1111. This is a determination step. In step 1103b, for one of the data storage areas other than the data storage area where the divided block has been migrated, the latest section stored in the divided block before migration is transferred to the first section of the divided block after migration. The write section number is updated to be transferred.

続くステップブロック1200は、図12により後述するデータの検索読出処理ステップであり、ここでは移行前の分割ブロックについて正常な分割ブロックや読出しセクションの検索を行って、有効なセクションの有無を検索する。続くステップ1104は、移行前の分割ブロックについて、有効なセクションが存在すればYesの判定を行ってステップブロック900bへ移行し、有効なセクションが存在しない場合にはステップブロック900cへ移行する判定ステップである。   A subsequent step block 1200 is a data search / read processing step described later with reference to FIG. 12. Here, a normal divided block and a read section are searched for the divided blocks before the transition to search for the existence of an effective section. Subsequent step 1104 is a determination step in which if a valid section exists for the divided block before the transition, a Yes determination is made and the process proceeds to step block 900b, and if there is no valid section, a transition to step block 900c is performed. is there.

ステップブロック900bは、図9により前述した書込処理ステップであり、ここではステップブロック1200で読出しされた移行前分割ブロック内の最新データが移行後の分割ブロックの先頭セクションに転送書込みされる。ステップブロック900cは、図9により前述した書込処理ステップであり、ここでは図6のステップ603bでRAMメモリ112Aのイメージメモリ108に書込まれた初期設定値が移行後の分割ブロックの先頭セクションに転送書込みされる。   Step block 900b is the write processing step described above with reference to FIG. 9. Here, the latest data in the pre-migration divided block read in step block 1200 is transferred and written to the first section of the post-migration divided block. Step block 900c is the write processing step described above with reference to FIG. 9. Here, the initial setting value written in image memory 108 of RAM memory 112A at step 603b in FIG. Transfer written.

ステップブロック900b又は900cに続くステップ1102dは、ステップブロック900b・900cによる書込処理が正常に終了したときはYesの判定を行ってステップ1105へ移行し、非正常であったときにはNoの判定を行って異常終了ステップ1111へ移行する判定ステップである。   Step 1102d following step block 900b or 900c makes a Yes determination when the writing process by step blocks 900b and 900c ends normally and proceeds to step 1105, and makes a No determination when the writing process is not normal. This is a determination step for shifting to the abnormal end step 1111.

ステップ1105は、第一領域S10・第二領域S20・第三領域S300の全領域に対して最新データ又は初期値データが書込まれたかどうかを判定し、未完了であればNoの判定を行ってステップ1103bへ復帰移行し、完了であればYesの判定を行ってステップ1106へ移行する判定ステップである。ステップ1106は、移行後の分割ブロックのチェック領域S0に設けられたセクションS1に対して、所定の確定数値と一括消去回数を書込むステップであり、この一括消去回数は移行前の分割ブロックのセクションS1に書込みされていた一括消去回数に1を加算した値である。   Step 1105 determines whether or not the latest data or initial value data has been written in all areas of the first area S10, the second area S20, and the third area S300. Then, the process returns to step 1103b, and if it is completed, a determination of Yes is made and the process moves to step 1106. Step 1106 is a step of writing a predetermined fixed value and the number of batch erasures into the section S1 provided in the check area S0 of the divided block after the transfer. The number of batch erases is the section of the divided block before the transfer. This is a value obtained by adding 1 to the number of batch erases written in S1.

続くステップ1102eは、ステップ1106によるチェック領域の書込処理が正常に終了したときはYesの判定を行ってステップ1107へ移行し、非正常であったときにはNoの判定を行って異常終了ステップ1111へ移行する判定ステップである。ステップ1107は、RAMメモリ112Aに設けられたステータスメモリ112aに於ける最新ブロックのブロック番号を更新してからステップ1108へ移行するステップである。ステップ1108は、RAMメモリ112Aに設けられたステータスメモリ112aに於ける読出しセクション番号を更新してから正常終了ステップ1110へ移行するステップである。   In the subsequent step 1102e, when the check area writing process in step 1106 is normally completed, the determination of Yes is performed and the process proceeds to step 1107. When the check area is not normal, the determination of No is performed and the abnormal termination step 1111 is performed. This is a determination step for transition. In step 1107, the block number of the latest block in the status memory 112a provided in the RAM memory 112A is updated, and then the process proceeds to step 1108. Step 1108 is a step of proceeding to normal end step 1110 after updating the read section number in the status memory 112a provided in the RAM memory 112A.

図12は、この発明の実施の形態1による電子制御装置に於けるデータ読出し処理の全体フローチャートであり、不揮発データメモリからのデータ読出処理を示している。図12に於いて、ステップ1200は、データメモリに対するデータの読出し開始ステップである。続くステップブロック1300は、図13により後述する最新データ検索処理ステップである。   FIG. 12 is an overall flowchart of data reading processing in the electronic control apparatus according to Embodiment 1 of the present invention, and shows data reading processing from the nonvolatile data memory. In FIG. 12, step 1200 is a step of starting reading data from the data memory. A subsequent step block 1300 is a latest data search processing step which will be described later with reference to FIG.

続くステップ1201は、ステップブロック1300の中の最新ブロックの検索結果として、全ての分割ブロック113a〜113cにデータが書込まれていて最新ブロックが特定できない状態であるか、又は全ての分割ブロック113a〜113cがブランクブロックであって有効なデータが検索できない状態であればYesの判定を行って読出異常終了ステップ1211へ移行し、有効ブロックが検索されたときには異常なしであるNoの判定を行ってステップ1202へ移行する判定ステップである。   In the subsequent step 1201, the latest block search result in the step block 1300 is in a state where data is written in all the divided blocks 113a to 113c and the latest block cannot be specified, or all the divided blocks 113a to 113c are not specified. If 113c is a blank block and valid data cannot be searched, the determination is Yes and the process proceeds to reading abnormal end step 1211. When a valid block is searched, the determination is made that there is no abnormality and the determination is No. This is a determination step for shifting to 1202.

続くステップ1202は、ステップブロック1300の中の最新セクションの検索結果として、有効な読出ブロックと読出セクションとが特定できない状態であればYesの判定を行って読出異常終了ステップ1211へ移行し、有効な読出ブロックと読出セクションが検索されたときには異常なしであるNoの判定を行ってステップ1203へ移行する判定ステップである。ステップ1203は、検索された読出ブロックの中の読出セクションのデータを読出してRAMメモリ112Aのイメージメモリ領域108へ格納し、読出正常終了ステップ1210へ移行するステップである。   In the following step 1202, if the valid read block and the read section cannot be identified as the latest section search result in the step block 1300, the determination is Yes and the process proceeds to the read abnormal end step 1211. This is a determination step in which a determination of No indicating no abnormality is made and a transition to step 1203 is made when a read block and a read section are searched. Step 1203 is a step of reading the data of the read section in the read block that has been searched, storing it in the image memory area 108 of the RAM memory 112A, and proceeding to a normal reading end step 1210.

図13は、この発明の実施の形態1による電子制御装置に於ける最新データ検索処理のフローチャートであり、不揮発データメモリの最新データ検索を示している。図13に於いて、ステップ1301は、最新データ検索の開始ステップである。続くステップブロック1400は、図14により後述する最新ブロック検索ステップである。   FIG. 13 is a flowchart of the latest data search process in the electronic control apparatus according to Embodiment 1 of the present invention, and shows the latest data search of the nonvolatile data memory. In FIG. 13, step 1301 is a start step of the latest data search. A subsequent step block 1400 is a latest block search step described later with reference to FIG.

続くステップ1302は、ステップブロック1400による最新ブロックの検索結果として、全ての分割ブロック113a〜113cにデータが書込まれていて最新ブロックが特定できない状態であるか、又は全ての分割ブロック113a〜113cがブランクブロックであって有効なデータが検索できない状態であればYesの判定を行って読出異常終了ステップ1311へ移行し、有効ブロックが検索されたときには異常なしであるNoの判定を行ってステップ1303へ移行する判定ステップである。   In the subsequent step 1302, as the latest block search result in step block 1400, data is written in all the divided blocks 113a to 113c and the latest block cannot be specified, or all the divided blocks 113a to 113c If it is a blank block and valid data cannot be searched, the determination is Yes and the process proceeds to the reading abnormal end step 1311. When the effective block is searched, the determination of No indicating no abnormality is performed and the process proceeds to step 1303. This is a determination step for transition.

ステップ1303は、検索された最新ブロック番号をRAMメモリ112Aの中のステータスメモリ112aに格納してからステップ1500aへ移行するステップである。ステップブロック1500aは、図15により後述する最新セクションの検索ステップであり、ここではステップ1303により記憶された最新ブロックの中の最新セクションの検索が行われる。続くステップ1304は、ステップブロック1500aによる最新セクションの検索結果として、有効なセクションが存在しなかった場合にはYesの判定を行ってステップ1305へ移行し、有効なセクションが発見された場合にはNoの判定を行ってステップ1306aへ移行する判定ステップである。   Step 1303 is a step in which the searched latest block number is stored in the status memory 112a in the RAM memory 112A and then the process proceeds to step 1500a. Step block 1500a is a latest section search step which will be described later with reference to FIG. 15. Here, the latest section in the latest block stored in step 1303 is searched. In the subsequent step 1304, as a result of searching for the latest section by the step block 1500a, if there is no valid section, the determination is Yes and the process proceeds to step 1305. If a valid section is found, No is found. This is a determination step in which the determination is made and the process proceeds to step 1306a.

ステップ1306aは、検索された番号情報をRAMメモリ112Aの中のステータスメモリ112aに格納してからステップ1307へ移行するステップであり、検索番号情報として、読出ブロック番号はステップ1303により格納された最新ブロック番号の現在番号とし、読出セクション番号はステップブロック1500aにより検索された最新セクション番号の現在番号であり、書込セクションは読出セクション番号の次のセクション番号となっている。   Step 1306a is a step in which the searched number information is stored in the status memory 112a in the RAM memory 112A and then the process proceeds to step 1307. As the search number information, the read block number is the latest block stored in step 1303. The read section number is the current number of the latest section number searched by step block 1500a, and the write section is the next section number after the read section number.

ステップ1305は、ステップ1303で記憶された最新ブロック番号の前の分割ブロックがブランクブロックであるかどうかを判定し、ブランクブロックでなければYesの判定を行ってステップブロック1500bへ移行し、ブランクブロックであればNoの判定を行ってステップ1306bへ移行する判定ステップである。   In step 1305, it is determined whether or not the divided block preceding the latest block number stored in step 1303 is a blank block. If it is not a blank block, the determination is Yes and the process proceeds to step block 1500b. If there is, it is a determination step in which a determination of No is made and the process proceeds to step 1306b.

ステップ1306bは、検索された番号情報をRAMメモリ112Aの中のステータスメモリ112aに格納してからステップ1307へ移行するステップであり、検索番号情報として、読出ブロック番号は検索不能を示す異常番号とし、読出セクション番号は検索不能を示す異常番号とし、書込セクションは先頭セクション番号となっている。   Step 1306b is a step in which the searched number information is stored in the status memory 112a in the RAM memory 112A and then the process proceeds to step 1307. As the search number information, the read block number is an abnormal number indicating that the search is impossible. The read section number is an abnormal number indicating that search is impossible, and the write section is the top section number.

ステップブロック1500bは、図15により後述する最新セクションの検索ステップであり、ここではステップ1303により記憶された最新ブロックの前の分割ブロックの中の最新セクションの検索が行われる。ステップ1306cは、検索された番号情報をRAMメモリ112Aの中のステータスメモリ112aに格納してからステップ1307へ移行するステップであり、検索番号情報として、読出ブロック番号はステップ1303で格納された最新ブロック番号の前の番号とし、読出セクション番号はステップブロック1500bにより検索された最新セクション番号の現在番号であり、書込セクションはステップ1303により記憶された最新ブロック番号の先頭セクションとなっている。   Step block 1500b is a latest section search step, which will be described later with reference to FIG. 15. Here, the latest section in the divided block before the latest block stored in step 1303 is searched. Step 1306c is a step in which the searched number information is stored in the status memory 112a in the RAM memory 112A and then the process proceeds to step 1307. As the search number information, the read block number is the latest block stored in step 1303. The read section number is the current number of the latest section number retrieved by step block 1500b, and the write section is the first section of the latest block number stored in step 1303.

ステップ1307は、第一定数領域S10・第二定数領域S20・第三定数領域S300の全ての検索が完了したかどうかを判定し、未完了であればNoの判定を行ってステップブロック1500aへ復帰移行し、完了であればYesの判定を行って検索正常終了ステップ1310へ移行する判定ステップである。   In step 1307, it is determined whether all searches of the first constant area S10, the second constant area S20, and the third constant area S300 have been completed. This is a determination step in which a return shift is made, and if it is completed, a Yes determination is made and the search normal end step 1310 is entered.

図14は、この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの最新ブロック検索処理のフローチャートである。図14に於いて、ステップ1401は、最新ブロック検索の開始ステップである。続くステップ1402は、全ての分割ブロック113a〜113dのチェック領域S0のブランクチェックを行ってからステップ1403aへ移行するステップである。   FIG. 14 is a flowchart of the latest block search processing of the nonvolatile data memory in the electronic control apparatus according to Embodiment 1 of the present invention. In FIG. 14, step 1401 is a start step of the latest block search. A subsequent step 1402 is a step in which a blank check is performed on the check area S0 of all the divided blocks 113a to 113d and then the process proceeds to step 1403a.

ステップ1403aは、ステップ1402によるブランクチェックの結果として、全ての分割ブロック113a〜113dがブランクブロックであればYesとなってステップ1404へ移行し、どれかの分割ブロックがブランクブロックではないときにはNoの判定を行ってステップ1403bへ移行する判定ステップである。   In step 1403a, if all of the divided blocks 113a to 113d are blank blocks as a result of the blank check in step 1402, the process proceeds to step 1404, and if any of the divided blocks is not a blank block, No is determined. Is a determination step for performing step 1403b.

ステップ1404は、全ブロックがブランクブロックであることをステータスメモリ112aにより記憶するステップである。ステップ1403bは、ステップ1402によるブランクチェックの結果として、全ての分割ブロック113a〜113dがブランクブロックではないときにはYesとなってステップ1406へ移行し、どれかの分割ブロックがブランクブロックであればNoの判定を行ってステップ1405へ移行する判定ステップである。   Step 1404 is a step of storing in the status memory 112a that all blocks are blank blocks. In step 1403b, as a result of the blank check in step 1402, when all the divided blocks 113a to 113d are not blank blocks, the determination is Yes, and the process proceeds to step 1406. This is a determination step of performing step 1405.

ステップ1405は、ブランクブロックの一つ前のブランクではない分割ブロックの番号を最新ブロック番号としてステータスメモリ112aにより記憶するステップである。ステップ1406は、各分割ブロックのチェック領域S0のうち、所定の確定定数と一括消去回数が最大となっている分割ブロックが一つだけ存在するかどうかを判定し、存在すればYesの判定を行ってステップ1407へ移行し、存在しなければNoの判定を行ってステップ1408へ移行する判定ステップである。   In step 1405, the status memory 112a stores the number of the divided block that is not blank immediately before the blank block as the latest block number. In step 1406, it is determined whether or not there is only one divided block having a predetermined fixed constant and the maximum number of batch erasures in the check area S0 of each divided block. Then, the process proceeds to step 1407, and if it does not exist, the determination of No is performed and the process proceeds to step 1408.

ステップ1407は、所定の確定定数と最大の一括消去回数であった分割ブロックの番号を最新ブロック番号としてステータスメモリ112aにより記憶するステップである。ステップ1408は、全ての分割ブロックにデータが有って、最新ブロック番号が特定できない異常状態であることをステータスメモリ112aにより記憶するステップである。ステップ1404又はステップ1405又はステップ1407又はステップ1408からは、いずれも正常終了ステップ1410へ移行するように構成されている。   Step 1407 is a step in which the status memory 112a stores the predetermined block constant and the number of the divided block that is the maximum number of batch erasures as the latest block number. Step 1408 is a step of storing in the status memory 112a that there is an abnormal state in which all the divided blocks have data and the latest block number cannot be specified. Steps 1404, 1405, 1407, or 1408 are all configured to move to a normal end step 1410.

図15は、この発明の実施の形態1による電子制御装置に於ける不揮発データメモリの最新セクション検索処理のフローチャートである。図15に於いて、ステップ1501は、最新セクション検索の開始ステップである。続くステップ1502は、対象となっている分割ブロック内のデータ格納領域S10・S20・S300のどれかに関するセクション数N10・N20・N300を最大セクション番号としてワーキングメモリに記憶して、ステップ1503へ移行するステップである。ステップ1503は、記憶した最大セクション番号のセクションに関するブランクチェックを行い、空セクションや無効セクションではない有効セクションであるかどうかをチェックしてからステップ1504へ移行するステップである。   FIG. 15 is a flowchart of the latest section search process of the nonvolatile data memory in the electronic control apparatus according to Embodiment 1 of the present invention. In FIG. 15, step 1501 is a start step of the latest section search. In the subsequent step 1502, the number of sections N10, N20, and N300 regarding any of the data storage areas S10, S20, and S300 in the target divided block is stored in the working memory as the maximum section number, and the process proceeds to step 1503. It is a step. Step 1503 is a step in which a blank check is performed on the section with the largest stored section number to check whether the section is a valid section that is not an empty section or an invalid section, and then the process proceeds to step 1504.

ステップ1504は、ステップ1503によりチェックされたセクションが有効セクションであるか否かによって、有効セクションであればYesの判定を行ってステップ1505へ移行し、有効セクションでなければNoの判定を行ってステップ1506へ移行する判定ステップである。ステップ1505は、ステップ1503により記憶されたセクション番号を有効セクション番号としてステータスメモリ112aにより記憶してから終了ステップ1510へ移行するステップである。   In step 1504, if the section checked in step 1503 is a valid section, if it is a valid section, Yes is determined and the process proceeds to step 1505. If it is not a valid section, No is determined and step 1505 is performed. This is a determination step for shifting to 1506. In step 1505, the section number stored in step 1503 is stored as a valid section number in the status memory 112a, and the process proceeds to the end step 1510.

ステップ1506は、ステップ1503により記憶されたセクション番号が先頭セクション番号を超過しているかどうかを判定し、先頭セクション番号を超過しておればYesの判定を行ってステップ1507へ移行し、先頭セクション番号に合致すればNoの判定を行ってステップ1508へ移行する判定ステップである。ステップ1507は、ワーキングメモリの値を、現在記憶しているセクション番号から「1」を減じた値に更新してからステップ1503へ復帰移行し、ステップ1503では減少したセクション番号のセクションに関するブランクチェックを実施するように構成されている。   In step 1506, it is determined whether the section number stored in step 1503 exceeds the head section number. If the head section number is exceeded, Yes is determined and the process proceeds to step 1507. If NO, NO is determined and the process proceeds to step 1508. In step 1507, the value of the working memory is updated to a value obtained by subtracting “1” from the currently stored section number, and then the process returns to step 1503. In step 1503, a blank check is performed on the section having the decreased section number. It is configured to be implemented.

ステップ1503・ステップ1504・ステップ1506・ステップ1507・ステップ1503を循環実行する過程で、有効セクションが検出されればステップ1504がYesの判定を行って循環動作が停止し、ステップ1504がYesの判定を行う前にステップ1506がNoの判定を行えばステップ1508へ移行して循環動作が停止する。ステップ1508は、有効セクションが存在しないことをステータスメモリ112aにより記憶してから終了ステップ1510へ移行するステップである。   In the process of cyclically executing step 1503, step 1504, step 1506, step 1507, and step 1503, if a valid section is detected, step 1504 makes a Yes determination to stop the cyclic operation, and step 1504 determines Yes. If step 1506 makes a NO determination before performing, the flow proceeds to step 1508 and the circulation operation stops. Step 1508 is a step in which the status memory 112a stores that there is no valid section, and then proceeds to the end step 1510.

以上説明した図7〜図15の制御フローに於ける動作開始ステップは、サブルーチンブログラムの開始ステップであって、これ等の制御フローが正常終了した場合にはサブルーチンコールが行われた元の制御ステップの次のステップに移行する。しかし、異常終了であった場合には、これらの制御フローの上位に位置する図示しない制御フローによって異常処理が実行される。例えば、全ての分割ブロック113a〜113dがブランクブロックでは無かった場合には、所定の異常コード番号の異常履歴情報(累積異常発生回数)が第三定数108aの中の特定の個別データとして保存されてから、分割ブロックの初期化処理が行われるように構成されている。   The operation start step in the control flow of FIGS. 7 to 15 described above is a subroutine program start step. When these control flows are normally completed, the original control in which the subroutine call was performed is performed. Move to the next step after the step. However, in the case of an abnormal end, an abnormal process is executed by a control flow (not shown) positioned above these control flows. For example, if all the divided blocks 113a to 113d are not blank blocks, the abnormality history information (cumulative abnormality occurrence number) of a predetermined abnormality code number is stored as specific individual data in the third constant 108a. Thus, the initialization process of the divided blocks is performed.

その他、以上で説明した個々の制御フローの上位に位置する図示しない制御フローについて補足すると以下のとおりである。先ず、RAMメモリ112Aのイメージメモリ領域108から不揮発データメモリ113Aへのデータの転送は次のように制御されている。
(一)全分割ブロック113a〜113dの初期化と第1ブロック113aの書込み開始のときには、第一ツール105Aからの第一定数108aのみならず、イメージメモリ領域108に格納された第二定数108bと第三定数108cの初期値も転送可能であり、このときには第二ツール106Aは接続されていない。
(二)第二ツール106Aから第二定数108bを転送するときは、第二定数108bのみが転送され、イメージメモリ領域108内の第一定数108a・第三定数108cは、不揮発データメモリ113Aへは転送されることは無い。
(三)第一・第二ツール105A・106Aが接続されていないときには、イメージメモリ領域108内の第一定数108a・第二定数108bがデータメモリ113Aへ転送されることはなく、第三定数108cのみが転送可能である。
In addition, a supplemental description of a control flow (not shown) positioned above the individual control flows described above is as follows. First, data transfer from the image memory area 108 of the RAM memory 112A to the nonvolatile data memory 113A is controlled as follows.
(1) When initializing all the divided blocks 113a to 113d and starting writing of the first block 113a, not only the first constant 108a from the first tool 105A but also the second constant 108b stored in the image memory area 108 And the initial value of the third constant 108c can also be transferred. At this time, the second tool 106A is not connected.
(2) When the second constant 108b is transferred from the second tool 106A, only the second constant 108b is transferred, and the first constant 108a and the third constant 108c in the image memory area 108 are transferred to the nonvolatile data memory 113A. Is never transferred.
(3) When the first and second tools 105A and 106A are not connected, the first constant 108a and the second constant 108b in the image memory area 108 are not transferred to the data memory 113A, and the third constant Only 108c can be transferred.

次に、不揮発データメモリ113AからRAMメモリ112Aのイメージメモリ領域108へのデータの転送は次のように制御されている。
(一)外部電源101Aの「異常電圧低下」、又は「電源線の断線」が電源投入時点で検出されるか、或いは制御電源109Aが補助電圧Vup出力も持たない形式である場合には、電源リレー102が閉路してマイクロプロセッサ110Aが動作を開始した時点において、不揮発データメモリ113Aの第一定数領域S10・第二定数領域S20・第三定数領域S300からRAMメモリ112Aのイメージメモリ領域108へ第一定数108a・第二定数108b・第三定数108cの最新データが転送される。
(二)外部電源101Aの異常電圧低下が発生せず、電源線の断線も検出されず、制御電源109Aが正常な補助電圧Vupを発生している場合でも、イメージメモリ領域108内のデータに符号誤りが検出された場合には、電源投入直後又は運転中において不揮発データメモリ113Aからイメージメモリ領域108に対して、対象となるデータ格納領域内の最新データが転送される。
(三)電源投入直後に不揮発データメモリ113Aの状態チェックを行って、電源遮断前にステータスメモリ112aに格納されていたステータス情報と、新たにチェックされたステータス情報とが合致しているかどうかを点検し、不一致であればイメージメモリ領域108内のデータにも誤りが発生していると判断して、電源投入直後に不揮発データメモリ113Aからイメージメモリ領域108に対して最新データが転送される。
Next, data transfer from the nonvolatile data memory 113A to the image memory area 108 of the RAM memory 112A is controlled as follows.
(1) If an “abnormal voltage drop” or “disconnection of the power supply line” of the external power supply 101A is detected at the time of power-on, or if the control power supply 109A has a form that does not have an auxiliary voltage Vup output, When the relay 102 is closed and the microprocessor 110A starts operating, the first constant area S10, the second constant area S20, and the third constant area S300 of the nonvolatile data memory 113A are transferred to the image memory area 108 of the RAM memory 112A. The latest data of the first constant 108a, the second constant 108b, and the third constant 108c are transferred.
(2) Even when the abnormal voltage drop of the external power supply 101A does not occur, the disconnection of the power supply line is not detected, and the control power supply 109A generates the normal auxiliary voltage Vup, the data in the image memory area 108 is encoded. When an error is detected, the latest data in the target data storage area is transferred from the nonvolatile data memory 113A to the image memory area 108 immediately after the power is turned on or during operation.
(3) Immediately after the power is turned on, the state of the nonvolatile data memory 113A is checked to check whether the status information stored in the status memory 112a before the power is turned off matches the newly checked status information. If they do not match, it is determined that an error has occurred in the data in the image memory area 108, and the latest data is transferred from the nonvolatile data memory 113A to the image memory area 108 immediately after the power is turned on.

以上の説明では、電子制御装置100Aは、例えばエンジン制御装置などの車載電子制御装置であるとして説明したが、その他に一般市販される自動化機器における専用制御装置として適用することも可能である。その場合、自動化機器の製造メーカが書込みするべき第二定数について、その内容が電子制御装置のメーカに通知され、電子制御装置のメーカ側において第一・第二定数をまとめて第一定数領域S10に格納し、第二定数領域S20を省略することも可能である。   In the above description, the electronic control device 100A has been described as an in-vehicle electronic control device such as an engine control device, for example. However, the electronic control device 100A can also be applied as a dedicated control device in other generally available automation equipment. In that case, the contents of the second constant to be written by the manufacturer of the automation equipment are notified to the manufacturer of the electronic control device, and the first and second constants are collected on the electronic control device manufacturer side in the first constant area. It is also possible to store in S10 and omit the second constant area S20.

又、外部電源101Aは、バッテリではなく、一般の商用交流電源が使用され、電源回路109Aは、供給された交流電圧から制御電圧Vccを生成し、保持電圧Vupは内蔵バッテリから得ることも可能である。或いは、補助電源となる外部バッテリや内臓バッテリを持たず、RAMメモリ112Aのイメージメモリ領域108に格納されたデータは不揮発データメモリ113Aによって停電記憶され、運転開始時には必ず不揮発データメモリ113Aからイメージメモリ領域108へ転送復帰するようにしてもよい。   The external power supply 101A is not a battery, but a general commercial AC power supply is used. The power supply circuit 109A can generate the control voltage Vcc from the supplied AC voltage, and the holding voltage Vup can be obtained from the built-in battery. is there. Alternatively, the data stored in the image memory area 108 of the RAM memory 112A does not have an external battery or built-in battery serving as an auxiliary power source, and is stored by the non-volatile data memory 113A during a power failure. The transfer to 108 may be restored.

(3)実施の形態1の要点及び特徴
[請求項1対応]
以上の説明で明らかなとおり、この発明の実施の形態1による電子制御装置は、入力信号回路103と出力信号回路104とが接続されるマイクロプロセッサ110Aと、当該マイクロプロセッサと協働する不揮発プログラムメモリ111Aと揮発性のRAMメモリ112Aと不揮発データメモリ113Aとを備え、前記前記不揮発プログラムメモリ111Aに書込みされた入出力制御プログラム107Aと、前記不揮発データメモリ113Aに格納された制御定数の値と、前記入力信号回路103の信号状態に応動して前記出力信号回路104に制御出力信号を送出する電子制御装置100Aであって、
前記不揮発データメモリ113Aは、ブロック単位で個別に一括消去が可能な複数の分割ブロック113a〜113dを有する不揮発性のメモリによって構成されている。
前記各分割ブロック113a〜113dは、更に、書込み頻度又は書込み時期が異なる複数のデータ格納領域S10・S20・S300に仕分けされている。
前記各データ格納領域S10・S20・S300は、更に、読出/書込単位となる複数のセクションS11・S12、S21〜S24、S301〜S320によって構成され、当該セクションには複数の個別データが所定順序で書込まれ、一つのセクションのデータ容量C10・C20・C300は、書込みされる個別データの個数に対応したバイト数となっている。
前記複数のセクションS11・S12、S21〜S24、S301〜S320には、対象となる分割ブロックの一括消去を行った後に順次新たなデータがセクション単位で格納され、当該対象分割ブロックの中のどれかのデータ格納領域が満杯となってデータが書込まれていない空 セクションが無くなったときには、予め一括消去された他の分割ブロックの該当データ格納領域の先頭セクションに新たなデータが書込まれ、元の分割ブロックの中の他のデータ格納領域に書込まれていた最新のデータは、新たな分割ブロックの該当データ格納領域の先頭セクションに転送格納される。
元の分割ブロック内のデータは少なくとも前記新たな分割ブロックへの最新データの転送書込みが完了した後に一括消去されるものであると共に、前記データ格納領域S10・S20・S300内のセクション数N10・N20・N300は書込み頻度の多いものほど多くのセクションが割り当てられている。
(3) Main points and features of Embodiment 1 [Claim 1]
As is apparent from the above description, the electronic control device according to the first embodiment of the present invention includes a microprocessor 110A to which the input signal circuit 103 and the output signal circuit 104 are connected, and a nonvolatile program memory that cooperates with the microprocessor. 111A, a volatile RAM memory 112A, and a nonvolatile data memory 113A, an input / output control program 107A written in the nonvolatile program memory 111A, a value of a control constant stored in the nonvolatile data memory 113A, An electronic control device 100A for sending a control output signal to the output signal circuit 104 in response to a signal state of the input signal circuit 103,
The non-volatile data memory 113A is constituted by a non-volatile memory having a plurality of divided blocks 113a to 113d that can be individually erased collectively in units of blocks.
Each of the divided blocks 113a to 113d is further divided into a plurality of data storage areas S10, S20, and S300 having different write frequencies or write times.
Each of the data storage areas S10, S20, and S300 is further composed of a plurality of sections S11, S12, S21 to S24, and S301 to S320 serving as read / write units. The data capacity C10, C20, C300 of one section is the number of bytes corresponding to the number of individual data to be written.
In the plurality of sections S11, S12, S21 to S24, and S301 to S320, new data is sequentially stored in section units after batch erasing of the target divided blocks, and any of the target divided blocks is stored. When the data storage area becomes full and there are no empty sections in which no data has been written, new data is written to the first section of the corresponding data storage area of another divided block that has been erased in advance. The latest data written in the other data storage area in the divided block is transferred and stored in the head section of the corresponding data storage area in the new divided block.
The data in the original divided block is erased at least after the transfer and writing of the latest data to the new divided block is completed, and the number of sections in the data storage areas S10, S20, and S300 is N10 and N20. -N300 is assigned more sections as it is written more frequently.

[請求項2対応]
前記分割ブロック113a〜113dの中で、セクション数N10・N20・N300とデータ容量C10・C20・C300の積が最も大きい主たるデータ格納領域の合計データ容量Aと、その他の従となるデータ格納領域全体のセクション数とデータ容量の積である合計データ容量Bとの比率B/(A+B)は、前記分割ブロックの個数Nの逆数よりも小さい値となっている。
以上のとおり、本願の請求項2の発明に関連して、主たるデータ格納領域の合計データ容量とその他の従となるデータ格納領域の合計データ容量との比率は分割ブロックの個数の逆数に関連して制限されている。
従って、主たるデータ格納領域が満杯になって次の分割ブロックに移行するときに、他のデータ格納領域の最新データを転送移動させる必要はあるが、他のデータ格納領域のために専用の分割ブロックを備えるよりは、一つの分割ブロックに対する一括消去回数を削減することができる特徴がある。
[Claim 2]
Among the divided blocks 113a to 113d, the total data capacity A of the main data storage area having the largest product of the number of sections N10, N20, and N300 and the data capacity C10, C20, and C300, and the other subordinate data storage areas The ratio B / (A + B) of the total data capacity B, which is the product of the number of sections and the data capacity, is smaller than the reciprocal of the number N of the divided blocks.
As described above, in relation to the invention of claim 2 of the present application, the ratio between the total data capacity of the main data storage area and the total data capacity of other subordinate data storage areas is related to the reciprocal of the number of divided blocks. Is limited.
Therefore, when the main data storage area becomes full and moves to the next divided block, it is necessary to transfer and move the latest data in the other data storage area, but a dedicated divided block for the other data storage area. Is characterized in that the number of batch erasures for one divided block can be reduced.

[請求項3対応]
前記不揮発データメモリ113Aの各分割ブロック113a〜113d内に設けられた前記データ格納領域は、第一・第二・第三定数領域S10・S20・S300又は少なくとも第一・第三定数領域S10・S300の複数領域に仕分けされている。
前記第一定数領域S10は、前記電子制御装置100Aの製造メーカが当該電子制御装置の出荷調整を行う時点において、出荷調整設備として準備された第一ツール105Aから転送書込みされる第一定数108aの格納領域である。
当該第一定数108aは、前記電子制御装置100A自体の機種区分に対応した制御定数又は前記入出力制御プログラム107Aの一部の選択番号情報、或いは当該電子制御装置内部の部品特性のバラツキ変動を補正するための校正定数、当該電子制御装置の製造番号の少なくとも一つを包含している。
前記第二定数領域S20は、前記電子制御装置100Aが組込まれる合体製品又は合体設備の製造メーカ又は設備管理部門が、当該合体製品・設備の試運転調整を行う時点において、検査調整設備として準備された第二ツール106Aから転送書込みされる第二定数108bの格納領域である。
当該第二定数108bは、前記電子制御装置100Aが組込まれる合体製品・設備の型名・機種に対応した制御定数又は前記入出力制御プログラム107Aの一部の選択番号情報、或いは前記電子制御装置100Aに接続された入出力部品の部品特性のバラツキ変動を補正するための校正定数の少なくとも一つを包含している。
前記第三定数領域S300は、前記電子制御装置100Aの実働運転中に於いて、前記RAMメモリ112Aに格納された第三定数108cが、少なくとも前記電子制御装置100Aの運転停止の直後又は運転中の適時に転送書込みされる第三定数の格納領域である。
当該第三定数108cは、前記電子制御装置100Aの内蔵部品又は外部接続部品の特性変動情報、或いは改善された運転特性を得るための学習情報、或いは異常発生履歴情報の少なくとも一つを包含している。
以上のとおり、本願の請求項3の発明に関連して、不揮発データメモリの各分割ブロック内に設けられたデータ格納領域は、第一・第二・第三定数領域又は少なくとも第一・第三定数領域の複数領域に仕分けされ、各定数領域のセクション数と当該セクションのデータ容量であるバイト数が予め決定されている。
従って、各定数領域空きセクションに対して、異なる時と場所においてデータの書込みを行うのが容易となると共に、各定数領域の書込み頻度が容易に推定され、各定数領域のセクション数とバイト数の決定が容易となる特徴がある。
[Corresponding to claim 3]
The data storage area provided in each of the divided blocks 113a to 113d of the non-volatile data memory 113A is the first / second / third constant area S10 / S20 / S300 or at least the first / third constant area S10 / S300. Sorted into multiple areas.
The first constant area S10 is a first constant that is transferred and written from the first tool 105A prepared as the shipping adjustment facility when the manufacturer of the electronic control device 100A performs the shipping adjustment of the electronic control device. This is the storage area 108a.
The first constant 108a is a control constant corresponding to the model classification of the electronic control device 100A itself, selection number information of a part of the input / output control program 107A, or a variation variation in component characteristics inside the electronic control device. It includes at least one of a calibration constant for correction and a serial number of the electronic control device.
The second constant region S20 was prepared as an inspection adjustment facility when the manufacturer or facility management department of the combined product or combined equipment in which the electronic control device 100A is incorporated performs trial operation adjustment of the combined product / equipment. This is a storage area for the second constant 108b transferred and written from the second tool 106A.
The second constant 108b is a control constant corresponding to the model name / model of the combined product / equipment in which the electronic control device 100A is incorporated, or a part of the selection number information of the input / output control program 107A, or the electronic control device 100A. At least one of calibration constants for correcting variations in the component characteristics of the input / output components connected to the.
In the third constant area S300, during the actual operation of the electronic control unit 100A, the third constant 108c stored in the RAM memory 112A is at least immediately after the operation stop of the electronic control unit 100A or during operation. This is a storage area for the third constant that is transferred and written in a timely manner.
The third constant 108c includes at least one of characteristic variation information of built-in parts or external connection parts of the electronic control unit 100A, learning information for obtaining improved operating characteristics, or abnormality occurrence history information. Yes.
As described above, in relation to the invention of claim 3 of the present application, the data storage area provided in each divided block of the nonvolatile data memory is the first, second, third constant area or at least the first, third, A plurality of constant areas are sorted, and the number of sections in each constant area and the number of bytes that is the data capacity of the section are determined in advance.
Therefore, it becomes easy to write data to each constant area empty section at different times and locations, and the writing frequency of each constant area can be easily estimated, and the number of sections and bytes of each constant area can be estimated. There is a feature that makes the decision easy.

[請求項4対応]
前記不揮発データメモリ113A;113Bの各分割ブロック内に設けられた前記データ格納領域は、前記第一・第二・第三定数領域S10・S20・S300又は第一・第三定数領域S10・S300に加えてチェック領域S0となる一つのセクションS1が付加されている。
当該チェック領域S0内の一つのセクションS1の前半領域には、前記分割ブロック113a〜113dの一括消去が行われてから、前記データ格納領域S10・S20・S300の全てのデータ格納領域内で少なくとも一つのセクションに対して有効なデータが書込まれた時点で所定の確定定数が書込まれると共に、どれか一つのデータ格納領域であっても当該データ格納領域内のどのセクションにも有効なデータが書込まれていない場合には前記確定定数が書込まれていないブランクブロックの状態となるものである。
以上のとおり、本願の請求項4の発明に関連して、不揮発データメモリの各分割ブロック内にはチェック領域が設けられ、当該チェック領域には分割ブロック内の全てのデータ格納領域に少なくとも一つの書込済セクションがあるかどうかの判別情報が格納されるようになっている。
従って、分割ブロックの移行過程では、次ブロックの全データ格納領域に最新データを書込んでから、当該次ブロックのチェック領域の書込みが行われるので、チェック領域がブランクでない場合は、全データ格納領域に最新データが書込まれたことが確認されると共に、多数の分割ブロックを有する場合にはチェック領域の内容を監視することによって容易に最新ブロックの検索が行えるようにすることができる特徴がある。
[Corresponding to claim 4]
The data storage area provided in each divided block of the nonvolatile data memory 113A; 113B is in the first / second / third constant area S10 / S20 / S300 or the first / third constant area S10 / S300. In addition, one section S1 serving as a check area S0 is added.
In the first half area of one section S1 in the check area S0, after the block blocks 113a to 113d are collectively erased, at least one of all the data storage areas of the data storage areas S10, S20, and S300 is present. When valid data is written to one section, a predetermined fixed constant is written, and even if any one data storage area, valid data is stored in any section in the data storage area. When it is not written, it becomes a state of a blank block in which the definite constant is not written.
As described above, in relation to the invention of claim 4 of the present application, a check area is provided in each divided block of the nonvolatile data memory, and at least one data storage area in the divided block is included in the check area. Information for determining whether or not there is a written section is stored.
Therefore, in the transition process of the divided block, since the latest data is written in the entire data storage area of the next block and then the check area of the next block is written, if the check area is not blank, the entire data storage area It is confirmed that the latest data has been written in, and when there are a large number of divided blocks, the latest block can be easily searched by monitoring the contents of the check area. .

[請求項5対応]
前記チェック領域S0内の一つのセクションS1の後半領域には、前記確定定数が書込まれた時点で当該分割ブロックに対する一括消去回数データが書込まれ、分割ブロックの移行が行われときには移行後の分割ブロックの一括消去回数は移行直前 の現在の分割ブロックのチェック領域に書込まれていた一括消去回数に1を加算した値となっている。
以上のとおり、本願の請求項5の発明に関連して、不揮発データメモリの各分割ブロック内のチェック領域には一括消去回数データが書込まれるようになっている。
従って、不揮発データメモリの寿命管理が容易に行えると共に、複数の分割ブロックの中では一括消去回数が大きい方の分割ブロックが最新の分割ブロックであると判別することができる特徴がある。
[Claim 5]
In the latter half of one section S1 in the check area S0, the batch erase count data for the divided block is written at the time when the definite constant is written, and when the divided block is transferred, The number of batch erases of the divided block is a value obtained by adding 1 to the number of batch erases written in the check area of the current divided block immediately before the transfer.
As described above, in relation to the invention of claim 5 of the present application, the batch erase count data is written in the check area in each divided block of the nonvolatile data memory.
Therefore, the lifetime management of the nonvolatile data memory can be easily performed, and among the plurality of divided blocks, it is possible to determine that the divided block having the larger number of batch erases is the latest divided block.

[請求項6対応]
前記チェック領域S0内には前記確定定数と一括消去回数データが書込まれる一つのセクションS1に加えて、少なくとも1個の予備セクションS2が付加されていて、分割ブロックの一括消去を行ったときに前記チェック領域S0内の一つのセクションS1の消去が行えなかった場合には、再度の一括消去を行ったうえでなお消去できなかったセクションに替わって前記予備セクションS2が適用されるものである。
以上のとおり、本願の請求項6の発明に関連して、不揮発データメモリの各分割ブロック内のチェック領域には一つのセクションが消去不良となった場合の予備セクションが設けられている。
従って、一つのセクションが不良となったことによって一つの分割ブロック全体が使用
不可能にならないようにすることができる特徴がある。
[Corresponding to claim 6]
In the check area S0, at least one spare section S2 is added in addition to one section S1 in which the fixed constant and the batch erase count data are written, and when the divided block is batch erased When one section S1 in the check area S0 cannot be erased, the spare section S2 is applied in place of the section that could not be erased after performing batch erase again.
As described above, in relation to the invention of claim 6 of the present application, a spare section is provided in the case where one section has an erasure defect in the check area in each divided block of the nonvolatile data memory.
Therefore, there is a feature that one whole divided block cannot be made unusable due to one section becoming defective.

[請求項7対応]
前記不揮発データメモリ113Aは、少なくとも3個以上の分割ブロック113a〜113dを備え、現在書込みが行われている分割ブロック113aの中のどこかのデータ格納領域S10・S20・S300(例えば第三定数領域S300)に於いて空セクションが無くなった場合には、まず次次順位の分割ブロック113cの一括消去を行い、続いて確認処理として次順位の分割ブロック113bの一括消去を行い、当該次順位の分割ブロック113bの該当データ格納領域(第三定数領域S300)の先頭セクションに新たなデータが書込まれ、元の分割ブロック113aの中の他のデータ格納領域(第一定数領域S10と第二定数領域S20)に書込まれていた最新のデータは、前記次順位の分割ブロック113bの該当データ格納領域(第一定数領域S10と第二定数領域S20)の先頭セクションに転送格納され、前記分割ブロック113a〜113dの移行に当たっては、一括消去済であるブランクブロックの前にあるブランクブロックの分割ブロックへ移行するようになっている。
以上のとおり、本願の請求項7の発明に関連して、不揮発データメモリは3個以上の分割ブロックを備え、分割ブロック間の移行時には次次順位の分割ブロックを先行して一括消去しておくようになっている。
従って、例えば次順位の分割ブロックに対するデータの書込み中に停電が発生し、再度電源がONされた状態に於いては、先に一括消去されてブランクブロックとなっている次々順位の分割ブロックを検索し、その前にある分割ブロックに対してデータの書込みを行えばよく、常に一個のブランクブロックを確保しておくことによって書込み対象となる分割ブロックの検索が容易となる特徴がある。
又、一括消去が未完了となった分割ブロックが次順位の分割ブロックとなった場合には確認処理としての一括消去が実施されてからデータの書込みが開始されるので、無効なセクションの介在を除去することができる特徴がある。
尚、一括消去済の分割ブロックを再度一括消去した場合には寿命に影響がないので、チェック領域に書込まれる一括消去回数データは当該分割ブロックにデータの書込みが行われ、チェック領域に対して確定定数が書込まれた時点で1回の一括消去として計上されるようになっている。
[Corresponding to claim 7]
The non-volatile data memory 113A includes at least three or more divided blocks 113a to 113d, and data storage areas S10, S20, and S300 (for example, a third constant area) somewhere in the divided block 113a currently being written. If there is no empty section in S300), first, the next-order divided block 113c is collectively erased, and then the next-order divided block 113b is collectively erased as a confirmation process. New data is written in the first section of the corresponding data storage area (third constant area S300) of the block 113b, and the other data storage areas (first constant area S10 and second constant) in the original divided block 113a are written. The latest data written in the area S20) is the corresponding data storage area of the divided block 113b of the next order. Transferred to and stored in the first section of the area (first constant area S10 and second constant area S20), and when the divided blocks 113a to 113d are transferred, the divided blocks of the blank block preceding the blank block that has been erased collectively It has come to move to.
As described above, in relation to the invention of claim 7 of the present application, the nonvolatile data memory has three or more divided blocks, and at the time of transition between the divided blocks, the next-order divided blocks are preliminarily erased in advance. It is like that.
Therefore, for example, when a power failure occurs while data is being written to the next-order divided block and the power is turned on again, the next-order divided block that has been erased all at once and becomes a blank block is searched. However, it suffices to write data to the previous divided block, and by always ensuring one blank block, it is easy to search for the divided block to be written.
In addition, if the divided block for which batch erasure has not been completed becomes the next-ranked divided block, data writing is started after the batch erasure is performed as a confirmation process. There are features that can be eliminated.
Note that if the batch erased divided block is erased once again, there is no effect on the life, so the batch erase count data written to the check area is written to the check block and the data is written to the check area. When a definite constant is written, it is counted as one batch erasure.

[請求項8対応]
前記不揮発プログラムメモリ111Aには、前記入出力制御プログラム107Aと、当該入出力制御プログラムに対して一定不変の固定定数を包含すると共に、前記不揮発データメモリ113Aに格納される前記第一定数108a又は第二定数108b又は第三定数108cに関連する参考定数107aが格納されている。
前記参考定数107aは、前記第一・第二・第三定数108a・108b・108cの中の変動情報の一部、又は運転特性の学習情報の一部に関する許容変動範囲である上下限値データと、前記第一・第二・第三定数の中の未確定定数に対して適用される初期設定データであり、当該初期値設定データは、少なくとも前記電子制御装置100Aの初回運転開始前に前記分割ブロック113a〜113dの一つの中の第一・第二・第三定数領域S10・S20・S300の先頭セクションに転送格納されるようになっている。
以上のとおり、本願の請求項8の発明に関連して、不揮発プログラムメモリには固定定数と参考定数とが格納されている。
従って、一定不変の固定定数が不揮発データメモリに格納されないので、不揮発データメモリの容量を削減することができると共に、電子制御装置の運転中に逐次定数が決定される特性変動情報や運転特性の学習情報については予め初期設定値を不揮発データメモリに格納して、次善の定数によって運転開始することができる特徴がある。
又、電子制御装置の運転中に逐次定数が決定される特性変動情報や運転特性の学習情報について、決定された定数が所定の上下限値以内であるかどうかを判定したり、RAMメモリに格納されるこれらの定数にエラーが発生していないかどうかを判定することができる特徴がある。
更に、第一・第二の定数の一部が未確定である場合に仮の定数として参考定数の中の初期値データを適用することができる特徴がある。
[Corresponding to claim 8]
The nonvolatile program memory 111A includes the input / output control program 107A and a fixed constant that does not change with respect to the input / output control program, and the first constant 108a stored in the nonvolatile data memory 113A or A reference constant 107a related to the second constant 108b or the third constant 108c is stored.
The reference constant 107a includes upper and lower limit value data that is an allowable fluctuation range relating to a part of the fluctuation information in the first, second, and third constants 108a, 108b, and 108c, or a part of the learning information of the driving characteristics. , Initial setting data applied to uncertain constants among the first, second, and third constants, and the initial value setting data is divided at least before the first operation of the electronic control unit 100A is started. The first, second, and third constant areas S10, S20, and S300 in one of the blocks 113a to 113d are transferred and stored.
As described above, in relation to the invention of claim 8 of the present application, the fixed constant and the reference constant are stored in the nonvolatile program memory.
Therefore, since a fixed constant that does not change is not stored in the nonvolatile data memory, it is possible to reduce the capacity of the nonvolatile data memory and to learn characteristic variation information and operational characteristics in which the constant is determined sequentially during operation of the electronic control unit. The information has a feature that an initial set value is stored in advance in a nonvolatile data memory, and operation can be started by a suboptimal constant.
In addition, for characteristic variation information for which constants are sequentially determined during operation of the electronic control unit and learning information for operating characteristics, it is determined whether the determined constant is within a predetermined upper and lower limit value, or stored in a RAM memory. It is possible to determine whether or not an error has occurred in these constants.
Further, there is a feature that the initial value data in the reference constant can be applied as a temporary constant when some of the first and second constants are uncertain.

[請求項9対応]
前記マイクロプロセッサ110Aは、前記不揮発データメモリ113Aに対する一括消去指令信号と、ブランクチェック指令信号を発生し、当該ブランクチェック指令を受信した前記不揮発データメモリ113Aは、少なくとも前記セクション単位で消去済であるか否かの判定情報を返信する。
前記マイクロプロセッサ110Aは、一括消去を行うことによって、消去済となったセクションは空セクションであると判定する。
前記マイクロプロセッサ110Aは、一括消去を行っても消去できなかったセクションがあるか、又は前記不揮発データメモリ113Aに対するデータの書込み中に停電が発生したことが原因となって、一つのセクションの中でデータの書込み部分と未書込み部分が混在していることが検出された場合には、当該セクションは無効セクションであると判定すると共に、セクション内にデータが存在して無効セクションではないセクションを有効セクションであると判定する。
前記マイクロプロセッサ110Aは、前記不揮発データメモリ113Aの読出しを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションに格納されたデータを読出する。
前記マイクロプロセッサ110Aは、前記不揮発データメモリ113Aの書込みを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションから逆方向に検索して初めて検出された空セクションにデータを書込みする。
以上のとおり、本願の請求項9の発明に関連して、マイクロプロセッサは不揮発データメモリに関して空セクション、無効セクション、有効セクションを判別し、各データ格納領域の最終セクションから順次検索して読出しセクションと書込みセクションを確定するように構成されている。
従って、無効セクションが存在しても、直ちに分割ブロックの更新や一括消去が行われず、空セクションを残さないようにしながら次の空セクションにデータが書込まれるので、不揮発データメモリの一括消去回数を削減することができる特徴がある。
又、不揮発データメモリの読出しにおいては無効セクションは除外して最新の有効セクションから読出しを行うことができる特徴がある。
[Corresponding to claim 9]
The microprocessor 110A generates a batch erase command signal and a blank check command signal for the nonvolatile data memory 113A, and the nonvolatile data memory 113A that has received the blank check command has been erased at least for each section. Returns the decision information of whether or not.
The microprocessor 110A determines that the erased section is an empty section by performing batch erase.
The microprocessor 110A has a section that could not be erased even after batch erase, or a power failure occurred while writing data to the nonvolatile data memory 113A. If it is detected that a data write part and a non-write part are mixed, it is determined that the relevant section is an invalid section, and a section that is not an invalid section because data exists in the section is a valid section. It is determined that
When reading data from the nonvolatile data memory 113A, the microprocessor 110A searches the effective section from the last section to the top section of each data storage area, and reads the data stored in the effective section detected for the first time.
When the microprocessor 110A writes to the nonvolatile data memory 113A, the microprocessor 110A searches for the valid section from the last section to the top section of each data storage area, and searches for the first time from the valid section detected for the first time. Write data to the designated empty section.
As described above, in relation to the invention of claim 9 of the present application, the microprocessor determines an empty section, an invalid section, and a valid section with respect to the nonvolatile data memory, and sequentially searches from the last section of each data storage area to obtain a read section. It is configured to determine the writing section.
Therefore, even if an invalid section exists, divided blocks are not updated or erased immediately, and data is written to the next empty section without leaving an empty section. There are features that can be reduced.
Further, in the reading of the nonvolatile data memory, there is a feature that the invalid section can be excluded and the latest valid section can be read.

[請求項10対応]
前記マイクロプロセッサ110Aは、前記不揮発データメモリ113Aの書込みを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションから逆方向に検索して初めて検出された空セクションにデータを書込みすると共に、当該空セクションに正しくデータの書込みが行えなかった場合には更に逆方向に検索して新たに検出された空セクションにデータを書込みする。
以上のとおり、本願の請求項10の発明に関連して、不揮発データメモリの各セクションに対する書込み失敗が発生したときには、次のセクションに書込むように構成されている。
従って、書込みセクションの一部にセルの異常があった場合でも、次のセクションに対して正しいデータを書込むことができる特徴がある。
[Corresponding to claim 10]
When the microprocessor 110A writes to the nonvolatile data memory 113A, the microprocessor 110A searches for the valid section from the last section to the top section of each data storage area, and searches for the first time from the valid section detected for the first time. The data is written in the empty section, and if data cannot be correctly written in the empty section, the search is further performed in the reverse direction and the data is written in the newly detected empty section.
As described above, in relation to the invention of claim 10 of the present application, when a write failure occurs in each section of the nonvolatile data memory, the next section is written.
Therefore, even if there is a cell abnormality in a part of the write section, there is a feature that correct data can be written in the next section.

[請求項11対応]
前記RAMメモリ112Aは、前記不揮発データメモリ113Aの消去・書込状態に対応したデータが書込まれるステータスメモリ112aを包含している。
前記ステータスメモリ112aには、少なくとも現在時点で書込が進行している最新の分割ブロック113a〜113dの識別番号情報と、当該最新分割ブロック内の各データ格納領域S10・S20・S300に於いて最新データが書込まれたセクション番号情報とが格納されている。
以上のとおり、本願の請求項11の発明に関連して、RAMメモリは不揮発データメモリの消去・書込状態に対応したデータが書込まれるステータスメモリを包含している。
従って、最新データが格納されている読出しセクション番号を検索したり、最新データを書込むための書込みセクション番号を検索するのは電源投入直後の一回だけ行えばよいので処理速度が高速となる特徴がある。
[Corresponding to claim 11]
The RAM memory 112A includes a status memory 112a into which data corresponding to the erase / write state of the nonvolatile data memory 113A is written.
In the status memory 112a, at least the identification number information of the latest divided blocks 113a to 113d in which writing is in progress at the present time, and the latest in each data storage area S10, S20, S300 in the latest divided block. Stores section number information in which data is written.
As described above, in relation to the invention of claim 11 of the present application, the RAM memory includes a status memory in which data corresponding to the erase / write state of the nonvolatile data memory is written.
Therefore, searching for the read section number in which the latest data is stored or searching for the write section number for writing the latest data needs to be performed only once immediately after the power is turned on. There is.

[請求項12対応]
前記マイクロプロセッサ110A、RAMメモリ112A、不揮発プログラムメモリ111A、不揮発データメモリ113Aは、外部電源101Aから運転用電源スイッチが閉路されたことによって付勢される電源リレー102の出力接点と、駆動電源端子102aとを介して給電される。
前記電源リレー102は、前記電源スイッチが開路されてから所定の遅延給電時間をおいて消勢されるものであると共に、前記RAMメモリ112Aは前記駆動電源端子102aに給電されていない期間においても補助電源によって給電されるか、又は前記駆動電源端子102aに給電されていない期間においては当該RAMメモリに対する給電も遮断される。
前記補助電源は補助電源端子101aに直接接続された外部バッテリ101Aであるか、又は内蔵バッテリである。
前記電源リレー102が消勢されている期間において、前記RAMメモリ112Aに対する給電が停止される場合、又は給電が持続される場合であっても前記補助電源の電圧が異常低下するか、又は補助電源回路が遮断されて、前記RAMメモリ112Aの記憶内容が消失したとき、又は前記ステータスメモリ112aの内容が異常であるときに、前記電源リレー102が付勢されて前記マイクロプロセッサ110Aが「運転開始」した時点、又は前記マイクロプロセッサ110Aの「実働運転中」に前記不揮発データメモリ113Aの中の少なくとも第三データ格納領域S300に書込まれた最新セクションの内容が前記RAMメモリ112Aのイメージメモリ領域108に転送され、前記マイクロプロセッサ110Aは前記イメージメモリ領域108に書込まれた第三定数108cに基づいて入出力の制御を行なうように構成されている。
以上のとおり、本願の請求項12の発明に関連して、RAMメモリの記憶状態を維持するための補助電源の有無に関わらず、RAMメモリの内容が異常であるとき、又はRAMメモリの内容が疑わしいときには不揮発データメモリに格納された第三定数を読出し使用することができる特徴がある。
又、運転中にRAMメモリに更新書込みされた学習データや異常発生履歴情報は、電源リレーの遅延給電期間に不揮発データメモリに転送退避することができる特徴がある。
[Corresponding to claim 12]
The microprocessor 110A, the RAM memory 112A, the non-volatile program memory 111A, and the non-volatile data memory 113A include an output contact of the power supply relay 102 that is energized when the operation power switch is closed from the external power supply 101A, and a drive power supply terminal 102a. Power is supplied via
The power supply relay 102 is turned off after a predetermined delay power supply time after the power switch is opened, and the RAM memory 112A is assisted even during a period in which the drive power supply terminal 102a is not supplied with power. The power supply to the RAM memory is also cut off during the period when the power is supplied by the power supply or the drive power supply terminal 102a is not supplied.
The auxiliary power supply is an external battery 101A directly connected to the auxiliary power supply terminal 101a or a built-in battery.
Even when the power supply to the RAM memory 112A is stopped or the power supply is continued during the period when the power supply relay 102 is turned off, the voltage of the auxiliary power supply abnormally decreases or the auxiliary power supply When the circuit is shut down and the stored contents of the RAM memory 112A are lost, or when the contents of the status memory 112a are abnormal, the power supply relay 102 is energized and the microprocessor 110A is "started". Or the contents of the latest section written in at least the third data storage area S300 in the non-volatile data memory 113A during the “actual operation” of the microprocessor 110A are stored in the image memory area 108 of the RAM memory 112A. The microprocessor 110A transfers the image memo. It is configured to perform the control of the input and output on the basis of the third constant 108c that is written in the area 108.
As described above, in relation to the invention of claim 12 of the present application, regardless of the presence or absence of an auxiliary power supply for maintaining the storage state of the RAM memory, the content of the RAM memory is abnormal or the content of the RAM memory is When in doubt, the third constant stored in the nonvolatile data memory can be read and used.
Further, the learning data and abnormality occurrence history information updated and written in the RAM memory during operation can be transferred and saved to the nonvolatile data memory during the delay power feeding period of the power relay.

実施の形態2.
(1)構成の詳細な説明
以下、この発明の実施の形態2による電子制御装置の構成を、その全体構成を示すブロック図である図16と、不揮発データメモリのセクション構成図である図17に基づいて詳細に説明する。尚、各図に於いて同一符号は同一又は相当部分を示している。
Embodiment 2. FIG.
(1) Detailed Description of Configuration Hereinafter, the configuration of an electronic control apparatus according to Embodiment 2 of the present invention will be described with reference to FIG. 16 which is a block diagram showing the overall configuration and FIG. 17 which is a section configuration diagram of a nonvolatile data memory. This will be described in detail. In the drawings, the same reference numerals indicate the same or corresponding parts.

先ず、図16に於いて、電子制御装置100Bは、マイクロプロセッサ110Bと不揮発プログラムメモリ111Bと揮発性のRAMメモリ112Bとフラッシュメモリである不揮発データメモリ113Bを主体として構成され、実態としては例えば工場設備に使用される特殊なプログラマブルコントローラを構成していて、一般商用交流電源である外部電源101Bから電源リレー102を介して給電されている。尚、電源リレー102は、図示しない電源スイッチが投入されると即時に閉路し、電源スイッチが遮断されると所定の遅延給電期間をおいてから開路するように構成されている。   First, in FIG. 16, an electronic control unit 100B is composed mainly of a microprocessor 110B, a nonvolatile program memory 111B, a volatile RAM memory 112B, and a nonvolatile data memory 113B which is a flash memory. A special programmable controller used in the system is configured, and power is supplied from an external power supply 101B, which is a general commercial AC power supply, via a power supply relay 102. The power relay 102 is configured to close immediately when a power switch (not shown) is turned on, and to open after a predetermined delay power feeding period when the power switch is turned off.

入力信号回路103は、図示しないコネクタを介して接続された開閉センサ或いはアナログセンサであり、当該入力信号回路103は、図示しない入力インタフェース回路と入力信号バス130を介してマイクロプロセッサ110Bに接続されている。出力信号回路104は、図示しないコネクタを介して接続された駆動機器或いは表示器等の電気負荷であり、当該出力信号回路104は図示しない出力インタフェース回路と出力信号バス140を介してマイクロプロセッサ110Bに接続されている。   The input signal circuit 103 is an open / close sensor or an analog sensor connected via a connector (not shown). The input signal circuit 103 is connected to the microprocessor 110B via an input interface circuit (not shown) and an input signal bus 130. Yes. The output signal circuit 104 is an electric load such as a driving device or a display connected via a connector (not shown). The output signal circuit 104 is connected to the microprocessor 110B via an output interface circuit (not shown) and an output signal bus 140. It is connected.

第一ツール105Bは、電子制御装置100Bの出荷調整・検査或いは保守点検時に、シリアル信号バス150を介してマイクロプロセッサ110Bに対して接続されるものであり、当該第一ツールは図示しないキーボード、表示器を備えた携帯機器となっている。第二ツール106Bは、第一ツール105Bに代わって電子制御装置100Bにシリアル接続され、当該第二ツール106Bは、電子制御装置100Bが組みまれる設備機器等の合体製品の製造メーカが当該合体製品の出荷調整を行う時点において出荷調整設備として準備されものであるか、或いは電子制御装置100Bを使用するユ−ザの設備管理部門が、設備の据付調整時点で使用ものであって、図示しないキーボード、表示器を備えた携帯機器となっている。尚、設備管理部門は合体製品の製造メーカとは同じ範疇のものであり、以下の説明では合体製品の製造メーカとして説明する。   The first tool 105B is connected to the microprocessor 110B via the serial signal bus 150 at the time of shipment adjustment / inspection or maintenance / inspection of the electronic control unit 100B. It is a portable device equipped with a vessel. The second tool 106B is serially connected to the electronic control device 100B in place of the first tool 105B, and the second tool 106B is manufactured by a manufacturer of a combined product such as a facility device in which the electronic control device 100B is assembled. A keyboard that is prepared as a shipping adjustment facility at the time of shipping adjustment or that is used by the facility management department of the user who uses the electronic control device 100B at the time of installation adjustment The portable device is equipped with a display. The facility management department is in the same category as the manufacturer of the combined product, and will be described as a manufacturer of the combined product in the following description.

第二ツール106Bには電子制御装置100Bにて使用される入出力制御制御プログラム107Bが格納されており、この入出力制御プログラム107Bは例えばシーケンス制御に適したユーザ言語が使用されている。マイクロプロセッサ110Bは、マスクROMメモリ111bによるシステムプログラムによって上記ユーザ言語でプログラムされた入出力制御プログラム107Bをマイクロプロセッサ110Bに適した機械言語に置き直して入出力制御を行なうように構成されている。   The second tool 106B stores an input / output control control program 107B used in the electronic control device 100B. The input / output control program 107B uses, for example, a user language suitable for sequence control. The microprocessor 110B is configured to perform input / output control by replacing the input / output control program 107B programmed in the user language by the system program in the mask ROM memory 111b with a machine language suitable for the microprocessor 110B.

このシステムプログラムは更に、第一ツール105B・第二ツール106Bとの交信制御プログラムを包含しており、マイクロプロセッサ110Bはこのシステムプログラムによって第一ツール105Bに格納されている第一定数108aを不揮発データメモリ113Bの第一定数領域S10へ転送する。マイクロプロセッサ110Bはまた、マスクROMメモリ111bによるシステムプログラムによって第二ツール106Bに格納されている入出力制御プログラム107Bを不揮発プログラムメモリ111Bへ転送すると共に、第二ツール106Bに格納されている第二定数108bを不揮発データメモリ113Bの第二定数領域S20へ転送する。   This system program further includes a communication control program for the first tool 105B and the second tool 106B, and the microprocessor 110B uses the system program to store the first constant 108a stored in the first tool 105B in a nonvolatile manner. The data is transferred to the first constant area S10 of the data memory 113B. The microprocessor 110B also transfers the input / output control program 107B stored in the second tool 106B to the non-volatile program memory 111B by the system program by the mask ROM memory 111b and also stores the second constant stored in the second tool 106B. 108b is transferred to the second constant area S20 of the nonvolatile data memory 113B.

尚、入出力制御制御プログラム107Bは、当該入出力制御プログラムに対して一定不変の固定定数を包含すると共に、不揮発データメモリ113Bに格納される後述の第一・第二・第三定数108a・108b・108cに関連する参考定数107aとを包含している。この参考定数107aは、第一・第二・第三定数108a・108b・108cの中の変動情報の一部、又は運転特性の学習情報の一部に関する許容変動範囲である上下限値データと、前記第一・第二・第三定数の中の未確定定数に対して適用される初期設定データであり、当該初期値設定データは少なくとも前記電子制御装置100Bの初回運転開始前に後述の分割ブロック113e・113fの一つの中の第一・第二・第三定数領域S10・S20・S300の先頭セクションに転送格納されるように構成されている。   The input / output control control program 107B includes fixed constants that do not change with respect to the input / output control program, and first, second, and third constants 108a and 108b described later that are stored in the nonvolatile data memory 113B. Includes a reference constant 107a associated with 108c. This reference constant 107a includes upper and lower limit value data that is an allowable fluctuation range regarding a part of the fluctuation information in the first, second, and third constants 108a, 108b, and 108c, or a part of the learning information of the driving characteristics, Initial setting data applied to uncertain constants among the first, second, and third constants, and the initial value setting data is a divided block described later at least before the first operation of the electronic control unit 100B is started. The first, second, and third constant areas S10, S20, and S300 in one of 113e and 113f are transferred and stored.

第一ツール105Bは、更に、不揮発データメモリ113Aに転送される第一定数108aを包含し、当該第一定数108aは、前記電子制御装置100A自体の機種区分に対応した制御定数又は入出力制御プログラム107Aの一部の選択番号情報、或いは当該電子制御装置内部の部品特性のバラツキ変動を補正するための校正定数、当該電子制御装置の製造番号などの制御装置固有情報となっている。   The first tool 105B further includes a first constant 108a transferred to the non-volatile data memory 113A. The first constant 108a is a control constant or input / output corresponding to the model classification of the electronic control unit 100A itself. It is control device specific information such as a part of the selection number information of the control program 107A, a calibration constant for correcting variation in the component characteristics in the electronic control device, and the manufacturing number of the electronic control device.

尚、第一定数108aを第一ツール105Bから不揮発データメモリ113Bへ転送するタイミングは、第一ツール105Bに設けられた転送用の操作キーを押した時点であるか、又は転送用の操作キーを押したときにはRAMメモリ112Bへ転送され、電子制御装置100Bに対する電源スイッチが開路されて、電源リレー102による遅延給電が行われているタイミングでRAMメモリ112Bから不揮発データメモリ113Bへ転送されるように構成されている。   The timing for transferring the first constant 108a from the first tool 105B to the nonvolatile data memory 113B is when the transfer operation key provided in the first tool 105B is pressed or the transfer operation key. Is transferred to the RAM memory 112B, the power switch for the electronic control device 100B is opened, and is transferred from the RAM memory 112B to the non-volatile data memory 113B at the timing when delayed power feeding is performed by the power relay 102. It is configured.

第二ツール106Bは、不揮発データメモリ113Bに転送される第二定数108bを包含し、当該第二定数108bは、電子制御装置100Bが組込まれる合体製品・設備の型名・機種に対応した制御定数、或いは前記電子制御装置100Bに接続された入出力部品の部品特性のバラツキ変動を補正する校正定数などの合体製品固有情報となっている。第二定数108bの転送タイミングは、第二ツール106Bの転送用操作キーの操作時点又は電子制御装置100Bの電源スイッチ遮断時点となっている。   The second tool 106B includes a second constant 108b transferred to the non-volatile data memory 113B. The second constant 108b is a control constant corresponding to the model name / model of the combined product / equipment in which the electronic control device 100B is incorporated. Alternatively, it is combined product specific information such as a calibration constant for correcting variations in the component characteristics of the input / output components connected to the electronic control unit 100B. The transfer timing of the second constant 108b is when the transfer operation key of the second tool 106B is operated or when the power switch of the electronic control device 100B is shut off.

不揮発プログラムメモリ111Bに格納された入出力制御プログラム107Bによって運転動作を行うマイクロプロセッサ110Bは、電子制御装置100Bの内蔵部品又は外部接続部品の特性変動情報、或いは改善された運転特性を得るための学習情報、或いは異常発生履歴情報等の第三定数112aを生成してRAMメモリ112Bに格納する。不揮発データメモリ113Bは、ブロック単位で一括消去が行われるフラッシュメモリであり、第1・第2の分割ブロック113e・113fを備えている。   The microprocessor 110B that performs the operation by the input / output control program 107B stored in the non-volatile program memory 111B learns to obtain characteristic variation information of internal components or external connection components of the electronic control unit 100B or improved operation characteristics. The third constant 112a such as information or abnormality occurrence history information is generated and stored in the RAM memory 112B. The non-volatile data memory 113B is a flash memory that is collectively erased in units of blocks, and includes first and second divided blocks 113e and 113f.

次に、図17には各分割ブロック内の構成が示されている。図17に於いて、分割ブロック113e・113fの夫々は、チェック領域S0と、データ格納領域となる第一・第二・第三定数領域S10・S20・S300を備えている。チェック領域S0は、例えば16バイトのデータ容量C0を持つセクションS1と、当該セクションS1が異常となった場合に代替使用される予備セクションS2によって構成されている。   Next, FIG. 17 shows a configuration in each divided block. In FIG. 17, each of the divided blocks 113e and 113f includes a check area S0 and first, second, and third constant areas S10, S20, and S300 that serve as data storage areas. The check area S0 is composed of, for example, a section S1 having a data capacity C0 of 16 bytes and a spare section S2 that is used as a substitute when the section S1 becomes abnormal.

第一定数領域S10は、例えば32バイトのデータ容量C10を持ち、セクション数N10[=4]であるセクションS11〜S14によって構成されていて、全体のデータ容量としては[C10×N10=32×4=128バイト]となっている。第二定数領域S20は、例えば96バイトのデータ容量C20を持ち、セクション数N20[=8]であるセクションS21〜S28によって構成されていて、全体のデータ容量としては[C20×N20=96×8=768]バイトとなっている。   The first constant area S10 has a data capacity C10 of 32 bytes, for example, and is composed of sections S11 to S14 having the number of sections N10 [= 4]. The total data capacity is [C10 × N10 = 32 × 4 = 128 bytes]. The second constant area S20 has a data capacity C20 of 96 bytes, for example, and is composed of sections S21 to S28 having the number of sections N20 [= 8]. The total data capacity is [C20 × N20 = 96 × 8]. = 768] bytes.

第三定数領域S300は、例えば384バイトのデータ容量C300を持ち、セクション数N300[=40]であるセクションS301〜S340によって構成されていて、全体のデータ容量としては[C300×N300=384×40=15360]バイトとなっている。   The third constant area S300 has a data capacity C300 of 384 bytes, for example, and is composed of sections S301 to S340 having the number of sections N300 [= 40]. The total data capacity is [C300 × N300 = 384 × 40]. = 15360] bytes.

各セクションは、書込/読出の最小単位となるものであり、各セクションには複数の個別データが所定順序で書込まれ、一つのセクションのデータ容量C10・C20・C300の値は書込みされる個別データの個数に対応したバイト数となっている。尚、各セクションには複数の個別データに加えて符号誤り検出のためのサムデータ、或いは誤り訂正符号データが付加されている。   Each section is a minimum unit of writing / reading, a plurality of individual data is written in a predetermined order in each section, and the values of the data capacities C10, C20, and C300 of one section are written. The number of bytes corresponds to the number of individual data. Each section is added with sum data for detecting a code error or error correcting code data in addition to a plurality of individual data.

又、この実施の形態2に於いては、分割ブロック113e・113fの中で、セクション数N10・N20・N300とデータ容量C10・C20・C300の積が最も大きい主たるデータ格納領域S300の合計データ容量A[=N300×C300=40×384=15360]と、その他の従となるデータ格納領域S0・S10・S20全体のセクション数とデータ容量の積である合計データ容量B[=N0×C0+N10×C10+N20×C20=16×2+32×4+96×8=928]との比率B/(A+B)[=928/(15360+928)=0.057]は前記分割ブロックの個数N[=2]の逆数よりも小さい値となっている。   In the second embodiment, the total data capacity of the main data storage area S300 having the largest product of the number of sections N10, N20, and N300 and the data capacity C10, C20, and C300 in the divided blocks 113e and 113f. A [= N300 × C300 = 40 × 384 = 15360] and the total data capacity B [= N0 × C0 + N10 × C10 + N20, which is the product of the number of sections and the data capacity of the other subordinate data storage areas S0, S10, S20. The ratio B / (A + B) [= 928 / (15360 + 928) = 0.057] with × C20 = 16 × 2 + 32 × 4 + 96 × 8 = 928] is smaller than the reciprocal of the number N [= 2] of the divided blocks. It has become.

図16に戻り、消去/書込制御回路114は、マイクロプロセッサ110Bから各種の指令信号COMnを受けて不揮発データメモリ113Bを制御し、不揮発データメモリ113Bから得られた回答信号ANSnをマイクロプロセッサ110Bに返信するように構成されている。指令信号COM1〜COM4の内容と回答信号ANS1〜ANS4の内容は図1の場合と同様である。   Returning to FIG. 16, the erase / write control circuit 114 receives various command signals COMn from the microprocessor 110B to control the nonvolatile data memory 113B, and sends the answer signal ANSn obtained from the nonvolatile data memory 113B to the microprocessor 110B. It is configured to reply. The contents of the command signals COM1 to COM4 and the contents of the answer signals ANS1 to ANS4 are the same as those in FIG.

RAMメモリ112Bは、イメージメモリ領域108を備え、このイメージメモリ108は第一ツール105Bから第一定数108aを不揮発データメモリ113Bへ転送するときの中継メモリとして使用されたり、第二ツール106Bから第二定数108bを不揮発データメモリ113Bへ転送するときの中継メモリとして使用されたり、マイクロプロセッサ110Bの運転中に生成される第三定数108cが格納されるように構成されている。   The RAM memory 112B includes an image memory area 108. The image memory 108 is used as a relay memory when transferring the first constant 108a from the first tool 105B to the nonvolatile data memory 113B, or from the second tool 106B. The third constant 108c is configured to be used as a relay memory when transferring the two constants 108b to the nonvolatile data memory 113B, or to store a third constant 108c generated during the operation of the microprocessor 110B.

RAMメモリ112Bは、不揮発データメモリ113Bの消去・書込状態に対応したデータが書込まれるステータスメモリ112bを包含し、このステータスメモリ112bには、少なくとも現在時点で書込が進行している最新の分割ブロック113e・113fの識別番号情報と、当該最新分割ブロック内の各データ格納領域S10・S20・S300において最新データが書込まれたセクション番号情報とが格納されるように構成されている。   The RAM memory 112B includes a status memory 112b into which data corresponding to the erase / write state of the nonvolatile data memory 113B is written. The status memory 112b includes at least the latest write that is currently being written. The identification number information of the divided blocks 113e and 113f and the section number information in which the latest data is written in the data storage areas S10, S20, and S300 in the latest divided block are stored.

電源回路109Bは、例えば商用交流電源である外部電源101Bから運転用電源スイッチが閉路されたことによって付勢される電源リレー102の出力接点と、駆動電源端子102aとを介して給電されると共に、内蔵バッテリ109bからRAMメモリ112Bに給電するように構成されている。電源回路109Bは、電源リレー102が付勢されているときには、例えばDC5Vの安定化された制御電圧Vccを発生して、マイクロプロセッサ110B、不揮発プログラムメモリ111B、RAMメモリ112B、不揮発データメモリ113Bに供給する。電源リレー102が付勢されていないときには、内蔵バッテリ109bがバックアップ電源としてRAMメモリ112Bに給電する。   The power supply circuit 109B is supplied with power via an output contact of the power supply relay 102 energized when the operation power switch is closed, for example, from an external power supply 101B, which is a commercial AC power supply, and the drive power supply terminal 102a. Power is supplied from the built-in battery 109b to the RAM memory 112B. When the power supply relay 102 is energized, the power supply circuit 109B generates a stabilized control voltage Vcc of, for example, DC 5V, and supplies it to the microprocessor 110B, the nonvolatile program memory 111B, the RAM memory 112B, and the nonvolatile data memory 113B. To do. When the power relay 102 is not energized, the built-in battery 109b supplies power to the RAM memory 112B as a backup power source.

電源リレー102が消勢されている期間に於いて補助電源となる内蔵バッテリ109bの電圧が異常低下するか、又は補助電源回路が断線して、RAMメモリ112Bの記憶内容が消失したとき、又はステータスメモリ112bの内容が異常であるときに、電源リレー102が付勢されてマイクロプロセッサ110Bが運転を開始したとき、又はマイクロプロセッサ110Bの運転中に不揮発データメモリ113Bの中の少なくとも第三データ格納領域S300に書込まれた最新セクションの内容がRAMメモリ112Bのイメージメモリ領域108に転送され、マイクロプロセッサ110Bはイメージメモリ領域108に書込まれた第三定数108cに基づいて入出力の制御を行なう。   When the voltage of the built-in battery 109b serving as the auxiliary power supply is abnormally reduced during the period when the power supply relay 102 is turned off, or the auxiliary power supply circuit is disconnected and the stored contents of the RAM memory 112B are lost, or the status At least the third data storage area in the non-volatile data memory 113B when the contents of the memory 112b are abnormal, when the power relay 102 is energized and the microprocessor 110B starts operation, or during the operation of the microprocessor 110B The contents of the latest section written in S300 are transferred to the image memory area 108 of the RAM memory 112B, and the microprocessor 110B controls input / output based on the third constant 108c written in the image memory area 108.

尚、実態としてはマイクロプロセッサ110Bが運転開始したときには、第三定数108cだけではなく、第一・第二定数108a・108bも不揮発データメモリ113BからRAMメモリ112Bへ転送読出しして、マイクロプロセッサ110BはRAMメモリ112Bのイメージメモリ領域108を参照しながら制御を行なうように構成されている。   Actually, when the microprocessor 110B starts operation, not only the third constant 108c but also the first and second constants 108a and 108b are transferred and read from the nonvolatile data memory 113B to the RAM memory 112B, and the microprocessor 110B Control is performed while referring to the image memory area 108 of the RAM memory 112B.

又、ステータスメモリ112bの異常としては、現在時点で書込が進行している最新の分割ブロック113e・113fの識別番号情報が格納されていないか、又は当該最新分割ブロック内の各データ格納領域S10・S20・S300に於いて最新データが書込まれたセクション番号情報が格納されていない状態であり、その他にRAMメモリ112B全体としての符号誤りによってビット情報の混入・欠落が発生している場合も含まれる。   Further, as an abnormality of the status memory 112b, the identification number information of the latest divided block 113e and 113f that is currently being written is not stored, or each data storage area S10 in the latest divided block is stored. In S20 and S300, the section number information in which the latest data is written is not stored, and there are cases where bit information is mixed or missing due to a code error in the RAM memory 112B as a whole. included.

(2)作用・動作の詳細な説明
次に、この発明の実施の形態2による電子制御装置の動作・作用について、実施の形態1との相違点を中心にして説明する。
(2) Detailed Description of Action / Operation Next, the operation / action of the electronic control apparatus according to the second embodiment of the present invention will be described with a focus on differences from the first embodiment.

先ず、前述の図3で示された消去・書込処理に関連して、図16・図17に示す実施の形態2では分割ブロックが2個となっており一方の分割ブロックの第一定数領域S10又は第二定数領域S20又は第三定数領域S300のどれかが満杯(空セクションが無い状態)になれば他方の分割ブロックへ移行し、移行直前において当該移行先の分割ブロックが一括消去されるように構成されている。   First, in relation to the erasing / writing process shown in FIG. 3 described above, in the second embodiment shown in FIGS. 16 and 17, there are two divided blocks, and the first constant of one of the divided blocks. If any of the area S10, the second constant area S20, or the third constant area S300 is full (there is no empty section), the process proceeds to the other divided block. It is comprised so that.

従って、分割ブロックの一括消去中に停電状態が発生しても、他方の分割ブロックに最新データが格納されているので、貴重なデータを消失することはない。又、チェック領域S0の扱いは実施の形態1に於ける図1・図2の場合と同じであり、全てのデータ格納領域S10・S20・S300に対するデータの書込みが完了してから確定定数と一括消去回数とが書込まれるように構成されている。   Therefore, even if a power failure occurs during the batch erasure of the divided blocks, the latest data is stored in the other divided block, so that valuable data is not lost. Further, the handling of the check area S0 is the same as in the case of FIGS. 1 and 2 in the first embodiment, and the definite constants and the batch are collectively written after the data writing to all the data storage areas S10, S20, S300 is completed. The number of times of erasure is written.

次に、図4により示された検索・読出処理に関連して、最新の分割ブロックはチェック領域S0内の一括消去回数が大きい方が最新ブロックであり、この最新ブロックの中の最新セクションは図4の場合と同様に最終セクション側から順次検索して決定されるように構成されている。又、図5で示した異常処理は、実施の形態2に於ける図16・図17のものにおいても同様である。   Next, in relation to the search / read processing shown in FIG. 4, the latest divided block is the latest block when the number of batch erases in the check area S0 is larger, and the latest section in this latest block is shown in FIG. In the same manner as in the case of No. 4, the last section side is sequentially searched and determined. Further, the abnormality process shown in FIG. 5 is the same as that in FIGS. 16 and 17 in the second embodiment.

一方、前述の実施の形態1に於ける図6から図15に至る制御フローに対応した実施の形態2に於ける制御プログラムは、マスクROMメモリ111bに格納されていて、分割ブロックの個数が少ないことに伴う最新ブロックの検索要領が上記のとおりに変更されている。特に、実施の形態1の場合と実施の形態2の場合とでは、図6の全体フローに関しては実行される順番が異なったものとなっている。   On the other hand, the control program in the second embodiment corresponding to the control flow from FIG. 6 to FIG. 15 in the first embodiment is stored in the mask ROM memory 111b, and the number of divided blocks is small. As a result, the search procedure for the latest block has been changed as described above. Particularly, in the case of the first embodiment and the case of the second embodiment, the order of execution is different with respect to the entire flow of FIG.

図6のフローチャートは、異なる時期で実行される各種の処理を合併して、概括表現したものである。先ず、第一の処理としてはステップ600aからステップ605a・ステップブロック700・ステップ600cが実行されて、第一定数108aが不揮発データメモリ113Bに転送され、この時点では第二・第三定数に対しては例えば架空の初期設定値としてデータ0の転送処理が行われる。   The flowchart of FIG. 6 is a general representation of a combination of various processes executed at different times. First, as the first processing, step 600a to step 605a, step block 700, and step 600c are executed, and the first constant 108a is transferred to the non-volatile data memory 113B. For example, data 0 is transferred as a fictitious initial setting value.

続く第二の処理としては、ステップ600aからステップブロック602b・ステップ603b・ステップ605b・ステップブロック700・ステップ600cが実行されて、入出力制御プログラム107Bの転送と、不揮発データメモリ113Bに対する第二定数108bの転送と、第二・第三定数に対する初期設定値の転送処理が行われる。   As subsequent second processing, step 600a to step block 602b, step 603b, step 605b, step block 700, and step 600c are executed to transfer the input / output control program 107B and the second constant 108b for the nonvolatile data memory 113B. And initial value transfer processing for the second and third constants.

同様に、第三の処理としては、ステップ600a・ステップ605c・ステップブロック700・ステップ600cが実行されて、不揮発データメモリ113Bに対する第三定数108cが転送されるが、第三定数108cに関してはステップ601・ステップ605c・ステップ606・ステップ609・ステップ601を循環しながら多数の個別データが順次RAMメモリ112Bに拡充格納され、電源スイッチが遮断された直後に行程ブロック700によって一括して不揮発データメモリ113Bへ転送されることになる。   Similarly, as the third processing, step 600a, step 605c, step block 700, and step 600c are executed, and the third constant 108c for the non-volatile data memory 113B is transferred. A large number of individual data are sequentially expanded and stored in the RAM memory 112B while circulating through step 605c, step 606, step 609, and step 601, and immediately after the power switch is cut off, the process block 700 collectively transfers to the nonvolatile data memory 113B. Will be transferred.

以上の説明では、RAMメモリ112Bは内蔵バッテリ109bでバックアップされているものとしたが、補助電源となる外部バッテリや内臓バッテリを持たず、RAMメモリ112Bのイメージメモリ領域108に格納されたデータは不揮発データメモリ113Bによって停電記憶され、運転開始時には必ず不揮発データメモリ113Bからイメージメモリ領域108へ転送復帰するようにしてもよい。   In the above description, the RAM memory 112B is backed up by the built-in battery 109b, but does not have an external battery or built-in battery as an auxiliary power source, and the data stored in the image memory area 108 of the RAM memory 112B is nonvolatile. The power failure may be stored by the data memory 113B, and the transfer may be restored from the nonvolatile data memory 113B to the image memory area 108 at the start of operation.

又、第一定数108aと第二定数108bとは、常に不揮発データメモリ113A・113Bから直接読出しするようにしてイメージメモリ108のデータを使用しないようにすることもできる。   Further, the first constant 108a and the second constant 108b can always be read directly from the non-volatile data memories 113A and 113B so that the data in the image memory 108 is not used.

以上の説明では、電源スイッチが遮断された直後にイメージメモリ領域108内の少なくとも第三定数108cが不揮発データメモリ113A・113Bに転送されるものとしたが、電子制御装置100A・100Bの実働運転中に於いて何らかの異常が発生した時点で第三定数108cを転送保存することも可能である。   In the above description, it is assumed that at least the third constant 108c in the image memory area 108 is transferred to the non-volatile data memories 113A and 113B immediately after the power switch is turned off, but the electronic control devices 100A and 100B are in actual operation. It is also possible to transfer and save the third constant 108c at the time when any abnormality occurs.

又、電子制御装置100A・100Bは、補助電源となる外部バッテリ又は内臓バッテリを備えると共に、低消費電力の計時カウンタを備え、電源遮断されていた時間を含めて経過時間の計測を行い、所定時間間隔で第三定数108cを不揮発データメモリ113A・113Bに転送退避することも可能である。この場合、転送退避は電源スイッチが遮断された後の遅延給電期間において実行され、前回の電源スイッチ遮断から今回の電源スイッチ遮断までの経過時間が短小である場合には、第三定数108cを不揮発データメモリ113A・113Bに転送退避するのを省略するようにしてもよい。   The electronic control devices 100A and 100B include an external battery or built-in battery serving as an auxiliary power source, and a time counter for low power consumption. The electronic control devices 100A and 100B measure the elapsed time including the time when the power is shut off, and the predetermined time It is also possible to transfer and save the third constant 108c to the nonvolatile data memories 113A and 113B at intervals. In this case, the transfer save is executed in the delay power supply period after the power switch is shut off, and if the elapsed time from the previous power switch shut-off to the current power switch shut-off is short, the third constant 108c is set to be non-volatile. You may make it abbreviate | omit transfer and evacuation to data memory 113A * 113B.

(3)実施形態2の要点及び特徴
[請求項1対応]
以上の説明で明らかなとおり、この発明の実施形態2による電子制御装置は、入力信号回路103と出力信号回路104とが接続されるマイクロプロセッサ110Bと、当該マイクロプロセッサと協働する不揮発プログラムメモリ111Bと揮発性のRAMメモリ112Bと不揮発データメモリ113Bとを備え、前記前記不揮発プログラムメモリ111Bに書込みされた入出力制御プログラム107Bと、前記不揮発データメモリ113Bに格納された制御定数の値と、前記入力信号回路103の信号状態に応動して前記出力信号回路104に制御出力信号を送出する電子制御装置100Bであって、
前記不揮発データメモリ113Bは、ブロック単位で個別に一括消去が可能な複数の分割ブロック113e・113fを有する不揮発性のメモリによって構成されている。
前記各分割ブロック113e・113fは更に、書込み頻度又は書込み時期が異なる複数のデータ格納領域S10・S20・S300に仕分けされている。
前記各データ格納領域S10・S20・S300は更に、読出/書込単位となる複数のセクションS11〜S14、S21〜S28、S301〜S340によって構成され、当該セクションには複数の個別データが所定順序で書込まれ、一つのセクションのデータ容量C10・C20・C300は書込みされる個別データの個数に対応したバイト数となっている。
前記複数のセクションS11〜S14、S21〜S28、S301〜S340には、対象となる分割ブロックの一括消去を行った後に順次新たなデータがセクション単位で格納され、当該対象分割ブロックの中のどれかのデータ格納領域が満杯となってデータが書込まれていない空セクションが無くなったときには、予め一括消去された他の分割ブロックの該当データ格納領域の先頭セクションに新たなデータが書込まれ、
元の分割ブロックの中の他のデータ格納領域に書込まれていた最新のデータは、新たな分割ブロックの該当データ格納領域の先頭セクションに転送格納される。
元の分割ブロック内のデータは、少なくとも前記新たな分割ブロックへの最新データの転送書込みが完了した後に一括消去されるものであると共に、前記データ格納領域S10・S20・S300内のセクション数N10・N20・N300は、書込み頻度の多いものほど多くのセクションが割り当てられている。
(3) Main points and features of the second embodiment [corresponding to claim 1]
As is apparent from the above description, the electronic control apparatus according to Embodiment 2 of the present invention includes a microprocessor 110B to which the input signal circuit 103 and the output signal circuit 104 are connected, and a nonvolatile program memory 111B that cooperates with the microprocessor. A volatile RAM memory 112B and a nonvolatile data memory 113B, an input / output control program 107B written in the nonvolatile program memory 111B, a value of a control constant stored in the nonvolatile data memory 113B, and the input An electronic control unit 100B for sending a control output signal to the output signal circuit 104 in response to a signal state of the signal circuit 103;
The non-volatile data memory 113B is constituted by a non-volatile memory having a plurality of divided blocks 113e and 113f that can be collectively erased in units of blocks.
Each of the divided blocks 113e and 113f is further divided into a plurality of data storage areas S10, S20, and S300 having different write frequencies or write times.
Each of the data storage areas S10, S20, and S300 is further composed of a plurality of sections S11 to S14, S21 to S28, and S301 to S340 serving as read / write units. The data capacity C10, C20, C300 of one section is the number of bytes corresponding to the number of individual data to be written.
In the plurality of sections S11 to S14, S21 to S28, and S301 to S340, new data is sequentially stored in section units after batch erasure of the target divided blocks, and any of the target divided blocks is stored. When the data storage area is full and there are no empty sections in which no data is written, new data is written to the first section of the corresponding data storage area of another divided block that has been erased in advance,
The latest data written in the other data storage area in the original divided block is transferred and stored in the head section of the corresponding data storage area in the new divided block.
The data in the original divided block is erased at least after the transfer and writing of the latest data to the new divided block is completed, and the number of sections in the data storage areas S10, S20, S300 is N10. N20 and N300 are assigned more sections as the writing frequency is higher.

[請求項2対応]
前記分割ブロック113e・113fの中で、セクション数N10・N20・N300とデータ容量C10・C20・C300の積が最も大きい主たるデータ格納領域の合計データ容量Aと、その他の従となるデータ格納領域全体のセクション数とデータ容量の積である合計データ容量Bとの比率[B/(A+B)]は、前記分割ブロックの個数Nの逆数よりも小さい値となっている。
以上のとおり、本願の請求項2の発明に関連して、主たるデータ格納領域の合計データ容量とその他の従となるデータ格納領域の合計データ容量との比率は分割ブロックの個数の逆数に関連して制限されている。
従って、主たるデータ格納領域が満杯になって次の分割ブロックに移行するときに、他のデータ格納領域の最新データを転送移動させる必要はあるが、他のデータ格納領域のために専用の分割ブロックを備えるよりは、一つの分割ブロックに対する一括消去回数を削減することができる特徴がある。
[Claim 2]
Among the divided blocks 113e and 113f, the total data capacity A of the main data storage area in which the product of the number of sections N10, N20, and N300 and the data capacity C10, C20, and C300 is the largest, and all other subordinate data storage areas The ratio [B / (A + B)] of the total data capacity B, which is the product of the number of sections and the data capacity, is smaller than the reciprocal of the number N of the divided blocks.
As described above, in relation to the invention of claim 2 of the present application, the ratio between the total data capacity of the main data storage area and the total data capacity of other subordinate data storage areas is related to the reciprocal of the number of divided blocks. Is limited.
Therefore, when the main data storage area becomes full and moves to the next divided block, it is necessary to transfer and move the latest data in the other data storage area, but a dedicated divided block for the other data storage area. Is characterized in that the number of batch erasures for one divided block can be reduced.

[請求項3対応]
前記不揮発データメモリ113Bの各分割ブロック113e・113f内に設けられた前記データ格納領域は、第一・第二・第三定数領域S10・S20・S300又は少なくとも第一・第三定数領域S10・S300の複数領域に仕分けされている。
前記第一定数領域S10は、前記電子制御装置100Bの製造メーカが当該電子制御装置の出荷調整を行う時点に於いて、出荷調整設備として準備された第一ツール105Bから転送書込みされる第一定数108aの格納領域である。
当該第一定数108aは、前記電子制御装置100B自体の機種区分に対応した制御定数、或いは当該電子制御装置内部の部品特性のバラツキ変動を補正するための校正定数、当該電子制御装置の製造番号の少なくとも一つを包含している。
前記第二定数領域S20は、前記電子制御装置100Bが組込まれる合体製品又は合体設備の製造メーカ又は設備管理部門が、当該合体製品・設備の試運転調整を行う時点に於いて、検査調整設備として準備された第二ツール106Bから転送書込みされる第二定数108bの格納領域である。
当該第二定数108bは、前記電子制御装置100Bが組込まれる合体製品・設備の型名・機種に対応した制御定数又は前記入出力制御プログラム107Bの一部の選択番号情報、或いは前記電子制御装置100Bに接続された入出力部品の部品特性のバラツキ変動を補正するための校正定数の少なくとも一つを包含している。
前記第三定数領域S300は、前記電子制御装置100Bの実働運転中に於いて、前記RAMメモリ112Bに格納された第三定数108cが、少なくとも前記電子制御装置100Bの運転停止の直後又は運転中の適時に転送書込みされる第三定数の格納領域である。
当該第三定数108cは、前記電子制御装置100Bの内蔵部品又は外部接続部品の特性変動情報、或いは改善された運転特性を得るための学習情報、或いは異常発生履歴情報の少なくとも一つを包含している。
以上のとおり、本願の請求項3に関連して、不揮発データメモリの各分割ブロック内に設けられたデータ格納領域は、第一・第二・第三定数領域又は少なくとも第一・第三定数領域の複数領域に仕分けされ、各定数領域のセクション数と当該セクションのデータ容量であるバイト数が予め決定されている。
従って、各定数領域空きセクションに対して、異なる時と場所においてデータの書込みを行うのが容易となると共に、各定数領域の書込み頻度が容易に推定され、各定数領域のセクション数とバイト数の決定が容易となる特徴がある。
[Claim 3]
The data storage areas provided in the respective divided blocks 113e and 113f of the nonvolatile data memory 113B are the first, second, and third constant areas S10, S20, and S300, or at least the first and third constant areas S10 and S300. Sorted into multiple areas.
The first constant area S10 is first written and transferred from the first tool 105B prepared as a shipping adjustment facility at the time when the manufacturer of the electronic control device 100B performs the shipping adjustment of the electronic control device. This is a storage area for the constant 108a.
The first constant 108a is a control constant corresponding to the model classification of the electronic control device 100B itself, a calibration constant for correcting variation in component characteristics in the electronic control device, or a serial number of the electronic control device. At least one of the following.
The second constant area S20 is prepared as an inspection adjustment facility when the manufacturer or facility management department of the united product or united equipment in which the electronic control unit 100B is incorporated performs trial operation adjustment of the united product / equipment. This is a storage area for the second constant 108b transferred and written from the second tool 106B.
The second constant 108b is a control constant corresponding to the model name / model of the combined product / equipment in which the electronic control device 100B is incorporated, or a part of the selection number information of the input / output control program 107B, or the electronic control device 100B. At least one of calibration constants for correcting variations in the component characteristics of the input / output components connected to the.
In the third constant area S300, during the actual operation of the electronic control unit 100B, the third constant 108c stored in the RAM memory 112B is at least immediately after the operation stop of the electronic control unit 100B or during operation. This is a storage area for the third constant that is transferred and written in a timely manner.
The third constant 108c includes at least one of characteristic variation information of built-in parts or external connection parts of the electronic control device 100B, learning information for obtaining improved driving characteristics, or abnormality occurrence history information. Yes.
As described above, in relation to claim 3 of the present application, the data storage area provided in each divided block of the nonvolatile data memory is the first / second / third constant area or at least the first / third constant area. The number of sections in each constant area and the number of bytes as the data capacity of the section are determined in advance.
Therefore, it becomes easy to write data to each constant area empty section at different times and locations, and the writing frequency of each constant area can be easily estimated, and the number of sections and bytes of each constant area can be estimated. There is a feature that makes the decision easy.

[請求項9対応]
前記マイクロプロセッサ110Bは、前記不揮発データメモリ113Bに対する一括消去指令信号とブランクチェック指令信号を発生し、当該ブランクチェック指令を受信した前記不揮発データメモリ113Bは、少なくとも前記セクション単位で消去済であるか否かの判定情報を返信する。
前記マイクロプロセッサ110Bは、一括消去を行うことによって、消去済となったセクションは空セクションであると判定する。
前記マイクロプロセッサ110Bは、一括消去を行っても消去できなかったセクションがあるか、又は前記不揮発データメモリ113Bに対するデータの書込み中に停電が発生したことが原因となって、一つのセクションの中でデータの書込み部分と未書込み部分が混在していることが検出された場合には、当該セクションは無効セクションであると判定すると共に、セクション内にデータが存在して無効セクションではないセクションを有効セクションであると判定する。
前記マイクロプロセッサ110Bは、前記不揮発データメモリ113Bの読出しを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションに格納されたデータを読出する。
[Corresponding to claim 9]
The microprocessor 110B generates a batch erase command signal and a blank check command signal for the nonvolatile data memory 113B, and whether or not the nonvolatile data memory 113B that has received the blank check command has been erased at least in the section unit. Is returned.
The microprocessor 110B determines that the erased section is an empty section by performing batch erase.
The microprocessor 110B has a section that could not be erased even after batch erase, or a power failure occurred while writing data to the nonvolatile data memory 113B. If it is detected that a data write part and a non-write part are mixed, it is determined that the relevant section is an invalid section, and a section that is not an invalid section because data exists in the section is a valid section. It is determined that
When reading data from the nonvolatile data memory 113B, the microprocessor 110B searches the valid section from the last section to the top section of each data storage area, and reads the data stored in the valid section detected for the first time.

前記マイクロプロセッサ110Bは、前記不揮発データメモリ113Bの書込みを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションから逆方向に検索して初めて検出された空セクションにデータを書込みする。
以上のとおり、本願の請求項9の発明に関連して、マイクロプロセッサは不揮発データメモリに関して空セクション、無効セクション、有効セクションを判別し、各データ格納領域の最終セクションから順次検索して読出しセクションと書込みセクションを確定するように構成されている。
従って、無効セクションが存在しても、直ちに分割ブロックの更新や一括消去が行われず、空セクションを残さないようにしながら次の空セクションにデータが書込まれるので、不揮発データメモリの一括消去回数を削減することができる特徴がある。
又、不揮発データメモリの読出しにおいては無効セクションは除外して最新の有効セクションから読出しを行うことができる特徴がある。
When writing to the nonvolatile data memory 113B, the microprocessor 110B searches for the valid section from the last section to the top section of each data storage area, and searches for the first time from the valid section detected for the first time. Write data to the designated empty section.
As described above, in relation to the invention of claim 9 of the present application, the microprocessor determines an empty section, an invalid section, and a valid section with respect to the nonvolatile data memory, and sequentially searches from the last section of each data storage area to obtain a read section. It is configured to determine the writing section.
Therefore, even if an invalid section exists, divided blocks are not updated or erased immediately, and data is written to the next empty section without leaving an empty section. There are features that can be reduced.
Further, in the reading of the nonvolatile data memory, there is a feature that the invalid section can be excluded and the latest valid section can be read.

100A、100B 電子制御装置 COMn 指令信号
101a 補助電源端子 ANSn 回答信号
102 電源リレー ADR ブロック番号又はセクション番号指定
102a 駆動電源端子 WRD 書込データ
103 入力信号回路 RDD 読出データ
104 出力信号回路 105A、105B 第一ツール
S0 チェック領域 106A、106B 第二ツール
S10 第一定数領域 107A、107B 入出力制御プログラム
S20 第二定数領域 107a、107b 参考定数
S300 第三定数領域 108 イメージメモリ領域
108a 第一定数 S1 セクション(チェック領域)
108b 第二定数 S2 予備セクション(チェック領域)
108c 第三定数 S11〜S14 セクション(第一定数領域)
109b 内蔵バッテリ S21〜S28 セクション(第二定数領域)
110A、110B マイクロプロセッサ
S301〜S340 セクション(第三定数領域)
111A、111B 不揮発プログラムメモリ
112A、112B RAMメモリ 112a、112b ステータスメモリ
113A、113B 不揮発データメモリ
113a、113e 第1ブロック 113b、113f 第2ブロック
113c 第3ブロック 113d 第4ブロック
100A, 100B Electronic control unit COMn Command signal 101a Auxiliary power supply terminal ANSn Response signal 102 Power relay ADR Block number or section number designation 102a Drive power supply terminal WRD Write data 103 Input signal circuit RDD Read data 104 Output signal circuit 105A, 105B First Tool S0 Check area 106A, 106B Second tool S10 First constant area 107A, 107B Input / output control program S20 Second constant area 107a, 107b Reference constant S300 Third constant area 108 Image memory area 108a First constant S1 section ( Check area)
108b Second constant S2 Reserved section (check area)
108c Third constant S11 to S14 section (first constant region)
109b Built-in battery S21 to S28 section (second constant area)
110A, 110B Microprocessors S301 to S340 Section (third constant area)
111A, 111B Nonvolatile program memory 112A, 112B RAM memory 112a, 112b Status memory 113A, 113B Nonvolatile data memory 113a, 113e First block 113b, 113f Second block 113c Third block 113d Fourth block

Claims (12)

入力信号回路と出力信号回路とが接続されるマイクロプロセッサと、当該マイクロプロセッサと協働する不揮発プログラムメモリと揮発性のRAMメモリと不揮発データメモリとを備え、前記不揮発プログラムメモリに書込みされた入出力制御プログラムと、前記不揮発データメモリに格納された制御定数の値と、前記入力信号回路の信号状態とに応動して前記出力信号回路に制御出力信号を送出する電子制御装置であって、
前記不揮発データメモリは、ブロック単位で個別に一括消去が可能な複数の分割ブロックを有する不揮発性のメモリにより構成され、
前記各分割ブロックは、書込み頻度又は書込み時期が異なる複数のデータ格納領域に仕分けされ、
前記各データ格納領域は、読出/書込単位となる複数のセクションにより構成され、当該セクションには複数の個別データが所定順序で書込まれ、一つの前記セクションのデータ容量は、書込みされる個別データの個数に対応したバイト数に構成され、
前記複数のセクションには、対象となる前記分割ブロックの一括消去を行った後に順次新たなデータがセクション単位で格納され、当該対象分割ブロックの中のどれかのデータ格納領域が満杯となってデータが書込まれていない空セクションが無くなったときには、予め一括消去された他の分割ブロックの該当データ格納領域の先頭セクションに新たなデータが書込まれ、
元の分割ブロックの中の他のデータ格納領域に書込まれていた最新のデータは、新たな分割ブロックの該当データ格納領域の先頭セクションに転送格納され、
元の分割ブロック内のデータは、少なくとも前記新たな分割ブロックへの最新データの転送書込みが完了した後に一括消去されるものであると共に、
前記データ格納領域内のセクション数は、書込み頻度の多いものほど多くのセクションが割り当てられている
ことを特徴とする電子制御装置。
A microprocessor to which an input signal circuit and an output signal circuit are connected, a nonvolatile program memory that cooperates with the microprocessor, a volatile RAM memory, and a nonvolatile data memory, and an input / output written in the nonvolatile program memory An electronic control device for sending a control output signal to the output signal circuit in response to a control program, a value of a control constant stored in the nonvolatile data memory, and a signal state of the input signal circuit,
The non-volatile data memory is constituted by a non-volatile memory having a plurality of divided blocks that can be collectively erased in units of blocks,
Each of the divided blocks is sorted into a plurality of data storage areas having different writing frequencies or writing times,
Each of the data storage areas is composed of a plurality of sections serving as read / write units. A plurality of individual data is written in a predetermined order in the section, and the data capacity of one section is individually written. It is composed of the number of bytes corresponding to the number of data,
In the plurality of sections, new data is sequentially stored in section units after batch erasure of the target divided blocks, and any data storage area in the target divided blocks becomes full. When there is no empty section to which no data has been written, new data is written to the top section of the corresponding data storage area of another divided block that has been erased in advance,
The latest data written in the other data storage area in the original divided block is transferred and stored in the first section of the corresponding data storage area in the new divided block.
The data in the original divided block is erased at least after the transfer writing of the latest data to the new divided block is completed, and
The number of sections in the data storage area is assigned to a larger number of sections as the frequency of writing increases.
前記分割ブロックの中でセクション数とデータ容量の積が最も大きい主たるデータ格納領域の合計データ容量Aとし、その他の従となるデータ格納領域全体のセクション数とデータ容量の積である合計データ容量Bとしたとき、前記合計データ容量Aと合計データ容量Bとの比率[B/(A+B)]は、前記分割ブロックの個数Nの逆数よりも小さい
ことを特徴とする請求項1に記載の電子制御装置。
The total data capacity A of the main data storage area where the product of the number of sections and the data capacity is the largest among the divided blocks, and the total data capacity B which is the product of the number of sections and the data capacity of the other subordinate data storage areas 2. The electronic control according to claim 1, wherein a ratio [B / (A + B)] of the total data capacity A and the total data capacity B is smaller than a reciprocal of the number N of the divided blocks. apparatus.
前記不揮発データメモリの各分割ブロック内に設けられた前記データ格納領域は、第一定数領域と第二定数領域と第三定数領域、又は少なくとも第一定数領域と第三定数領域、の複数領域に仕分けされ、前記第一定数領域は、前記電子制御装置の製造メーカが当該電子制御装置の出荷調整を行う時点に於いて、出荷調整設備として準備された第一ツールから転送書込みされる第一定数の格納領域であり、
当該第一定数は、前記電子制御装置自体の機種区分に対応した制御定数又は前記入出力制御プログラムの一部の選択番号情報又は当該電子制御装置内部の部品特性のバラツキ変動を補正するための校正定数と、前記電子制御装置の製造番号とのうちの少なくとも一つを包含し、
前記第二定数領域は、前記電子制御装置が組込まれる合体製品又は合体設備の製造メーカ又は設備管理部門が、当該合体製品又は合体設備の試運転調整を行う時点に於いて、検査調整設備として準備された第二ツールから転送書込みされる第二定数の格納領域であり、当該第二定数は、前記電子制御装置が組込まれる合体製品若しくは設備の型名、又は機種に対応した制御定数、又は前記入出力制御プログラムの一部の選択番号情報、又は前記電子制御装置に接続された入出力部品の部品特性のバラツキ変動を補正するための校正定数のうちの少なくとも一つを包含し、
前記第三定数領域は、前記電子制御装置の実働運転中に於いて、前記RAMメモリに格納された第三定数が、少なくとも前記電子制御装置の運転停止の直後又は運転中の適時に転送書込みされる第三定数の格納領域であり、当該第三定数は、前記電子制御装置の内蔵部品若しくは外部接続部品の特性変動情報、又は改善された運転特性を得るための学習情報、又は異常発生履歴情報のうちの少なくとも一つを包含している
ことを特徴とする請求項1又は請求項2に記載の電子制御装置。
The data storage area provided in each divided block of the nonvolatile data memory includes a plurality of first constant areas, second constant areas, and third constant areas, or at least a first constant area and a third constant area. The first constant area is transferred and written from a first tool prepared as a shipping adjustment facility at the time when the electronic control device manufacturer adjusts the shipping of the electronic control apparatus. Storage area for the first constant,
The first constant is used to correct variations in variation of the control constant corresponding to the model classification of the electronic control device itself, part of the input / output control program, or part characteristics inside the electronic control device. Including at least one of a calibration constant and a serial number of the electronic control unit;
The second constant area is prepared as an inspection and adjustment facility at the time when the manufacturer or facility management department of the united product or united facility in which the electronic control device is incorporated performs trial operation adjustment of the united product or united facility. This is a storage area for the second constant transferred and written from the second tool. The second constant is the type name of the combined product or equipment in which the electronic control unit is incorporated, the control constant corresponding to the model, or the input Including at least one of selection number information of a part of the output control program or a calibration constant for correcting variation in the component characteristics of the input / output components connected to the electronic control unit;
In the third constant area, during actual operation of the electronic control unit, the third constant stored in the RAM memory is transferred and written at least immediately after the electronic control unit is shut down or at an appropriate time during operation. The third constant is a storage area of the third constant, and the third constant is characteristic variation information of the internal component or external connection component of the electronic control device, learning information for obtaining improved operating characteristics, or abnormality occurrence history information. The electronic control device according to claim 1, wherein at least one of the electronic control devices is included.
前記不揮発データメモリの各分割ブロック内に設けられた前記データ格納領域は、前記第一定数領域と第二定数領域と第三定数領域とに加えてチェック領域となる一つのセクションが付加されており、
当該チェック領域内の一つのセクションの前半領域には、前記分割ブロックの一括消去が行われてから、前記データ格納領域の全てのデータ格納領域内で少なくとも一つのセクションに対して有効なデータが書込まれた時点で所定の確定定数が書込まれると共に、どれか一つのデータ格納領域であっても当該データ格納領域内のどのセクションにも有効なデータが書込まれていない場合には、前記確定定数が書込まれていないブランクブロックの状態となる
ことを特徴とする請求項3に記載の電子制御装置。
In addition to the first constant area, the second constant area, and the third constant area, the data storage area provided in each divided block of the non-volatile data memory has a section added as a check area. And
In the first half area of one section in the check area, after the divided blocks are collectively erased, valid data for at least one section is written in all the data storage areas of the data storage area. When a predetermined fixed constant is written at the time of loading, and no valid data is written in any section in the data storage area even in any one data storage area, 4. The electronic control device according to claim 3, wherein the electronic control device is in a blank block state in which a definite constant is not written.
前記チェック領域内の一つのセクションの後半領域には、前記確定定数が書込まれた時点で当該分割ブロックに対する一括消去回数データが書込まれ、
前記分割ブロックの移行が行われときには移行後の分割ブロックの一括消去回数は、移行直前の現在の分割ブロックのチェック領域に書込まれていた一括消去回数に「1」を加算した値である
ことを特徴とする請求項4に記載の電子制御装置。
In the second half area of one section in the check area, the batch erase count data for the divided block is written when the definite constant is written,
When the divided block is transferred, the number of batch erases of the divided blocks after the transfer is a value obtained by adding “1” to the number of batch erases written in the check area of the current divided block immediately before the transfer. The electronic control device according to claim 4.
前記チェック領域内には前記確定定数と一括消去回数データが書込まれる一つのセクションに加えて、少なくとも1個の予備セクションが付加されており、
前記分割ブロックの一括消去を行ったときに前記チェック領域内の一つのセクションの消去が行えなかった場合には、再度の一括消去を行った上でもなお消去できなかったセクションに替わって前記予備セクションが適用されるものである
ことを特徴とする請求項4又は請求項5に記載の電子制御装置。
In the check area, at least one spare section is added in addition to one section in which the definite constant and batch erase count data are written,
If one section in the check area cannot be erased when the divided block is erased at once, the spare section replaces the section that could not be erased even after performing batch erase again. The electronic control device according to claim 4, wherein: is applied.
前記不揮発データメモリは、少なくとも3個の分割ブロックを備え、
現在書込みが行われている分割ブロックの中のどこかのデータ格納領域に於いて空セクションが無くなった場合には、先ず次次順位の分割ブロックの一括消去を行い、続いて確認処理として次順位の分割ブロックの一括消去を行い、
当該次順位の分割ブロックの該当データ格納領域の先頭セクションに新たなデータが書込まれ、元の分割ブロックの中の他のデータ格納領域に書込まれていた最新のデータは、前記次順位の分割ブロックの該当データ格納領域の先頭セクションに転送格納され、
前記分割ブロックの移行に当たっては、一括消去済であるブランクブロックの前にあるブランクブロックの分割ブロックへ移行する
ことを特徴とする請求項4乃至6のうち何れか1項に記載の電子制御装置。
The nonvolatile data memory includes at least three divided blocks,
If there is no empty section in any data storage area in the divided block currently being written, the divided blocks of the next order are first erased at a time, and then the next order is used as a confirmation process. Erase all the divided blocks at once,
New data is written in the first section of the corresponding data storage area of the divided block of the next order, and the latest data written in the other data storage areas in the original divided block is the data of the next order. It is transferred and stored in the first section of the corresponding data storage area of the divided block,
The electronic control device according to any one of claims 4 to 6, wherein when the divided block is transferred, the divided block is transferred to a divided block of a blank block preceding a blank block that has been erased in a batch.
前記不揮発プログラムメモリには、前記入出力制御プログラムと当該入出力制御プログラムに対して一定不変の固定定数を包含すると共に、
前記不揮発データメモリに格納される前記第一定数又は第二定数又は第三定数に関連する参考定数が格納され、
前記参考定数は、前記第一定数と第二定数と第三定数との中の変動情報の一部又は運転特性の学習情報の一部に関する許容変動範囲である上下限値データと、前記第一定数と第二定数と第三定数との中の未確定定数に対して適用される初期設定データとのうちの少なくとも一方を含み、
当該初期値設定データは、少なくとも前記電子制御装置の初回運転開始前に前記分割ブロックの一つの中の第一定数領域と第二定数領域と第三定数領域との先頭セクションに転送格納される
ことを特徴とする請求項3に記載の電子制御装置。
The nonvolatile program memory includes the input / output control program and a fixed constant that does not change with respect to the input / output control program.
Reference constants related to the first constant, the second constant, or the third constant stored in the nonvolatile data memory are stored,
The reference constant includes upper and lower limit value data that is an allowable fluctuation range relating to a part of fluctuation information in the first constant, the second constant, and the third constant or a part of learning information of operation characteristics; Including at least one of initial setting data applied to an indeterminate constant among the first constant, the second constant, and the third constant;
The initial value setting data is transferred and stored in the first section of the first constant area, the second constant area, and the third constant area in one of the divided blocks at least before the first operation of the electronic control device is started. The electronic control device according to claim 3.
前記マイクロプロセッサは、前記不揮発データメモリに対する一括消去指令信号とブランクチェック指令信号を発生し、当該ブランクチェック指令を受信した前記不揮発データメモリは少なくとも前記セクション単位で消去済であるか否かの判定情報を返信し、
前記マイクロプロセッサは、一括消去を行うことによって、消去済となったセクションは空セクションであると判定し、
前記マイクロプロセッサは、一括消去を行っても消去できなかったセクションがあるか、又は前記不揮発データメモリに対するデータの書込み中に停電が発生したことが原因となって、一つのセクションの中でデータの書込み部分と未書込み部分が混在していることが検出された場合には、当該セクションは無効セクションであると判定すると共に、セクション内にデータが存在して無効セクションではないセクションを有効セクションであると判定し、
前記マイクロプロセッサは、前記不揮発データメモリの読出しを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションに格納されたデータを読出し、
前記マイクロプロセッサは、前記不揮発データメモリの書込みを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションから逆方向に検索して初めて検出された空セクションにデータを書込みする
ことを特徴とする請求項1又は請求項2に記載の電子制御装置。
The microprocessor generates a batch erase command signal and a blank check command signal for the nonvolatile data memory, and determines whether or not the nonvolatile data memory that has received the blank check command has been erased at least in the section unit. Reply
The microprocessor determines that the erased section is an empty section by performing batch erase,
The microprocessor has a section that could not be erased even after batch erasure, or because a power failure occurred while writing data to the nonvolatile data memory. When it is detected that a written part and an unwritten part are mixed, it is determined that the relevant section is an invalid section, and a section which is not an invalid section because data exists in the section is a valid section. And
When reading the nonvolatile data memory, the microprocessor searches the valid section from the last section to the first section of each data storage area, reads the data stored in the valid section detected for the first time,
The microprocessor searches the valid section from the last section to the top section of each data storage area when writing to the nonvolatile data memory, and searches for the first time from the valid section detected for the first time. 3. The electronic control device according to claim 1, wherein data is written in the empty section.
前記マイクロプロセッサは、前記不揮発データメモリの書込みを行うときには、各データ格納領域の最終セクションから先頭セクションにかけて前記有効セクションを検索し、初めて検出された有効セクションから逆方向に検索して初めて検出された空セクションにデータを書込みすると共に、当該空セクションに正しくデータの書込みが行えなかった場合には更に逆方向に検索して新たに検出された空セクションにデータを書込みする
ことを特徴とする請求項9に記載の電子制御装置。
The microprocessor searches the valid section from the last section to the top section of each data storage area when writing to the nonvolatile data memory, and searches for the first time from the valid section detected for the first time. The data is written in the empty section, and when data cannot be correctly written in the empty section, the search is further performed in the reverse direction and the data is written in the newly detected empty section. 9. The electronic control device according to 9.
前記RAMメモリは、前記不揮発データメモリの消去/書込状態に対応したデータが書込まれるステータスメモリを包含し、
前記ステータスメモリには、少なくとも現在時点で書込が進行している最新の分割ブロックの識別番号情報と、当該最新分割ブロック内の各データ格納領域に於いて最新データが書込まれたセクション番号情報とが格納されている
ことを特徴とする請求項9に記載の電子制御装置。
The RAM memory includes a status memory in which data corresponding to the erase / write state of the nonvolatile data memory is written,
In the status memory, at least the identification number information of the latest divided block that is currently being written, and the section number information in which the latest data is written in each data storage area in the latest divided block And the electronic control device according to claim 9.
前記マイクロプロセッサと、RAMメモリと、不揮発プログラムメモリと、不揮発データメモリとは、外部電源から運転用電源スイッチが閉路されたことによって付勢される電源リレーの出力接点と駆動電源端子とを介して給電され、
前記電源リレーは、前記電源スイッチが開路されてから所定の遅延給電時間をおいて消勢されるものであると共に、
前記RAMメモリは、前記駆動電源端子に給電されていない期間に於いても補助電源によって給電されるか、又は前記駆動電源端子に給電されていない期間においては当該RAMメモリに対する給電も遮断され、
前記補助電源は、補助電源端子に直接接続された外部バッテリであるか、又は内蔵バッテリであり、
前記電源リレーが消勢されている期間に於いて、前記RAMメモリに対する給電が停止される場合、又は給電が持続される場合であっても前記補助電源の電圧が異常低下するか、又は補助電源回路が遮断されて、前記RAMメモリの記憶内容が消失したとき、又は前記ステータスメモリの内容が異常であるときに、前記電源リレーが付勢されて前記マイクロプロセッサが運転開始した時点、又は前記マイクロプロセッサの実働運転中に前記不揮発データメモリの中の少なくとも第三データ格納領域に書込まれた最新セクションの内容が前記RAMメモリのイメージメモリ領域に転送され、
前記マイクロプロセッサは、前記イメージメモリ領域に書込まれた第三定数に基づいて入出力の制御を行なう
ことを特徴とする請求項11に記載の電子制御装置。
The microprocessor, the RAM memory, the non-volatile program memory, and the non-volatile data memory are connected via an output contact of a power supply relay and a drive power supply terminal that are energized when an operation power switch is closed from an external power source. Powered,
The power relay is de-energized after a predetermined delay power feeding time after the power switch is opened,
The RAM memory is powered by an auxiliary power source even during a period when power is not supplied to the driving power supply terminal, or power supply to the RAM memory is also interrupted during a period when power is not supplied to the driving power supply terminal,
The auxiliary power supply is an external battery directly connected to an auxiliary power supply terminal or an internal battery,
Even when the power supply to the RAM memory is stopped or the power supply is continued during the period when the power supply relay is turned off, the voltage of the auxiliary power supply is abnormally reduced, or the auxiliary power supply When the circuit is shut down and the stored contents of the RAM memory are lost, or when the contents of the status memory are abnormal, the power relay is energized and the microprocessor starts operating, or the micro The content of the latest section written in at least the third data storage area in the nonvolatile data memory during the actual operation of the processor is transferred to the image memory area of the RAM memory,
The electronic control device according to claim 11, wherein the microprocessor performs input / output control based on a third constant written in the image memory area.
JP2009016665A 2009-01-28 2009-01-28 Electronic control unit Active JP4647010B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2009016665A JP4647010B2 (en) 2009-01-28 2009-01-28 Electronic control unit
DE102009038641.6A DE102009038641B4 (en) 2009-01-28 2009-08-24 control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009016665A JP4647010B2 (en) 2009-01-28 2009-01-28 Electronic control unit

Publications (2)

Publication Number Publication Date
JP2010176280A JP2010176280A (en) 2010-08-12
JP4647010B2 true JP4647010B2 (en) 2011-03-09

Family

ID=42309052

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009016665A Active JP4647010B2 (en) 2009-01-28 2009-01-28 Electronic control unit

Country Status (2)

Country Link
JP (1) JP4647010B2 (en)
DE (1) DE102009038641B4 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5643708B2 (en) * 2011-03-30 2014-12-17 株式会社ケーヒン Electronic control unit
JP5930940B2 (en) * 2012-10-31 2016-06-08 株式会社ケーヒン Electronic control device for vehicle
CN103699030B (en) * 2013-12-06 2016-04-06 中联重科股份有限公司 Running parameter save set, the system and method for the working mechanism of engineering machinery
CN114637469A (en) * 2022-03-21 2022-06-17 上海美仁半导体有限公司 Data read-write method, system, medium and equipment of Flash memory

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007172447A (en) * 2005-12-26 2007-07-05 Jatco Ltd Flash memory
JP2007179460A (en) * 2005-12-28 2007-07-12 Denso Corp Electronic control device
JP2008146254A (en) * 2006-12-07 2008-06-26 Sony Corp Storage device, computer system and data processing method for storage device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002007221A (en) * 2000-06-26 2002-01-11 Matsushita Electric Ind Co Ltd Method for increasing write guarantee frequency of flash memory
JP3969494B2 (en) * 2004-08-31 2007-09-05 三菱電機株式会社 In-vehicle electronic control unit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007172447A (en) * 2005-12-26 2007-07-05 Jatco Ltd Flash memory
JP2007179460A (en) * 2005-12-28 2007-07-12 Denso Corp Electronic control device
JP2008146254A (en) * 2006-12-07 2008-06-26 Sony Corp Storage device, computer system and data processing method for storage device

Also Published As

Publication number Publication date
DE102009038641A1 (en) 2010-08-05
JP2010176280A (en) 2010-08-12
DE102009038641B4 (en) 2015-05-21

Similar Documents

Publication Publication Date Title
US7246268B2 (en) Method and apparatus for dynamic degradation detection
EP1564755B1 (en) Data management apparatus and method of flash memory
CN101763894B (en) Semiconductor storage device and storage controlling method
US6883060B1 (en) Microcomputer provided with flash memory and method of storing program into flash memory
KR101660985B1 (en) Semiconductor memory device and method of operation the same
EP1403771A1 (en) Non-volatile memory control method
EP1683027A2 (en) Internal maintenance schedule request for non-volatile memory system
US20090187305A1 (en) Method of detecting manipulation of a programmable memory device of a digital controller
CN101246738A (en) Memory system with backup circuit and programming method
JP4647010B2 (en) Electronic control unit
JP2006294143A (en) Nonvolatile semiconductor memory apparatus
US8667348B2 (en) Data writing method for non-volatile memory module and memory controller and memory storage apparatus using the same
EP2977907B1 (en) Data storage device, method for storing data, and onboard control device
CN107766174A (en) Electronic-controlled installation and its information storage means
JP5660521B2 (en) Nonvolatile semiconductor memory device and memory management method
JPS623516B2 (en)
JP4153535B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP6040895B2 (en) Microcomputer and non-volatile memory block management method
JPH0817192A (en) Position storage method by flash memory
JP2001056787A (en) Device and method for write for memory
EP2916232B1 (en) Electronic control device for vehicle
US20060123205A1 (en) Control data storage apparatus and process
CN117573155B (en) Product information processing method and chip
CN103064756A (en) Electronic system and memorizer management method thereof
CN114490453A (en) EEPROM data storage protection control method, computer storage medium and vehicle

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101116

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101207

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131217

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4647010

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131217

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250