JP2006178829A - Microcomputer - Google Patents

Microcomputer Download PDF

Info

Publication number
JP2006178829A
JP2006178829A JP2004372996A JP2004372996A JP2006178829A JP 2006178829 A JP2006178829 A JP 2006178829A JP 2004372996 A JP2004372996 A JP 2004372996A JP 2004372996 A JP2004372996 A JP 2004372996A JP 2006178829 A JP2006178829 A JP 2006178829A
Authority
JP
Japan
Prior art keywords
data
program
memory
patch
flash
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.)
Withdrawn
Application number
JP2004372996A
Other languages
Japanese (ja)
Inventor
Isao Sasazaki
勲 笹▲崎▼
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2004372996A priority Critical patent/JP2006178829A/en
Publication of JP2006178829A publication Critical patent/JP2006178829A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To correct a fault part even when the fault part is generated in a program which is stored in a memory, and to allow the memory storing the program to have an initial value. <P>SOLUTION: A read-only first memory 12 receives a user program from an outer terminal 10a and previously stores the program to be stored in an internal memory 15. A rewritable second memory 13 stores patch data where the fault part of the program is corrected. A data selecting circuit 14 inputs the program and patch data, which are outputted by an address signal, and generates the program with the fault part corrected therein. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、マイクロコンピュータに関し、特に、ユーザプログラムを内部に記憶するマイクロコンピュータに関する。   The present invention relates to a microcomputer, and more particularly to a microcomputer that stores a user program therein.

マイクロコンピュータに内蔵されている内部メモリに様々なユーザプログラムを格納することで、マイクロコンピュータに様々な処理を実行させることができる。
このユーザプログラムを変更する場合、UART(Universal Asynchronous Receiver Transmitter)を利用し、内部メモリに新しいユーザプログラムをシリアル通信にてダウンロードして、書き込んでいる。この場合、ROM(Read Only Memory)に記憶されているプログラムを実行することで、ユーザプログラムを書き込んでいる(例えば、特許文献1)。
By storing various user programs in an internal memory built in the microcomputer, the microcomputer can execute various processes.
When changing this user program, a new user program is downloaded to the internal memory by serial communication using a UART (Universal Asynchronous Receiver Transmitter). In this case, a user program is written by executing a program stored in a ROM (Read Only Memory) (for example, Patent Document 1).

しかし、マイクロコンピュータを製造した時点において、ROMに記憶されているプログラムに不具合箇所が存在する場合、ROMは読み出し専用のメモリであるので、不具合箇所を修正できない。よって、内部メモリに新しいユーザプログラムを書き込めない。   However, when a defective part exists in the program stored in the ROM at the time of manufacturing the microcomputer, the defective part cannot be corrected because the ROM is a read-only memory. Therefore, a new user program cannot be written in the internal memory.

この対策として、ROMを、書換可能なフラッシュメモリに置き換える方法が考えられる。なお、ユーザプログラムを書き込むプログラムがROMに記憶されるのに対し、ユーザプログラムがROM、RAM(Random Access Memory)及びEAROM(Electrically Alterable Read Only Memory)に記憶される方法も提案されている(例えば、特許文献2)。
特開平10−50086号公報 特開平6−131171号公報
As a countermeasure, a method of replacing the ROM with a rewritable flash memory can be considered. In addition, while a program for writing a user program is stored in ROM, a method in which a user program is stored in ROM, RAM (Random Access Memory) and EAROM (Electrically Alterable Read Only Memory) has also been proposed (for example, Patent Document 2).
Japanese Patent Laid-Open No. 10-50086 JP-A-6-131171

しかし、ROMは予めプログラムを記憶するのに対してフラッシュメモリは初期値を持たないので、マイクロコンピュータを製造した時点において、フラッシュメモリに対して時間をかけてプログラムを書き込む必要がある。よって、この方法は実用的でない。   However, the ROM stores the program in advance, whereas the flash memory does not have an initial value. Therefore, when the microcomputer is manufactured, it is necessary to write the program over the flash memory over time. Therefore, this method is not practical.

本発明は、このような点に鑑みてなされたものであり、マイクロコンピュータを製造した時点において、メモリに記憶されたプログラムに不具合箇所が発生した場合でも不具合箇所を修正でき、かつ、プログラムを記憶するメモリが初期値を持つマイクロコンピュータを提供することを目的とする。   The present invention has been made in view of the above points, and when a microcomputer has been manufactured, even if a defective part occurs in a program stored in a memory, the defective part can be corrected and the program is stored. An object of the present invention is to provide a microcomputer having an initial value for a memory to be used.

本発明では、上記課題を解決するために、図1に示すように、ユーザプログラムを内部に記憶するマイクロコンピュータ10において、プログラムを予め記憶する読み出し専用の第1のメモリ12と、第1のメモリ12と同一のアドレス空間を有し、第1のメモリ12と同一のアドレス信号が入力される、プログラムの不具合箇所を修正したパッチデータを記憶する書換可能な第2のメモリ13と、アドレス信号によって出力されるプログラムとパッチデータとが入力され、第2のメモリ13のパッチデータの記憶内容に基づいて一方を出力するデータ選択回路14と、を有するマイクロコンピュータ10が提供される。   In the present invention, in order to solve the above problem, as shown in FIG. 1, in a microcomputer 10 that stores a user program, a read-only first memory 12 that stores the program in advance and a first memory 12 has the same address space as that of the first memory 12 and is inputted with the same address signal. The rewritable second memory 13 for storing patch data in which a defective portion of the program is corrected, and the address signal A microcomputer 10 having a data selection circuit 14 that receives a program and patch data to be output and outputs one based on the stored contents of the patch data in the second memory 13 is provided.

このようなマイクロコンピュータ10によれば、読み出し専用の第1のメモリ12により、プログラムが予め記憶される。また、第1のメモリ12と同一のアドレス空間を有し、第1のメモリ12と同一のアドレス信号が入力される書換可能な第2のメモリ13により、プログラムの不具合箇所を修正したパッチデータが記憶される。そして、データ選択回路14に対して、アドレス信号によって出力されるプログラムとパッチデータとが入力され、データ選択回路14により、第2のメモリ13のパッチデータの記憶内容に基づいて一方が出力され、不具合箇所が修正されたプログラムが生成される。   According to such a microcomputer 10, the program is stored in advance by the read-only first memory 12. Further, patch data in which a defective part of the program is corrected is obtained by a rewritable second memory 13 having the same address space as that of the first memory 12 and receiving the same address signal as that of the first memory 12. Remembered. Then, the program and patch data output by the address signal are input to the data selection circuit 14, and one is output from the data selection circuit 14 based on the storage contents of the patch data in the second memory 13, A program with a corrected defect is generated.

また、本発明では、上記課題を解決するために、ユーザプログラムを内部に記憶するマイクロコンピュータにおいて、第1のデータを予め記憶する読み出し専用の第1のメモリと、第1のメモリと同一のアドレス空間を有し、第1のメモリと同一のアドレス信号が入力される、第2のデータを記憶する書換可能な第2のメモリと、アドレス信号によって出力される第1のデータと第2のデータとによって、外部からユーザプログラムを受信し、内部メモリに格納するプログラムを生成するプログラム生成回路と、を有するマイクロコンピュータが提供される。   In the present invention, in order to solve the above-mentioned problem, in a microcomputer that stores a user program therein, a read-only first memory that stores first data in advance and an address that is the same as the first memory A rewritable second memory for storing second data, having a space and receiving the same address signal as the first memory, and the first data and the second data output by the address signal A microcomputer having a program generation circuit that receives a user program from the outside and generates a program to be stored in an internal memory is provided.

このようなマイクロコンピュータによれば、読み出し専用の第1のメモリにより、第1のデータが予め記憶される。また、第1のメモリと同一のアドレス空間を有し、第1のメモリと同一のアドレス信号が入力される書換可能な第2のメモリにより、第2のデータが記憶される。そして、プログラム生成回路により、アドレス信号によって出力される第1のデータと第2のデータとによって内部メモリに格納するプログラムが生成され、外部からユーザプログラムを受信することができる。   According to such a microcomputer, the first data is stored in advance by the read-only first memory. The second data is stored in a rewritable second memory that has the same address space as the first memory and receives the same address signal as the first memory. The program generation circuit generates a program to be stored in the internal memory using the first data and the second data output by the address signal, and can receive the user program from the outside.

本発明では、読み出し専用の第1のメモリのプログラムと書換可能な第2のメモリのパッチデータとが入力され、第2のメモリのパッチデータの記憶内容に基づいて一方を出力するデータ選択回路により、不具合箇所が修正されたプログラムが生成されるようにした。   In the present invention, the data selection circuit that inputs the read-only first memory program and the rewritable second memory patch data and outputs one based on the stored contents of the second memory patch data. , The program where the defect part was corrected was generated.

このようにすると、マイクロコンピュータを製造した時点において、読み出し専用の第1のメモリに記憶されたプログラムに不具合箇所が発生した場合でも不具合箇所を修正でき、かつ、プログラムを記憶する読み出し専用の第1のメモリが初期値を持つことができる。   In this way, even when a defective part occurs in the program stored in the read-only first memory at the time of manufacture of the microcomputer, the defective part can be corrected and the read-only first memory for storing the program is stored. Memory can have an initial value.

また、本発明では、読み出し専用の第1のメモリの第1のデータと、書換可能な第2のメモリの第2のデータとによってプログラムを生成するプログラム生成回路により、不具合箇所が修正されたプログラムが生成されるようにした。   Further, according to the present invention, a program in which a defective portion is corrected by a program generation circuit that generates a program from the first data of the read-only first memory and the second data of the rewritable second memory. Was generated.

このようにすると、マイクロコンピュータを製造した時点において、読み出し専用の第1のメモリに記憶された第1のデータに不具合箇所が発生した場合でも不具合箇所を修正でき、かつ、第1のデータを記憶する読み出し専用の第1のメモリが初期値を持つことができる。   In this way, even when a defective part occurs in the first data stored in the read-only first memory when the microcomputer is manufactured, the defective part can be corrected and the first data is stored. The read only first memory can have an initial value.

以下、本発明の実施の形態を図面を参照して説明する。まず、本発明の概念について説明し、その後、本発明の実施の形態の具体的な内容について説明する。
以下、本発明の概念について説明する。図1は、本発明の概念図である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. First, the concept of the present invention will be described, and then the specific contents of the embodiment of the present invention will be described.
The concept of the present invention will be described below. FIG. 1 is a conceptual diagram of the present invention.

本発明に係るマイクロコンピュータ10は、CPU(Central Processing Unit)11、第1のメモリ12、第2のメモリ13、データ選択回路14及び内部メモリ15から構成される。   A microcomputer 10 according to the present invention includes a CPU (Central Processing Unit) 11, a first memory 12, a second memory 13, a data selection circuit 14, and an internal memory 15.

マイクロコンピュータ10のCPU11は、ユーザプログラムに従ってマイクロコンピュータ10の内部装置及び外部装置を制御する。このユーザプログラムは、ユーザプログラムダウンロードモードを設定した時に、外部端子10aから受信されて内部メモリ15に格納される。このユーザプログラムを内部メモリ15に書き込む際に使用するプログラムは、読み出し専用の第1のメモリ12及び書換可能な第2のメモリ13から出力される。   The CPU 11 of the microcomputer 10 controls the internal device and the external device of the microcomputer 10 according to the user program. This user program is received from the external terminal 10a and stored in the internal memory 15 when the user program download mode is set. The program used when writing the user program to the internal memory 15 is output from the read-only first memory 12 and the rewritable second memory 13.

読み出し専用の第1のメモリ12は、外部端子10aからユーザプログラムを受信して内部メモリ15に格納するプログラムを、予め記憶する。また、第1のメモリ12と同一のアドレス空間を有し、第1のメモリ12と同一のアドレス信号が入力される書換可能な第2のメモリ13は、プログラムに不具合箇所が存在する場合において、プログラムの不具合箇所を修正したパッチ情報を含むパッチデータを記憶する。さらに、内部メモリ15は、ユーザプログラムを格納する。   The first read-only memory 12 stores in advance a program that receives a user program from the external terminal 10 a and stores it in the internal memory 15. Further, the rewritable second memory 13 having the same address space as that of the first memory 12 and receiving the same address signal as that of the first memory 12 is provided when there is a defective part in the program. Stores patch data including patch information in which a defective part of the program is corrected. Furthermore, the internal memory 15 stores a user program.

ここで、第2のメモリ13に記憶されるパッチデータは、例えば、9ビット単位で構成される。この第2のメモリ13のパッチデータにおいて、例えば、最上位ビットを除く8ビットは、第2のメモリ13と同一のアドレスにおける第1のメモリ12のプログラムの不具合箇所を、修正するデータである。また、例えば、最上位ビットである1ビットは、そのパッチデータを使用するか否かを示すパッチ情報である。このパッチデータは、CPU11が実行する命令データ及びCPU11が参照する演算データ等を含む。また、第1のメモリ12に記憶されるプログラムは、例えば、8ビット単位で構成される。   Here, the patch data stored in the second memory 13 is configured in units of 9 bits, for example. In the patch data of the second memory 13, for example, 8 bits excluding the most significant bit are data for correcting a defective part of the program of the first memory 12 at the same address as the second memory 13. Further, for example, 1 bit which is the most significant bit is patch information indicating whether or not to use the patch data. The patch data includes command data executed by the CPU 11 and operation data referred to by the CPU 11. The program stored in the first memory 12 is configured in units of 8 bits, for example.

データ選択回路14は、CPU11からのアドレス信号によって第1のメモリ12及び第2のメモリ13から出力される、8ビットのプログラム及び最上位ビットを除く8ビットのパッチデータの入力を受け付ける。そして、データ選択回路14は、パッチデータの最上位ビットである1ビットに応じてプログラムまたはパッチデータの一方を出力する。つまり、データ選択回路14は、プログラムに不具合箇所が存在する場合において、パッチデータ内のパッチ情報に基づいて、プログラムとパッチデータのうち、パッチデータを出力し、不具合箇所が修正されたプログラムを生成する。また、データ選択回路14は、プログラムに不具合箇所が存在しない場合において、パッチデータ内のパッチ情報に基づいて、プログラムとパッチデータのうち、プログラムを出力する。   The data selection circuit 14 receives input of 8-bit program data and 8-bit patch data excluding the most significant bit output from the first memory 12 and the second memory 13 in response to an address signal from the CPU 11. Then, the data selection circuit 14 outputs either the program or the patch data according to 1 bit which is the most significant bit of the patch data. That is, the data selection circuit 14 outputs patch data out of the program and the patch data based on the patch information in the patch data when there is a defective portion in the program, and generates a program in which the defective portion is corrected. To do. Further, the data selection circuit 14 outputs the program out of the program and the patch data based on the patch information in the patch data when there is no defective portion in the program.

次に、図1の概念図の動作について説明する。
ここで、第1のメモリ12は、外部端子10aからユーザプログラムを受信して内部メモリ15に格納するプログラムを、予め記憶しているとする。なお、プログラムに不具合箇所が存在しているとする。また、第2のメモリ13は、プログラムの不具合箇所だけを修正した、パッチ情報を含むパッチデータを記憶しているとする。
Next, the operation of the conceptual diagram of FIG. 1 will be described.
Here, it is assumed that the first memory 12 stores in advance a program that receives a user program from the external terminal 10 a and stores it in the internal memory 15. It is assumed that there is a problem location in the program. In addition, it is assumed that the second memory 13 stores patch data including patch information in which only a defective part of the program is corrected.

CPU11は、第1のメモリ12及び第2のメモリ13に同一のアドレス信号を出力する。そして、データ選択回路14は、CPU11からのアドレス信号によって第1のメモリ12及び第2のメモリ13から出力される、プログラム及びパッチ情報を含むパッチデータの入力を受け付ける。その後、データ選択回路14は、パッチ情報に基づいて、プログラムまたはパッチデータのうちどちらか一方を出力し、不具合箇所だけが修正されたプログラムを生成する。   The CPU 11 outputs the same address signal to the first memory 12 and the second memory 13. The data selection circuit 14 receives input of patch data including programs and patch information output from the first memory 12 and the second memory 13 in response to an address signal from the CPU 11. Thereafter, the data selection circuit 14 outputs either one of the program and the patch data based on the patch information, and generates a program in which only the defective part is corrected.

CPU11は、データ選択回路14から出力された修正されたプログラムを実行し、外部端子10aから受信したユーザプログラムを内部メモリ15に格納する。
このようにすると、マイクロコンピュータ10を製造した時点において、読み出し専用の第1のメモリ12に格納されたプログラムに不具合箇所が発生した場合でも、不具合箇所を修正できるようになる。
The CPU 11 executes the modified program output from the data selection circuit 14 and stores the user program received from the external terminal 10 a in the internal memory 15.
In this way, even when a defective part occurs in the program stored in the read-only first memory 12 when the microcomputer 10 is manufactured, the defective part can be corrected.

また、読み出し専用の第1のメモリ12と書換可能な第2のメモリ13とが存在し、マイクロコンピュータ10を製造した時点において、読み出し専用の第1のメモリ12に予めプログラムを記憶できるので、書換可能な第2のメモリ13に時間をかけてプログラムを書き込む必要はない。   In addition, there is a read-only first memory 12 and a rewritable second memory 13, and when the microcomputer 10 is manufactured, a program can be stored in the read-only first memory 12 in advance. There is no need to write a program to the possible second memory 13 over time.

さらに、第1のメモリ12のプログラムに不具合箇所が存在する場合、プログラムの不具合箇所だけを修正した、パッチ情報を含むパッチデータを第2のメモリ13に記憶するだけで、データ選択回路14から修正されたプログラムが出力されるようにしたので、第2のメモリ13のパッチデータの全部を修正されたプログラムに書き換える必要はなく、プログラムの修正時間を短縮できる。   Further, when there is a defective part in the program of the first memory 12, only the defective part of the program is corrected, and patch data including patch information is stored in the second memory 13 and corrected from the data selection circuit 14. Since the modified program is output, it is not necessary to rewrite all the patch data in the second memory 13 with the modified program, and the modification time of the program can be shortened.

なお、第1のメモリ12に記憶されるプログラムは、8ビット単位に限定されない。また、第2のメモリ13に記憶されるパッチデータは、9ビット単位に限定されない。
[第1の実施の形態]
以下、第1の実施の形態の具体的な内容について説明する。図2は、第1の実施の形態に係るマイクロコンピュータのブロック回路図である。
Note that the program stored in the first memory 12 is not limited to an 8-bit unit. The patch data stored in the second memory 13 is not limited to 9-bit units.
[First Embodiment]
The specific contents of the first embodiment will be described below. FIG. 2 is a block circuit diagram of the microcomputer according to the first embodiment.

第1の実施の形態に係るマイクロコンピュータ30は、CPU31、MPX32、ROM33、FLASH34、セレクタ35、UART36及びFLASH37から構成される。   The microcomputer 30 according to the first embodiment includes a CPU 31, MPX 32, ROM 33, FLASH 34, selector 35, UART 36 and FLASH 37.

マイクロコンピュータ30のCPU31は、ユーザプログラムに従ってマイクロコンピュータ30の内部装置及び外部装置を制御する。このユーザプログラムは、外部端子30dから受信されてFLASH37に格納される。このユーザプログラムをFLASH37に書き込む際に使用するプログラムは、ROM33及びFLASH34から出力される。   The CPU 31 of the microcomputer 30 controls the internal device and the external device of the microcomputer 30 according to the user program. This user program is received from the external terminal 30d and stored in the FLASH 37. A program used when writing this user program to the FLASH 37 is output from the ROM 33 and the FLASH 34.

MPX32は、FLASH34に出力するアドレス信号について、外部端子30bから入力されたアドレス信号及びCPU31から入力されたアドレス信号を受け付ける。そして、MPX32は、外部端子30aから入力されたモード信号によって、2つのアドレス信号の中の1つをFLASH34に出力する。   The MPX 32 accepts an address signal input from the external terminal 30 b and an address signal input from the CPU 31 for the address signal output to the FLASH 34. Then, the MPX 32 outputs one of the two address signals to the FLASH 34 according to the mode signal input from the external terminal 30a.

ROM33は、外部端子30dからユーザプログラムを受信してFLASH37に格納するプログラムを、予め記憶する。また、ROM33と同一のアドレス空間を有し、ROM33と同一のアドレス信号が入力されるFLASH34は、プログラムに不具合箇所が存在する場合において、プログラムの不具合箇所を修正した、パッチ符号を含むパッチデータを記憶する。さらに、FLASH37は、ユーザプログラムを格納する。   The ROM 33 stores in advance a program that receives a user program from the external terminal 30d and stores it in the FLASH 37. In addition, the FLASH 34 having the same address space as the ROM 33 and receiving the same address signal as the ROM 33 has patch data including a patch code in which a defective portion of the program is corrected when the defective portion exists in the program. Remember. Further, the FLASH 37 stores a user program.

ここで、FLASH34に記憶されるパッチデータは、例えば、9ビット単位で構成される。このFLASH34のパッチデータにおいて、例えば、最上位ビットを除く8ビットは、FLASH34と同一のアドレスにおけるROM33のプログラムの不具合箇所を、修正するデータである。また、例えば、最上位ビットである1ビットは、そのパッチデータを使用するか否かを示す符号である。このパッチデータは、CPU31が実行する命令データ及びCPU31が参照する演算データ等を含む。また、ROM33に記憶されるプログラムは、例えば、8ビット単位で構成される。   Here, the patch data stored in the FLASH 34 is configured in units of 9 bits, for example. In the patch data of the FLASH 34, for example, 8 bits excluding the most significant bit are data for correcting a defective portion of the program of the ROM 33 at the same address as the FLASH 34. Also, for example, 1 bit which is the most significant bit is a code indicating whether or not to use the patch data. The patch data includes command data executed by the CPU 31, arithmetic data referred to by the CPU 31, and the like. The program stored in the ROM 33 is configured in units of 8 bits, for example.

セレクタ35は、CPU31からのアドレス信号によってROM33及びFLASH34から出力される、8ビットのプログラム及び最上位ビットを除く8ビットのパッチデータの入力を受け付ける。そして、セレクタ35は、パッチデータの最上位ビットである1ビットに応じてプログラムまたはパッチデータの一方を出力する。つまり、セレクタ35は、プログラムに不具合箇所が存在する場合において、パッチデータ内のパッチ符号に基づいて、プログラムとパッチデータのうちパッチデータを出力し、不具合箇所が修正されたプログラムを生成する。また、セレクタ35は、プログラムに不具合箇所が存在しない場合において、パッチデータ内のパッチ符号に基づいて、プログラムとパッチデータのうちプログラムを出力する。   The selector 35 receives input of 8-bit program data and 8-bit patch data excluding the most significant bit output from the ROM 33 and the FLASH 34 in response to an address signal from the CPU 31. Then, the selector 35 outputs one of the program and the patch data according to 1 bit which is the most significant bit of the patch data. That is, when there is a defective portion in the program, the selector 35 outputs patch data out of the program and the patch data based on the patch code in the patch data, and generates a program in which the defective portion is corrected. Further, the selector 35 outputs the program out of the program and the patch data based on the patch code in the patch data when there is no defective portion in the program.

UART36は、RS232C(Recommended Standard 232 version C)に対応し、1本の信号線で1ビットずつデータを伝送するシリアル転送方式によって、外部端子30dから送られてきたシリアル信号をパラレル信号に変換する。   The UART 36 corresponds to RS232C (Recommended Standard 232 version C), and converts the serial signal sent from the external terminal 30d into a parallel signal by a serial transfer method in which data is transmitted bit by bit by one signal line.

次に、図2のブロック回路図の動作について説明する。
ここで、ROM33は、外部端子30dからUART36を介してユーザプログラムを受信してFLASH37に格納するプログラムを、予め記憶しているとする。なお、プログラムに不具合箇所が存在しているとする。また、FLASH34は、プログラムの不具合箇所だけを修正した、パッチ符号を含むパッチデータを記憶しているとする。
Next, the operation of the block circuit diagram of FIG. 2 will be described.
Here, it is assumed that the ROM 33 stores in advance a program that receives a user program from the external terminal 30d via the UART 36 and stores the user program in the FLASH 37. It is assumed that there is a problem location in the program. Further, it is assumed that the FLASH 34 stores patch data including a patch code in which only a defective portion of the program is corrected.

MPX32は、外部端子30aから受信したモード信号により、外部端子30bから入力されたアドレス信号をFLASH34に出力する。そして、FLASH34は、外部端子30bから入力されたアドレス信号に基づいて、外部端子30cから受信したパッチデータを記憶する。その後、MPX32は、外部端子30aから受信したモード信号により、CPU31から入力されたアドレス信号をFLASH34に出力するように切り替わる。   The MPX 32 outputs the address signal input from the external terminal 30b to the FLASH 34 according to the mode signal received from the external terminal 30a. The FLASH 34 stores the patch data received from the external terminal 30c based on the address signal input from the external terminal 30b. Thereafter, the MPX 32 switches to output the address signal input from the CPU 31 to the FLASH 34 according to the mode signal received from the external terminal 30a.

CPU31は、MPX32はCPU31から入力されたアドレス信号をFLASH34に出力することになっていることを受け、ROM33及びFLASH34に同一のアドレス信号を出力する。そして、セレクタ35は、CPU31からのアドレス信号によってROM33及びFLASH34から出力された、プログラム及びパッチ符号を含むパッチデータの入力を受け付ける。さらに、セレクタ35は、パッチ符号に基づいて、プログラムとパッチデータのうちどちらか一方を出力し、不具合箇所だけが修正されたプログラムを生成する。   In response to the fact that the MPX 32 is to output the address signal input from the CPU 31 to the FLASH 34, the CPU 31 outputs the same address signal to the ROM 33 and the FLASH 34. The selector 35 receives input of patch data including a program and a patch code output from the ROM 33 and the FLASH 34 in response to an address signal from the CPU 31. Furthermore, the selector 35 outputs either one of the program and the patch data based on the patch code, and generates a program in which only the defective part is corrected.

CPU31は、セレクタ35から出力された修正されたプログラムを実行し、外部端子30dからUART36を介して受信したユーザプログラムをFLASH37に格納する。   The CPU 31 executes the modified program output from the selector 35 and stores the user program received from the external terminal 30d via the UART 36 in the FLASH 37.

以下、第1の実施の形態で実行される処理の概念について、図3を参照して説明する。なお、図3の処理は、ユーザプログラムを受信してFLASH37に格納する場合、CPU31からのアドレス信号がROM33及びFLASH34に対して存在する場合に実行される。図3のフローチャートが実行されると、以下のステップが実行される。図3は、データ選択処理を示すフローチャートである。   The concept of processing executed in the first embodiment will be described below with reference to FIG. 3 is executed when a user program is received and stored in the FLASH 37, and when an address signal from the CPU 31 exists for the ROM 33 and the FLASH 34. When the flowchart of FIG. 3 is executed, the following steps are executed. FIG. 3 is a flowchart showing data selection processing.

[ステップS11]セレクタ35は、CPU31からの同一のアドレス信号によってROM33及びFLASH34から出力された、プログラム及びパッチデータの入力を受け付ける。   [Step S11] The selector 35 accepts input of a program and patch data output from the ROM 33 and the FLASH 34 in response to the same address signal from the CPU 31.

[ステップS12]セレクタ35は、パッチデータ内のパッチ符号について0か1か判断する。0の場合、処理はステップS13に進む。1の場合、処理はステップS14に進む。   [Step S12] The selector 35 determines whether the patch code in the patch data is 0 or 1. If 0, the process proceeds to step S13. If 1, the process proceeds to step S14.

[ステップS13]ステップS12の処理から、パッチ符号は0の場合であり、セレクタ35は、ROM33のプログラムに不具合箇所が存在するので、ROM33のプログラムをパッチを当ててから出力する。具体的には、同一のアドレスにおいて、不具合箇所とされるROM33のプログラムのデータと、FLASH34のパッチ符号を除くパッチデータとを、8ビット単位で置き換える。   [Step S13] From the processing in step S12, the patch code is 0, and the selector 35 outputs the program in the ROM 33 after applying the patch because there is a defective part in the program in the ROM 33. Specifically, at the same address, the ROM 33 program data, which is regarded as a defective part, and the patch data excluding the FLASH 34 patch code are replaced in units of 8 bits.

[ステップS14]ステップS12の処理から、パッチ符号は1の場合であり、セレクタ35は、ROM33のプログラムに不具合箇所が存在しないので、ROM33のプログラムをそのまま出力する。   [Step S14] From the processing in step S12, the patch code is 1 and the selector 35 outputs the program in the ROM 33 as it is because there is no defective part in the program in the ROM 33.

以下、図3のフローチャートが実行された結果について説明する。図4は、第1の実施の形態のデータ選択結果を示す図である。
データ選択結果100は、同一のアドレスにおいて、ROM33の8ビット単位のプログラムの入力、FLASH34の9ビット単位のパッチデータの入力、及び、8ビット単位のプログラムの出力を、パッチを当てる前とパッチを当てた後とに分けて示した図である。なお、プログラム及びパッチデータは、16進数で表現している。また、パッチ符号を除くパッチデータは8ビット単位であり、パッチ符号は1ビット単位である。
Hereinafter, a result of executing the flowchart of FIG. 3 will be described. FIG. 4 is a diagram illustrating a data selection result according to the first embodiment.
The data selection result 100 shows that the input of the 8-bit unit program of the ROM 33, the input of the 9-bit unit patch data of the FLASH 34, and the output of the 8-bit unit program at the same address, It is the figure divided and shown after having applied. The program and patch data are expressed in hexadecimal numbers. The patch data excluding the patch code is in 8-bit units, and the patch code is in 1-bit units.

例えば、パッチを当てる前の場合、セレクタ35は、ROM33のプログラムが”5、A”であってFLASH34のパッチデータが”1、F、F”であるならば、ROM33のプログラムをそのまま出力するので、”5、A”を出力する。また、パッチを当てた後の場合、セレクタ35は、ROM33のプログラムが”5、A”であってFLASH34のパッチデータが”0、6、6”であるならば、FLASH34のパッチデータを出力するので、”6、6”を出力する。   For example, before applying a patch, if the program of the ROM 33 is “5, A” and the patch data of the FLASH 34 is “1, F, F”, the selector 35 outputs the program of the ROM 33 as it is. , “5, A” is output. In addition, when the patch is applied, the selector 35 outputs the patch data of the FLASH 34 if the program of the ROM 33 is “5, A” and the patch data of the FLASH 34 is “0, 6, 6”. Therefore, “6, 6” is output.

このようにすると、マイクロコンピュータ30を製造した時点において、ROM33に格納されたプログラムに不具合箇所が発生した場合でも、不具合箇所を修正できるようになる。   In this way, even when a defective part occurs in the program stored in the ROM 33 when the microcomputer 30 is manufactured, the defective part can be corrected.

また、ROM33の代りにFLASH34のみが実装されるシステムと比較した場合、ROM33とFLASH34とが存在する本実施の形態ではマイクロコンピュータ30を製造しFLASH34を消去した時点において、ROM33に予めプログラムを記憶できるので、FLASH34に時間をかけてプログラムを書き込む必要はない。   Further, when compared with a system in which only the FLASH 34 is mounted instead of the ROM 33, in the present embodiment in which the ROM 33 and the FLASH 34 exist, a program can be stored in the ROM 33 in advance when the microcomputer 30 is manufactured and the FLASH 34 is deleted. Therefore, it is not necessary to write a program in the FLASH 34 over time.

さらに、セレクタ35から出力されたプログラムに不具合箇所が存在する場合、プログラムの不具合箇所だけを修正した、パッチ符号を含むパッチデータをFLASH34に記憶するだけで、セレクタ35から修正されたプログラムが出力されるようにしたので、FLASH34のパッチデータの全部を修正されたプログラムに書き換える必要はなく、プログラムの修正時間を短縮できる。   Further, when there is a defective part in the program output from the selector 35, only the defective part of the program is corrected, and patch data including the patch code is stored in the FLASH 34, and the corrected program is output from the selector 35. As a result, it is not necessary to rewrite all of the FLASH 34 patch data with a modified program, and the modification time of the program can be shortened.

なお、ROM33に記憶されるプログラムは、8ビット単位に限定されない。また、FLASH34に記憶されるパッチデータは、9ビット単位に限定されない。
[第2の実施の形態]
以下、第2の実施の形態の具体的な内容について説明する。図5は、第2の実施の形態に係るマイクロコンピュータのブロック回路図である。
The program stored in the ROM 33 is not limited to an 8-bit unit. Further, the patch data stored in the FLASH 34 is not limited to a 9-bit unit.
[Second Embodiment]
The specific contents of the second embodiment will be described below. FIG. 5 is a block circuit diagram of a microcomputer according to the second embodiment.

第2の実施の形態に係るマイクロコンピュータ50は、CPU51、MPX52、FLASH53、ROM54、INV55、MPX56、UART57及びFLASH58から構成される。   The microcomputer 50 according to the second embodiment includes a CPU 51, MPX52, FLASH53, ROM54, INV55, MPX56, UART57, and FLASH58.

マイクロコンピュータ50のCPU51は、ユーザプログラムに従ってマイクロコンピュータ50の内部装置及び外部装置を制御する。このユーザプログラムは、外部端子50dから受信されてFLASH58に記憶される。このユーザプログラムをFLASH58に書き込む際に使用するプログラムは、FLASH53及びROM54から生成される。   The CPU 51 of the microcomputer 50 controls the internal device and the external device of the microcomputer 50 according to the user program. This user program is received from the external terminal 50d and stored in the FLASH 58. A program used when writing this user program to the FLASH 58 is generated from the FLASH 53 and the ROM 54.

MPX52は、FLASH53に出力するアドレス信号について、外部端子50bから入力されたアドレス信号及びCPU51から入力されたアドレス信号を受け付ける。そして、MPX52は、外部端子50aから入力されたモード信号によって、2つのアドレス信号の中の1つをFLASH53に出力する。   The MPX 52 receives an address signal input from the external terminal 50 b and an address signal input from the CPU 51 for the address signal output to the FLASH 53. Then, the MPX 52 outputs one of the two address signals to the FLASH 53 according to the mode signal input from the external terminal 50a.

FLASH53は、外部端子50dからユーザプログラムを受信してFLASH58に格納するプログラムを生成するためのデータを記憶する。また、FLASH53と同一のアドレス空間を有し、FLASH53と同一のアドレス信号が入力されるROM54は、FLASH53のデータを反転させる反転符号を予め記憶する。さらに、FLASH58は、ユーザプログラムを格納する。   The FLASH 53 stores data for receiving a user program from the external terminal 50d and generating a program to be stored in the FLASH 58. The ROM 54 having the same address space as the FLASH 53 and receiving the same address signal as the FLASH 53 stores in advance an inversion code for inverting the data of the FLASH 53. Further, the FLASH 58 stores a user program.

ここで、ROM54に記憶されている反転符号は、例えば、8ビット単位で構成される。ROM54の反転符号の各ビットと、ROM54と同一のアドレスにおけるFLASH53のデータの各ビットとは対応し、ROM54のあるビットの反転符号は、ROM54と同一のアドレスにおけるFLASH53の対応するビットのデータを反転するか否かを示している。また、FLASH53に記憶されているデータは、例えば、8ビット単位で構成される。   Here, the inversion code stored in the ROM 54 is configured in units of 8 bits, for example. Each bit of the inverted code of the ROM 54 corresponds to each bit of the FLASH 53 data at the same address as the ROM 54, and the inverted code of a bit of the ROM 54 inverts the data of the corresponding bit of the FLASH 53 at the same address as the ROM 54 Indicates whether or not to do. Further, the data stored in the FLASH 53 is configured in units of 8 bits, for example.

この反転符号は、マイクロコンピュータ50を製造した時点において、ユーザプログラムをFLASH58に書き込む際に使用するプログラムが、FLASH53及びROM54から生成されるように工夫されている。具体的には、マイクロコンピュータ50を製造した時点において、FLASH53のデータの各ビットは全て”1”であり、それでも適正なプログラムが生成されるように、ROM54の反転符号の各ビットを予め記憶している。   This inversion code is devised so that a program used to write a user program to the FLASH 58 is generated from the FLASH 53 and the ROM 54 when the microcomputer 50 is manufactured. Specifically, when the microcomputer 50 is manufactured, each bit of the data of the FLASH 53 is “1”, and each bit of the inverted code of the ROM 54 is stored in advance so that an appropriate program can be generated. ing.

なお、FLASH53のデータをFとし、ROM54のデータをRとし、出力されるデータをPとして式で表すと、
P=(F∩R)∪(〜F∩〜R)
となる。例えば、Fが”1”でありRが”0”である場合、(F∩R)は(1∩0)となって”0”であり、(〜F∩〜R)は(0∩1)となって”0”であり、P=(F∩R)∪(〜F∩〜R)はP=(0∪0)となって”0”である。
It is to be noted that the data of FLASH 53 is F, the data of ROM 54 is R, and the output data is P as an expression.
P = (F∩R) ∪ (~ F∩ ~ R)
It becomes. For example, when F is “1” and R is “0”, (F∩R) is (1∩0) and is “0”, and (˜F∩˜R) is (0∩1). ) And “0”, and P = (F∩R) ∪ (˜F∩˜R) is P = (0∪0) and is “0”.

MPX56及びINV55は、図6で詳細に説明するが、FLASH53のデータの各ビットに対して設けられている。つまり、FLASH53のデータ幅を8ビットとすると、MPX56及びINV55は、8個設けられることになる。   The MPX 56 and the INV 55 are provided for each bit of the data of the FLASH 53, which will be described in detail with reference to FIG. That is, if the data width of the FLASH 53 is 8 bits, eight MPXs 56 and INVs 55 are provided.

MPX56のそれぞれには、FLASH53の各ビットのデータと、このデータをINV55のそれぞれによって反転した各ビットのデータとが入力される。また、MPX56のそれぞれには、FLASH53の各ビットのデータに対応する、ROM54の各ビットの反転符号が入力される。MPX56のそれぞれは、ROM54の各ビットの反転符号に応じて、入力されているFLASH53のデータと、入力されているINV55によって反転したデータとの一方を出力する。つまり、MPX56からは、ROM54の反転符号に応じたFLASH53のデータが出力される。   Each MPX 56 receives data of each bit of FLASH 53 and data of each bit obtained by inverting this data with each of INV 55. Further, each MPX 56 receives an inverted code of each bit of the ROM 54 corresponding to each bit data of the FLASH 53. Each of the MPXs 56 outputs one of the input FLASH 53 data and the inverted data of the input INV 55 according to the inverted code of each bit of the ROM 54. In other words, the FLX 53 data corresponding to the inversion code of the ROM 54 is output from the MPX 56.

UART57は、RS232Cに対応し、1本の信号線で1ビットずつデータを伝送するシリアル転送方式によって、外部端子50dから送られてきたシリアル信号をパラレル信号に変換する。   The UART 57 corresponds to RS232C, and converts a serial signal sent from the external terminal 50d into a parallel signal by a serial transfer method in which data is transmitted bit by bit through one signal line.

次に、図5のブロック回路図の動作について説明する。
ここで、FLASH53は、外部端子50dからUART57を介してユーザプログラムを受信してFLASH58に格納するプログラムを生成するためのデータを記憶しているとする。なお、プログラムに不具合箇所が存在しているとする。また、ROM54は、FLASH53のデータを反転させる反転符号を予め記憶しているとする。
Next, the operation of the block circuit diagram of FIG. 5 will be described.
Here, it is assumed that the FLASH 53 stores data for receiving a user program from the external terminal 50d via the UART 57 and generating a program to be stored in the FLASH 58. It is assumed that there is a problem location in the program. Further, it is assumed that the ROM 54 stores in advance an inversion code for inverting the data of the FLASH 53.

MPX52は、外部端子50aから受信したモード信号により、外部端子50bから入力されたアドレス信号をFLASH53に出力する。そして、FLASH53は、外部端子50bから入力されたアドレス信号に基づいて、外部端子50cから受信したプログラムの不具合箇所だけを修正するパッチデータを上書きして記憶する。その後、MPX52は、外部端子50aから受信したモード信号により、CPU51から入力されたアドレス信号をFLASH53に出力するように切り替わる。   The MPX 52 outputs the address signal input from the external terminal 50b to the FLASH 53 according to the mode signal received from the external terminal 50a. Then, the FLASH 53 overwrites and stores patch data for correcting only the defective portion of the program received from the external terminal 50c based on the address signal input from the external terminal 50b. Thereafter, the MPX 52 switches to output the address signal input from the CPU 51 to the FLASH 53 according to the mode signal received from the external terminal 50a.

CPU51は、MPX52はCPU51から入力されたアドレス信号をFLASH53に出力することになっていることを受け、FLASH53及びROM54に同一のアドレス信号を出力する。そして、FLASH53のデータの各ビットについて、MPX56は、ROM54の反転符号の各ビットが0の場合、同一のアドレスにおけるFLASH53のデータをINV55を介して受け付ける。また、FLASH53のデータの各ビットについて、ROM54の反転符号の各ビットが1の場合、同一のアドレスにおけるFLASH53のデータをINV55を介さないで受け付ける。その後、MPX56は、受け付けた8ビット単位のデータから、外部端子50dからユーザプログラムを受信してFLASH58に格納する、不具合箇所だけが修正されたプログラムを生成する。   The CPU 51 receives the fact that the MPX 52 is to output the address signal input from the CPU 51 to the FLASH 53, and outputs the same address signal to the FLASH 53 and the ROM 54. For each bit of the FLASH 53 data, the MPX 56 receives the data of the FLASH 53 at the same address via the INV 55 when each bit of the inversion code of the ROM 54 is 0. Further, for each bit of the FLASH 53 data, when each bit of the inversion code of the ROM 54 is 1, the data of the FLASH 53 at the same address is accepted without passing through the INV 55. Thereafter, the MPX 56 generates a program in which only the defective portion is corrected, which receives the user program from the external terminal 50d and stores it in the FLASH 58 from the received 8-bit unit data.

CPU51は、MPX56から出力された修正されたプログラムを実行し、外部端子50dからUART57を介して受信したユーザプログラムをFLASH58に格納する。
以下、図5におけるINV55及びMPX56について、具体的に説明する。図6は、プログラム生成処理を示すブロック回路図である。
The CPU 51 executes the modified program output from the MPX 56 and stores the user program received from the external terminal 50d via the UART 57 in the FLASH 58.
Hereinafter, the INV 55 and the MPX 56 in FIG. 5 will be specifically described. FIG. 6 is a block circuit diagram showing the program generation process.

第2の実施の形態に係るプログラム生成処理を示すブロック回路図は、FLASH53、ROM54、INV55a0〜7及びMPX56a0〜7から構成される。
FLASH53及びROM54は前述している。INV55a0〜7は、8ビット分存在し、INV55a0〜7のそれぞれは、データ0〜7のそれぞれを反転してMPX56a0〜7のそれぞれに出力する。MPX56a0〜7は、8ビット分存在し、MPX56a0〜7のそれぞれは、反転符号0〜7のそれぞれが1の場合、データ0〜7のそれぞれをそのまま出力し、反転符号0〜7のそれぞれが0の場合、データ0〜7のそれぞれを反転して出力する。
The block circuit diagram showing the program generation processing according to the second embodiment is composed of FLASH 53, ROM 54, INV 55a0-7 and MPX 56a0-7.
The FLASH 53 and the ROM 54 have been described above. The INVs 55a0 to 7 exist for 8 bits, and the INVs 55a0 to 7 invert the data 0 to 7 and output the inverted data to the MPXs 56a0 to 7, respectively. The MPXs 56a0 to 7 exist for 8 bits. When each of the inversion codes 0 to 7 is 1, each of the MPXs 56a0 to 7 outputs the data 0 to 7 as it is, and each of the inversion codes 0 to 7 is 0. In this case, the data 0 to 7 are inverted and output.

以下、第2の実施の形態で実行される処理の概念について、図7を参照して説明する。なお、図7の処理は、ユーザプログラムを受信してFLASH58に格納する場合、CPU51からのアドレス信号がFLASH53及びROM54に対して存在する場合に実行される。図7のフローチャートが実行されると、以下のステップが実行される。図7は、プログラム生成処理を示すフローチャートである。   Hereinafter, the concept of processing executed in the second embodiment will be described with reference to FIG. 7 is executed when a user program is received and stored in the FLASH 58, and when an address signal from the CPU 51 exists for the FLASH 53 and the ROM 54. When the flowchart of FIG. 7 is executed, the following steps are executed. FIG. 7 is a flowchart showing the program generation process.

[ステップS21]MPX56は、CPU51からの同一のアドレス信号によってFLASH53及びROM54から出力された、8ビットのデータ及び8ビットの反転符号の入力を受け付ける。   [Step S21] The MPX 56 receives input of 8-bit data and an 8-bit inverted code output from the FLASH 53 and the ROM 54 in response to the same address signal from the CPU 51.

[ステップS22]MPX56は、ROM54の8ビットの反転符号についてそれぞれ0か1か判断する。0の場合、処理はステップS23に進む。1の場合、処理はステップS24に進む。   [Step S22] The MPX 56 determines whether the 8-bit inverted code of the ROM 54 is 0 or 1, respectively. If 0, the process proceeds to step S23. If 1, the process proceeds to step S24.

[ステップS23]ステップS22の処理から、反転符号は0の場合であり、MPX56は、FLASH53のビットを反転してから出力する。例えば、1ビットについて説明すると、FLASH53のデータが”0”であり、そのデータに対応するROM54の反転符号が”0”であるならば、FLASH53のデータを反転させるので、”1”を出力する。結果として、8ビットについて説明すると、FLASH53のデータが”01100110”であり、そのデータに対応するROM54の反転符号が”01011010”であるならば、”11000011”を出力する。   [Step S23] From the processing in step S22, the inversion code is 0, and the MPX 56 inverts the bit of the FLASH 53 and outputs it. For example, to explain 1 bit, if the data of FLASH 53 is “0” and the inversion code of the ROM 54 corresponding to the data is “0”, the data of FLASH 53 is inverted, so “1” is output. . As a result, describing the 8 bits, if the data of FLASH 53 is “01100110” and the inversion code of the ROM 54 corresponding to the data is “01011010”, “11000011” is output.

[ステップS24]ステップS22の処理から、反転符号は1の場合であり、MPX56は、FLASH53のビットをそのまま出力する。
以下、図7のフローチャートが実行された結果について説明する。図8は、第2の実施の形態のプログラム生成結果を示す図である。
[Step S24] From the processing in step S22, the inversion code is 1 and the MPX 56 outputs the FLASH 53 bit as it is.
Hereinafter, a result of executing the flowchart of FIG. 7 will be described. FIG. 8 is a diagram illustrating a program generation result according to the second embodiment.

プログラム生成結果200は、同一のアドレスにおいて、FLASH53の8ビット単位のデータの入力、ROM54の8ビット単位の反転符号の入力、及び、8ビット単位のプログラムの出力を、パッチを当てる前とパッチを当てた後とに分けて示した図である。なお、データ及び反転符号は、16進数で表現している。   The program generation result 200 is obtained by inputting the 8-bit unit data of FLASH 53, the 8-bit inversion code input of the ROM 54, and the 8-bit program output at the same address before and after applying the patch. It is the figure divided and shown after having applied. The data and the inverted code are expressed in hexadecimal numbers.

例えば、パッチを当てる前の場合、MPX56は、FLASH53のデータが”11111111”であってROM54の反転符号が”01011010”であるならば、”01011010”を出力する。また、パッチを当てた後の場合、MPX56は、FLASH53のデータが”01100110”であってROM54の反転符号が”01011010”であるならば、”11000011”を出力する。   For example, before applying the patch, the MPX 56 outputs “01011010” if the data of the FLASH 53 is “11111111” and the inversion code of the ROM 54 is “01011010”. In addition, when the patch is applied, the MPX 56 outputs “11000011” if the data of the FLASH 53 is “01100110” and the inversion code of the ROM 54 is “01011010”.

このようにすると、マイクロコンピュータ50を製造した時点において、MPX56から出力されたプログラムに不具合箇所が発生した場合でも、不具合箇所を修正できるようになる。   In this way, even when a defective part occurs in the program output from the MPX 56 when the microcomputer 50 is manufactured, the defective part can be corrected.

また、ROM54の代りにFLASH53のみを実装するシステムと比較した場合、FLASH53とROM54とが存在する本実施の形態では、マイクロコンピュータ50を製造しFLASH53を消去した時点において、FLASH53のデータの各ビットは全て”1”であるが、それでも適正なプログラムが生成されるようにROM54の反転符号の各ビットを予め記憶できるので、FLASH53に時間をかけてデータを書き込む必要はない。   Further, when compared with a system in which only the FLASH 53 is mounted instead of the ROM 54, in the present embodiment where the FLASH 53 and the ROM 54 exist, each bit of the data of the FLASH 53 is obtained when the microcomputer 50 is manufactured and the FLASH 53 is deleted. Although all bits are “1”, each bit of the inversion code of the ROM 54 can be stored in advance so that an appropriate program can be generated, so there is no need to write data in the FLASH 53 over time.

さらに、MPX56から出力されたプログラムに不具合箇所が存在する場合、プログラムの不具合箇所だけを修正した、パッチデータをFLASH53に上書きして記憶するだけで、MPX56から修正されたプログラムが出力されるようにしたので、FLASH53のデータの全部を修正されたデータに書き換える必要はなく、データの書換時間を短縮できる。   Further, when there is a defective part in the program output from the MPX 56, only the defective part of the program is corrected, and the patch data is overwritten and stored in the FLASH 53 so that the corrected program is output from the MPX 56. Therefore, it is not necessary to rewrite all the data of FLASH 53 with the corrected data, and the data rewriting time can be shortened.

なお、FLASH53に記憶されるデータは、8ビット単位に限定されない。また、ROM54に記憶される反転符号は、8ビット単位に限定されない。
(付記1) ユーザプログラムを内部に記憶するマイクロコンピュータにおいて、
プログラムを予め記憶する読み出し専用の第1のメモリと、
前記第1のメモリと同一のアドレス空間を有し、前記第1のメモリと同一のアドレス信号が入力される、前記プログラムの不具合箇所を修正したパッチデータを記憶する書換可能な第2のメモリと、
前記アドレス信号によって出力される前記プログラムと前記パッチデータとが入力され、前記第2のメモリの前記パッチデータの記憶内容に基づいて一方を出力するデータ選択回路と、
を有することを特徴とするマイクロコンピュータ。
Note that the data stored in the FLASH 53 is not limited to an 8-bit unit. Further, the inversion code stored in the ROM 54 is not limited to an 8-bit unit.
(Supplementary Note 1) In a microcomputer that stores a user program therein,
A read-only first memory for storing a program in advance;
A rewritable second memory for storing patch data in which a defect portion of the program is corrected, having the same address space as the first memory and receiving the same address signal as the first memory; ,
A data selection circuit that receives the program and the patch data output by the address signal, and outputs one based on the storage content of the patch data in the second memory;
A microcomputer characterized by comprising:

(付記2) 前記パッチデータは、パッチ情報を含み、前記データ選択回路は、前記パッチ情報に基づいて、前記プログラムと前記パッチデータとの一方を出力することを特徴とする付記1記載のマイクロコンピュータ。   (Supplementary note 2) The microcomputer according to supplementary note 1, wherein the patch data includes patch information, and the data selection circuit outputs one of the program and the patch data based on the patch information. .

(付記3) 前記パッチデータのパッチデータ幅は、前記プログラムのデータ幅より冗長データ幅分大きく、前記パッチ情報は、前記冗長データ幅に格納されることを特徴とする付記1記載のマイクロコンピュータ。   (Supplementary note 3) The microcomputer according to supplementary note 1, wherein a patch data width of the patch data is larger than a data width of the program by a redundant data width, and the patch information is stored in the redundant data width.

(付記4) 前記パッチデータは、0もしくは1の前記パッチ情報を含み、前記データ選択回路は、前記パッチ情報が1の場合前記プログラムを出力し、前記パッチ情報が0の場合前記パッチデータを出力することを特徴とする付記3記載のマイクロコンピュータ。   (Supplementary Note 4) The patch data includes the patch information of 0 or 1, and the data selection circuit outputs the program when the patch information is 1, and outputs the patch data when the patch information is 0 The microcomputer according to appendix 3, wherein

(付記5) 前記プログラム及び前記パッチデータを実行し、前記アドレス信号を出力する中央演算処理装置を有することを特徴とする付記1記載のマイクロコンピュータ。
(付記6) 前記中央演算処理装置は、前記ユーザプログラムを実行することを特徴とする付記5記載のマイクロコンピュータ。
(Additional remark 5) The microcomputer of Additional remark 1 characterized by having the central processing unit which performs the said program and the said patch data, and outputs the said address signal.
(Supplementary Note 6) The microcomputer according to Supplementary Note 5, wherein the central processing unit executes the user program.

(付記7) 前記第2のメモリは、フラッシュメモリであることを特徴とする付記1記載のマイクロコンピュータ。
(付記8) ユーザプログラムを内部に記憶するマイクロコンピュータにおいて、
第1のデータを予め記憶する読み出し専用の第1のメモリと、
前記第1のメモリと同一のアドレス空間を有し、前記第1のメモリと同一のアドレス信号が入力される、第2のデータを記憶する書換可能な第2のメモリと、
前記アドレス信号によって出力される前記第1のデータと前記第2のデータとによって、外部から前記ユーザプログラムを受信し、内部メモリに格納するプログラムを生成するプログラム生成回路と、
を有することを特徴とするマイクロコンピュータ。
(Supplementary note 7) The microcomputer according to supplementary note 1, wherein the second memory is a flash memory.
(Additional remark 8) In the microcomputer which memorize | stores a user program inside,
A read-only first memory for storing first data in advance;
A rewritable second memory for storing second data, which has the same address space as the first memory and receives the same address signal as the first memory;
A program generation circuit that receives the user program from the outside by the first data and the second data output by the address signal and generates a program to be stored in an internal memory;
A microcomputer characterized by comprising:

(付記9) 前記第1のメモリの前記第1のデータの各ビットと、前記第1のメモリと同一のアドレスにおける前記第2のメモリの前記第2のデータの各ビットとは対応し、前記第1のメモリの前記第1のデータの各ビットは、前記第1のメモリと同一のアドレスにおける前記第2のメモリの前記第2のデータの各ビットを反転するか否かを示す反転符号であることを特徴とする付記8記載のマイクロコンピュータ。   (Supplementary Note 9) Each bit of the first data in the first memory corresponds to each bit of the second data in the second memory at the same address as the first memory, and Each bit of the first data in the first memory is an inversion code indicating whether to invert each bit of the second data in the second memory at the same address as the first memory. The microcomputer according to appendix 8, wherein there is a microcomputer.

(付記10) 前記第2のメモリは、フラッシュメモリであることを特徴とする付記8記載のマイクロコンピュータ。   (Supplementary note 10) The microcomputer according to supplementary note 8, wherein the second memory is a flash memory.

本発明の概念図である。It is a conceptual diagram of this invention. 第1の実施の形態に係るマイクロコンピュータのブロック回路図である。1 is a block circuit diagram of a microcomputer according to a first embodiment. FIG. データ選択処理を示すフローチャートである。It is a flowchart which shows a data selection process. 第1の実施の形態のデータ選択結果を示す図である。It is a figure which shows the data selection result of 1st Embodiment. 第2の実施の形態に係るマイクロコンピュータのブロック回路図である。FIG. 6 is a block circuit diagram of a microcomputer according to a second embodiment. プログラム生成処理を示すブロック回路図である。It is a block circuit diagram which shows a program production | generation process. プログラム生成処理を示すフローチャートである。It is a flowchart which shows a program production | generation process. 第2の実施の形態のプログラム生成結果を示す図である。It is a figure which shows the program production | generation result of 2nd Embodiment.

符号の説明Explanation of symbols

10 マイクロコンピュータ
11 CPU
12 第1のメモリ
13 第2のメモリ
14 データ選択回路
15 内部メモリ
10 Microcomputer 11 CPU
12 First memory 13 Second memory 14 Data selection circuit 15 Internal memory

Claims (5)

ユーザプログラムを内部に記憶するマイクロコンピュータにおいて、
プログラムを予め記憶する読み出し専用の第1のメモリと、
前記第1のメモリと同一のアドレス空間を有し、前記第1のメモリと同一のアドレス信号が入力される、前記プログラムの不具合箇所を修正したパッチデータを記憶する書換可能な第2のメモリと、
前記アドレス信号によって出力される前記プログラムと前記パッチデータとが入力され、前記第2のメモリの前記パッチデータの記憶内容に基づいて一方を出力するデータ選択回路と、
を有することを特徴とするマイクロコンピュータ。
In a microcomputer that stores a user program internally,
A read-only first memory for storing a program in advance;
A rewritable second memory for storing patch data in which a defect portion of the program is corrected, having the same address space as the first memory and receiving the same address signal as the first memory; ,
A data selection circuit that receives the program and the patch data output by the address signal, and outputs one based on the storage content of the patch data in the second memory;
A microcomputer characterized by comprising:
前記パッチデータは、パッチ情報を含み、前記データ選択回路は、前記パッチ情報に基づいて、前記プログラムと前記パッチデータとの一方を出力することを特徴とする請求項1記載のマイクロコンピュータ。   2. The microcomputer according to claim 1, wherein the patch data includes patch information, and the data selection circuit outputs one of the program and the patch data based on the patch information. 前記パッチデータのパッチデータ幅は、前記プログラムのデータ幅より冗長データ幅分大きく、前記パッチ情報は、前記冗長データ幅に格納されることを特徴とする請求項1記載のマイクロコンピュータ。   2. The microcomputer according to claim 1, wherein a patch data width of the patch data is larger than a data width of the program by a redundant data width, and the patch information is stored in the redundant data width. ユーザプログラムを内部に記憶するマイクロコンピュータにおいて、
第1のデータを予め記憶する読み出し専用の第1のメモリと、
前記第1のメモリと同一のアドレス空間を有し、前記第1のメモリと同一のアドレス信号が入力される、第2のデータを記憶する書換可能な第2のメモリと、
前記アドレス信号によって出力される前記第1のデータと前記第2のデータとによって、外部から前記ユーザプログラムを受信し、内部メモリに格納するプログラムを生成するプログラム生成回路と、
を有することを特徴とするマイクロコンピュータ。
In a microcomputer that stores a user program internally,
A read-only first memory for storing first data in advance;
A rewritable second memory for storing second data, which has the same address space as the first memory and receives the same address signal as the first memory;
A program generation circuit that receives the user program from the outside by the first data and the second data output by the address signal and generates a program to be stored in an internal memory;
A microcomputer characterized by comprising:
前記第1のメモリの前記第1のデータの各ビットと、前記第1のメモリと同一のアドレスにおける前記第2のメモリの前記第2のデータの各ビットとは対応し、前記第1のメモリの前記第1のデータの各ビットは、前記第1のメモリと同一のアドレスにおける前記第2のメモリの前記第2のデータの各ビットを反転するか否かを示す反転符号であることを特徴とする請求項4記載のマイクロコンピュータ。
Each bit of the first data in the first memory corresponds to each bit of the second data in the second memory at the same address as the first memory, and the first memory Each bit of the first data is an inverted code indicating whether or not to invert each bit of the second data in the second memory at the same address as the first memory. The microcomputer according to claim 4.
JP2004372996A 2004-12-24 2004-12-24 Microcomputer Withdrawn JP2006178829A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004372996A JP2006178829A (en) 2004-12-24 2004-12-24 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004372996A JP2006178829A (en) 2004-12-24 2004-12-24 Microcomputer

Publications (1)

Publication Number Publication Date
JP2006178829A true JP2006178829A (en) 2006-07-06

Family

ID=36732885

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004372996A Withdrawn JP2006178829A (en) 2004-12-24 2004-12-24 Microcomputer

Country Status (1)

Country Link
JP (1) JP2006178829A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010211595A (en) * 2009-03-11 2010-09-24 Renesas Electronics Corp Data processor
JP2010257367A (en) * 2009-04-28 2010-11-11 Sanyo Electric Co Ltd Program update system, electronic device with program update function

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010211595A (en) * 2009-03-11 2010-09-24 Renesas Electronics Corp Data processor
JP2010257367A (en) * 2009-04-28 2010-11-11 Sanyo Electric Co Ltd Program update system, electronic device with program update function
US8694717B2 (en) 2009-04-28 2014-04-08 Semiconductor Components Industries, Llc Program update system and electronic device with program update function

Similar Documents

Publication Publication Date Title
EP3252605B1 (en) Vehicle-mounted control device, program writing device, program generating device and program
JP4574994B2 (en) Microcomputer with external memory
JP2019016026A (en) Electronic control system
JP2009093501A (en) Image processing apparatus and control method
JP2006178829A (en) Microcomputer
JPWO2008068937A1 (en) Data transfer control device and computer system
WO2019221058A1 (en) Vehicle-mounted relay device, communication system, bus determination method, and computer program
JP2007334813A (en) Memory control circuit and data rewriting method
JP2007052558A (en) Flash memory rewrite device, flash memory rewrite method and flash memory rewrite program
JP2007072695A (en) Redundancy storage method and program to flash memory
JP7027940B2 (en) Control device
US20030041282A1 (en) Electronic apparatus and correction method
JP5098853B2 (en) Data rewriting method, data rewriting device, and data management device
JP4568532B2 (en) Wireless device control system, wireless device and control device
JP2002149457A (en) Method for identifying reserved data area and device for the same
JP2010044638A (en) Information processing apparatus
JP2004126658A (en) Processor system
JP2006201878A (en) Microcomputer
JP3947856B2 (en) Data setting control device
JP2006217318A (en) Data communication system
KR100216045B1 (en) Bit arithmetic processing method and apparatus of programmable controller
JPH03266141A (en) Microprocessor system
JP4462900B2 (en) Memory access circuit
JP2005332228A (en) Program switching controller
JP2023114517A (en) Program update apparatus and program update method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080304