JP2006172331A - Microcontroller - Google Patents
Microcontroller Download PDFInfo
- Publication number
- JP2006172331A JP2006172331A JP2004366971A JP2004366971A JP2006172331A JP 2006172331 A JP2006172331 A JP 2006172331A JP 2004366971 A JP2004366971 A JP 2004366971A JP 2004366971 A JP2004366971 A JP 2004366971A JP 2006172331 A JP2006172331 A JP 2006172331A
- Authority
- JP
- Japan
- Prior art keywords
- diagnostic
- register
- peripheral module
- data
- peripheral
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本発明は、マイクロコントローラに係わり、特に高い信頼性を必要とする制御機器において使用されるマイクロコントローラに適用して有効な技術に関する。 The present invention relates to a microcontroller, and more particularly to a technique effective when applied to a microcontroller used in a control device that requires high reliability.
例えば、マイクロコントローラ(以下「マイコン」という)は、家電製品、AV機器、携帯電話、自動車、産業機械等の機器に組み込まれ、メモリに記憶されているプログラムにしたがって処理を行うことで、それぞれの機器の制御を行う装置である。 For example, a microcontroller (hereinafter referred to as a “microcomputer”) is incorporated in a device such as a home appliance, an AV device, a mobile phone, an automobile, or an industrial machine, and performs processing according to a program stored in a memory. It is a device that controls equipment.
このマイコンは、機器に組み込まれて利用されるというその性質上、機器の制御を行うために必要な性能を備え、かつ、安価であることが要求される。さらに、動作保証される使用条件の下で、正常に動作するという信頼性に対する要求も強い。 This microcomputer is required to have a performance necessary for controlling the device and to be inexpensive because of its nature of being incorporated in the device and used. Furthermore, there is a strong demand for reliability to operate normally under operating conditions where operation is guaranteed.
また、マイコンには、CPU、メモリの他に、タイマー、A/D変換、通信など、様々な種類の周辺モジュールが多数搭載されている。従来から用いられている高信頼化技術として、ECCやパリティチェック、ソフトウエア自己診断がある。ECC、パリティチェックはメモリ等の記憶素子に冗長なビットを付加しておくことにより、記憶素子に記憶されるデータが壊れた場合に、これを読み出し時に訂正、またはエラーを検出するものである。ソフトウエア自己診断とは、CPUのプログラム実行によって、CPU自身、メモリ、周辺モジュールが正しく機能するかを調べるものである。ソフトウエア自己診断は、診断のためのプログラムがあれば良いため、幅広く適用されている。ECCやパリティチェックは、自動車エンジン制御用など使用される環境が過酷で、特に信頼性が要求される分野において適用されている。 In addition to the CPU and memory, the microcomputer is equipped with a large number of various types of peripheral modules such as a timer, A / D conversion, and communication. Conventionally used high reliability technologies include ECC, parity check, and software self-diagnosis. In the ECC and parity check, redundant bits are added to a storage element such as a memory so that when data stored in the storage element is broken, this is corrected at the time of reading or an error is detected. The software self-diagnosis is to check whether the CPU itself, the memory, and the peripheral modules function correctly by executing the program of the CPU. Software self-diagnosis is widely applied because it only needs a program for diagnosis. ECC and parity check are applied in fields where the environment used for automobile engine control is severe and reliability is particularly required.
ところで、従来の診断技術のうち、ソフトウエア自己診断は、プログラムのみで実現でき、特別なハードウエアを必要としない。しかしながら、CPUのプログラム実行でこれを行うため、本来の機器制御に割り当てられる処理能力が低下することになる。言い換えると、機器制御の処理能力を落とさなくするには、ソフトウエア自己診断に必要な性能分を加算した、高性能なマイコンが必要ということになり、コストが高くなるという問題がある。あるいは、コストを優先して、使用するマイコンの処理能力で足りる範囲内に診断プログラムの処理を抑える必要がある。 By the way, among the conventional diagnostic techniques, software self-diagnosis can be realized only by a program, and no special hardware is required. However, since this is done by executing the program of the CPU, the processing capability assigned to the original device control is reduced. In other words, in order not to reduce the processing capability of device control, a high-performance microcomputer that adds the performance necessary for software self-diagnosis is necessary, which increases the cost. Or it is necessary to give priority to cost and to suppress the processing of the diagnostic program within a range that the processing capability of the microcomputer to be used is sufficient.
また、ECCやパリティチェックは、専用の論理回路でエラー訂正、エラー検出を行うため、CPUの処理に負荷をかけない。しかしながら、診断の対象が記憶素子に限定される。また、エラー訂正、エラー検出を行う論理回路が必要である。 In addition, since ECC and parity check perform error correction and error detection with a dedicated logic circuit, no load is imposed on the processing of the CPU. However, the object of diagnosis is limited to the memory element. In addition, a logic circuit that performs error correction and error detection is required.
このように、従来技術を用いて周辺モジュールの診断を行う場合、ソフトウエア自己診断による方法では、CPUの処理負荷が高くなるという問題がある。ECCやパリティチェックによる方法では、専用の論理回路が必要であり、これらの回路を必要としないマイコン用に設計済みの周辺モジュールを再利用できない。また、診断の対象が記憶素子に限定されるという制限がある。 As described above, when the peripheral module is diagnosed using the conventional technique, the method based on the software self-diagnosis has a problem that the processing load of the CPU increases. In the method based on ECC or parity check, a dedicated logic circuit is required, and peripheral modules designed for a microcomputer that does not require these circuits cannot be reused. In addition, there is a limitation that the object of diagnosis is limited to the memory element.
そこで、本発明の目的は、上記課題を解決し、CPUに処理負荷をかけずに、周辺モジュールの診断を行うための技術を提供することにある。 Therefore, an object of the present invention is to solve the above-described problems and provide a technique for diagnosing peripheral modules without applying a processing load to a CPU.
本発明の前記ならびにその他の目的と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。 The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.
本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、次のとおりである。 Of the inventions disclosed in the present application, the outline of typical ones will be briefly described as follows.
上記目的を達成するため、本発明は、CPUと、CPUが実行する命令およびデータを記憶する第1のメモリと、タイマー、A/D変換、通信などの機能を有する周辺モジュールと、CPUと第1のメモリが接続されるCPUバスと、周辺モジュールが接続される周辺バスと、CPUが周辺モジュールをアクセスする場合に、CPUバスと周辺バスを接続するバスブリッジとを有する構成において、さらに、周辺バスに接続される第2のメモリと、第2のメモリに記憶された診断プログラムを読み出して処理を行う診断モジュールとを有する。この構成により、診断モジュールは、診断プログラムでアドレス指定される周辺モジュールのレジスタを読み出して、診断プログラムで指定される比較条件に基づき、診断プログラムで指定される比較データと周辺モジュールのレジスタの値とを比較し、この比較条件が成立したか否かを示す信号を出力する。このように、診断モジュールが診断プログラムに定義される条件に一致するか否かを判定することで、周辺モジュールの診断をCPUに負荷をかけずに行うことができる。 To achieve the above object, the present invention provides a CPU, a first memory for storing instructions and data executed by the CPU, a peripheral module having functions such as a timer, A / D conversion, and communication, a CPU, In a configuration having a CPU bus to which one memory is connected, a peripheral bus to which a peripheral module is connected, and a bus bridge for connecting the CPU bus and the peripheral bus when the CPU accesses the peripheral module, A second memory connected to the bus; and a diagnostic module for reading and processing a diagnostic program stored in the second memory. With this configuration, the diagnostic module reads the register of the peripheral module addressed by the diagnostic program, and based on the comparison condition specified by the diagnostic program, the comparison data specified by the diagnostic program and the register value of the peripheral module And a signal indicating whether or not this comparison condition is satisfied is output. As described above, by determining whether or not the diagnostic module matches the condition defined in the diagnostic program, the peripheral module can be diagnosed without imposing a load on the CPU.
また、本発明は、さらに、割込み要求をCPUに通知する割込みコントローラを有する構成により、診断モジュールが診断プログラムに定義される条件に一致するか否かを判定し、比較条件が不成立の場合には、割込みコントローラに診断エラー割込み要求を出力し、割込みコントローラが診断モジュールからの診断エラー割込みをCPUに通知し、CPUが診断エラー割込みに対応するプログラム処理を実行することができる。 Further, the present invention further determines whether or not the diagnostic module matches a condition defined in the diagnostic program by a configuration having an interrupt controller that notifies the CPU of an interrupt request, and if the comparison condition is not satisfied The diagnostic error interrupt request is output to the interrupt controller, the interrupt controller notifies the CPU of the diagnostic error interrupt from the diagnostic module, and the CPU can execute the program processing corresponding to the diagnostic error interrupt.
本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば以下のとおりである。 Among the inventions disclosed in the present application, effects obtained by typical ones will be briefly described as follows.
本発明によれば、CPUに負荷をかけることなく、周辺モジュールの診断を行うことができる。 According to the present invention, it is possible to diagnose peripheral modules without imposing a load on the CPU.
以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において、同一の部材には原則として同一の符号を付し、その繰り返しの説明は省略する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that components having the same function are denoted by the same reference symbols throughout the drawings for describing the embodiment, and the repetitive description thereof will be omitted.
本発明の概念は、プログラム(命令)に従って処理を行うマイコンに適用され、プログラムを処理するCPUと、プログラムとデータを記憶する第1のメモリと、CPUがプログラムを読み出し、データを読み書きするためのCPUバスとからなるCPUバス接続系と、タイマー、A/D変換、通信などの機能を有する周辺モジュールと、周辺モジュールへのデータの読み書きを行うための周辺バスとからなる周辺バス接続系と、CPUが周辺モジュールをアクセスする場合に、CPUバスと周辺バスを接続するバスブリッジとを有する構成において、周辺バスに接続され、周辺モジュールの診断プログラムを記憶する第2のメモリと、周辺バスに接続され、診断プログラムを読み出して解読し、周辺モジュールのレジスタを読み出して、診断プログラムに定義される条件に一致するか否かを判定し、結果を出力する機能を有する診断モジュールとを有するものである。さらに、割込み要求をCPUに通知する割込みコントローラを有し、診断モジュールが診断プログラムに定義される条件に一致するか否かを判定し、比較条件が不成立の場合には、割込みコントローラに診断エラー割込み要求を出力し、割込みコントローラが診断モジュールからの診断エラー割込みをCPUに通知し、CPUが診断エラー割込みに対応するプログラム処理を実行するものである。以下に詳細に説明する。 The concept of the present invention is applied to a microcomputer that performs processing in accordance with a program (instruction), a CPU that processes the program, a first memory that stores the program and data, and a CPU that reads the program and reads and writes data. A CPU bus connection system comprising a CPU bus, a peripheral bus connection system comprising a peripheral module having functions such as a timer, A / D conversion, communication, etc., and a peripheral bus for reading and writing data to and from the peripheral module; In a configuration having a CPU bus and a bus bridge for connecting the peripheral bus when the CPU accesses the peripheral module, the second memory is connected to the peripheral bus and stores the diagnostic program of the peripheral module, and connected to the peripheral bus The diagnostic program is read and decoded, and the peripheral module registers are read and diagnosed. It determines whether to match the conditions programmed defined, and has a diagnostic module having a function of outputting a result. In addition, it has an interrupt controller that notifies the CPU of an interrupt request, and determines whether or not the diagnostic module matches the conditions defined in the diagnostic program. A request is output, the interrupt controller notifies the CPU of a diagnostic error interrupt from the diagnostic module, and the CPU executes a program process corresponding to the diagnostic error interrupt. This will be described in detail below.
図1は、本発明を適用した一実施の形態のマイコンを説明するためのブロック図である。 FIG. 1 is a block diagram for explaining a microcomputer according to an embodiment to which the present invention is applied.
本実施の形態のマイコン1は、プログラムを実行するCPU10と、プログラムおよびデータを記憶する第1のメモリとして機能するROM20およびRAM(1)21と、CPU10とROM20およびRAM21が接続されるCPUバス70と、タイマー、A/D変換、通信などの機能を有する周辺モジュール(1)60,(2)61,(N)62と、周辺モジュール60,61,62の診断プログラムを記憶する第2のメモリとして機能するRAM(2)50と、RAM50に記憶された診断プログラムを読み出して処理を行う診断モジュール40と、周辺モジュール60,61,62とRAM50および診断モジュール40が接続される周辺バス80と、CPUバス70と周辺バス80を接続するバスブリッジ30と、周辺バス80とCPU10および診断モジュール40に接続され、割込み要求をCPU10に通知する割込みコントローラ90と、周辺バス80に接続され、外部とのデータの入出力を行う外部バスコントローラ91などを備えて構成される。
The
このマイコン1は、外部バスコントローラ91を通じて外部バス2に接続され、また、周辺モジュール62が通信端子を通じてネットワーク3に接続され、さらに、周辺モジュール61がアナログ入力端子を通じてセンサー4に接続されている。
The
CPUバス70は、CPU10がプログラムの読み出し、データの入出力のためのアクセスを行うために使用する信号線の束で、アクセスの種類を示すコマンド、アドレス、データの情報を含む。
The CPU bus 70 is a bundle of signal lines used by the
周辺バス80は、RAM50の読み出しと書き込み、周辺モジュール60,61,62に含まれるレジスタの読み出しおよび書き込みのためのアクセスを行うために使用する信号線の束である。
The peripheral bus 80 is a bundle of signal lines used for reading and writing to the
バスブリッジ30は、CPU10が診断モジュール40、RAM50、周辺モジュール60,61,62をアクセスする場合に、CPUバス70と周辺バス80を接続して、コマンド、アドレス、データを転送する機能を有する。
The
診断モジュール40は、RAM50に記憶された診断プログラムを読み出し、解読し、周辺モジュール60,61,62に含まれるレジスタを読み出して、診断プログラムに定義される条件に一致するか否かを判定し、結果を出力する。診断モジュールの判定結果は、例えば割込みコントローラ90に入力され、判定結果が不一致の場合には、周辺モジュールのレジスタの値が不正であるとみなし、CPU10に割り込み処理を実行させるという使用方法が考えられる。
The
図2は、図1における診断モジュール40の主要な機能を説明するためのブロック図である。
FIG. 2 is a block diagram for explaining the main functions of the
制御状態レジスタ400は、診断モジュール40の動作を制御するとともに、状態を知るためのレジスタである。診断プログラムアドレスレジスタ401は、診断プログラムのアドレスを保持するレジスタである。診断対象アドレスレジスタ402は、診断対象となる周辺モジュールレジスタのアドレスを保持するレジスタである。診断対象データレジスタ403は、診断対象となる周辺モジュールレジスタのデータを保持するレジスタである。比較データレジスタ404は、診断対象データレジスタ403と比較するデータを保持するレジスタである。マスクデータレジスタ405は、診断対象データレジスタ403と比較データレジスタ404の比較を行うビットを指定するレジスタである。比較条件レジスタ406は、診断対象データレジスタ403と比較データレジスタ404の比較条件を保持するレジスタである。
The
これらのレジスタは、図1における周辺バス80を使ってアクセスされる。8003は、周辺バス80のデータバスであり、診断モジュール40のレジスタの書き込み端子に接続される。診断プログラムアドレスレジスタ401は、周辺バス80からの書き込みの他、診断モジュール40が生成する診断プログラムアドレスの書き込みが行われる。411は診断プログラムアドレス生成回路であり、診断プログラムアドレスレジスタ401のデータ4010を入力して、次の診断プログラムアドレス4110を生成する。410は、診断プログラムアドレス書き込みデータの選択回路で、その出力データ4100が診断プログラムアドレスレジスタ401への書き込みデータとなる。診断モジュール出力データ選択回路413は、制御状態4000、診断プログラムアドレス4010、診断対象アドレス4020、診断対象データ4030、比較データ4040、マスクデータ4050、比較条件4060からデータを選択し、診断モジュール読み出しデータ4130を出力する。診断モジュール読み出しデータ4130は、バッファ422を介して、周辺バスデータ8003に出力される。
These registers are accessed using the peripheral bus 80 in FIG.
比較回路432は、診断対象データ4030とマスクデータ4050をマスク回路430で演算した結果4300と、比較データ4040とマスクデータ4050をマスク回路431で演算した結果4310を、比較条件4060に基づき比較し、比較結果4320を出力する。マスク回路430と431におけるマスク演算は、入力データの論理積で行うことができる。
The
制御論理440は、周辺バス80から診断モジュール40のレジスタのアクセスに対してのデータ読み出しと書き込みの制御と、診断プログラム実行の制御を行う。周辺バス80からのアクセスにおいては、周辺バスコマンド8001を入力し、アクセス無し、読み出し、書き込みの操作の解読を行う。また、周辺バスアドレス8002を入力し、アクセス対象となるレジスタの判定を行う。診断プログラムの実行時には、診断モジュール40が周辺バス80のアクセスを行う。周辺バス要求信号4401を出力し、周辺バスの使用許可を示す周辺バス要求応答信号8000が返ると、周辺バスアクセスを開始する。制御論理440が生成した周辺バスコマンド4400を、バスドライバ420を通じて、周辺制御バス8001に出力する。また、診断プログラム読み出し時には、診断プログラムアドレス4010を選択回路412で選択し、選択された信号4120をバスドライバ421を通じて周辺アドレスバス8002に出力する。診断対象の周辺モジュールレジスタ読み出し時には、診断対象アドレス4020を選択回路412で選択し、選択された信号4120をバスドライバ421を通じて周辺アドレスバス8002に出力する。診断プログラムの実行において、診断終了を示すプログラムを実行した場合、診断終了割込み信号4402を出力することができる。また、比較結果4320が不一致を示した場合、診断エラー割り込み信号4403を出力することができる。
The
図3は、診断プログラムの形式を示す図である。(1)は、次に読み出す診断プログラムのアドレスを指定する形式である。すなわち、診断プログラムのアドレスを設定するための形式であり、8ビットのコマンド部分と32ビットの診断プログラムアドレス部分からなる。(2)は、読み出す周辺モジュールレジスタのアドレスと、周辺モジュールレジスタの値と比較するデータとを指定する形式である。すなわち、周辺モジュールレジスタの比較の方法を設定するための形式であり、8ビットのコマンド部分と32ビットの診断対象アドレス部分とDビットの比較データ部分からなる。(3)は、読み出す周辺モジュールレジスタのアドレスと、周辺モジュールレジスタの値と比較するデータと、周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式である。すなわち、周辺モジュールレジスタのマスク付き比較の方法を設定するための形式であり、8ビットのコマンド部分と32ビットの診断対象アドレス部分とDビットの比較データ部分とDビットのマスクデータ部分からなる。(4)は、診断モジュールの処理を終了させることを指定する形式である。すなわち、診断プログラム実行の終了を設定するための形式であり、8ビットのコマンド部分からなる。 FIG. 3 is a diagram showing the format of the diagnostic program. (1) is a format for designating the address of the diagnostic program to be read next. That is, it is a format for setting the address of the diagnostic program, and consists of an 8-bit command portion and a 32-bit diagnostic program address portion. (2) is a format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register. That is, it is a format for setting a method for comparing peripheral module registers, and consists of an 8-bit command portion, a 32-bit diagnosis target address portion, and a D-bit comparison data portion. (3) is a format for designating the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data for designating the bit to be compared with the peripheral module register. That is, it is a format for setting a comparison method with a mask of a peripheral module register, and consists of an 8-bit command portion, a 32-bit diagnosis target address portion, a D-bit comparison data portion, and a D-bit mask data portion. (4) is a format for designating the termination of the diagnostic module processing. That is, it is a format for setting the end of the diagnostic program execution, and consists of an 8-bit command part.
図4は、図3における診断プログラムのコマンドの形式を示す図である。図4において、2ビットのTP1、TP0は、図3における(1)〜(4)のいずれの形式であるかを識別するための情報である。すなわち、コマンドのタイプを表すフィールドであり、その値と意味を図5に示す。値が00の場合、診断プログラムの形式は、図3における(1)の診断プログラムアドレス設定形式である。値が01の場合、診断プログラムの形式は、図3における(4)の診断終了形式である。値が10の場合、診断プログラムの形式は、図3における(2)の比較形式である。値が11の場合、診断プログラムの形式は、図3における(3)のマスク付き比較形式である。 FIG. 4 is a diagram illustrating a command format of the diagnostic program in FIG. In FIG. 4, 2-bit TP1 and TP0 are information for identifying which of the formats (1) to (4) in FIG. That is, it is a field representing the command type, and its value and meaning are shown in FIG. When the value is 00, the format of the diagnostic program is the diagnostic program address setting format (1) in FIG. When the value is 01, the format of the diagnosis program is the diagnosis end format (4) in FIG. When the value is 10, the format of the diagnostic program is the comparison format (2) in FIG. When the value is 11, the format of the diagnostic program is a comparison format with a mask (3) in FIG.
図4において、2ビットのSZ1、SZ0は、図3における(2),(3)のいずれかの形式の場合に、読み出す周辺モジュールレジスタのビット長を示す情報である。すなわち、診断対象データのサイズを表すフィールドであり、図3における(2)の比較形式の比較データのビットサイズDを指定し、(3)のマスク付き比較形式の比較データとマスクデータのビットサイズDを指定する。SZ1、SZ0の値と意味を図6に示す。値が00の場合、データサイズは8ビットであることを示す。値が01の場合、データサイズは16ビットであることを示す。値が11の場合、データサイズは32ビットであることを示す。値が10の場合、データサイズは未定義である。図3において比較データを参照する(2)および(3)の形式の診断プログラムの場合、SZ1、SZ0は、00、01、11のいずれかの値でなくてはならない。(1)および(4)の形式の診断プログラムの場合、SZ1、SZ0は意味を持たないため、いかなる値であっても良い。 In FIG. 4, 2-bit SZ1 and SZ0 are information indicating the bit length of the peripheral module register to be read in the case of any of the formats (2) and (3) in FIG. That is, it is a field that represents the size of the diagnosis target data, specifies the bit size D of the comparison data in the comparison format (2) in FIG. Specify D. The values and meanings of SZ1 and SZ0 are shown in FIG. A value of 00 indicates that the data size is 8 bits. A value of 01 indicates that the data size is 16 bits. A value of 11 indicates that the data size is 32 bits. When the value is 10, the data size is undefined. In the case of the diagnostic programs of the formats (2) and (3) that refer to the comparison data in FIG. 3, SZ1 and SZ0 must be one of 00, 01, and 11 values. In the case of the diagnostic programs of the formats (1) and (4), SZ1 and SZ0 have no meaning and may be any value.
図4において、2ビットのCM1、CM0は、図3における(2),(3)のいずれかの形式の場合に、周辺モジュールレジスタと比較データの比較条件として、一致、不一致、大きい、小さいを指定する情報である。すなわち、診断対象データの比較条件を表すフィールドであり、その値と意味を図7に示す。値が00の場合、比較条件は「診断対象データと比較データが一致」となる。値が01の場合、比較条件は「診断対象データと比較データが不一致」となる。値が10の場合、比較条件は「診断対象データが比較データより大きい」となる。値が11の場合、比較条件は「診断対象データが比較データより小さい」となる。図3において比較を行わない(1)および(4)の形式の診断プログラムの場合、CM1、CM0は意味を持たないため、いかなる値であっても良い。 In FIG. 4, 2-bit CM1 and CM0 are matched, mismatched, large or small as comparison conditions for the peripheral module register and the comparison data in the case of any of the formats (2) and (3) in FIG. Information to be specified. That is, it is a field that represents a comparison condition of diagnosis target data, and its value and meaning are shown in FIG. When the value is 00, the comparison condition is “the diagnosis target data matches the comparison data”. When the value is 01, the comparison condition is “the diagnosis target data does not match the comparison data”. When the value is 10, the comparison condition is “the diagnosis target data is larger than the comparison data”. When the value is 11, the comparison condition is “the diagnosis target data is smaller than the comparison data”. In the case of the diagnostic programs of the types (1) and (4) that do not perform comparison in FIG. 3, CM1 and CM0 have no meaning and may be any value.
図4において、1ビットのUPTは、図3における(2),(3)のいずれかの形式の場合に、診断モジュール40が診断プログラムの実行後に、読み出した周辺モジュールのレジスタに、診断プログラムで指定した比較データの値を書き込むか否かを指定する情報である。すなわち、診断プログラムの実行後に診断対象レジスタを比較データの値に更新するか否かを表すビットであり、その値と意味を図8に示す。値が0の場合、更新を行わないことを示し、値が1の場合、比較データで上書きすることを示す。図3において比較を行わない(1)および(4)の形式の診断プログラムの場合、UPTは意味を持たないため、いかなる値であっても良い。
In FIG. 4, 1-bit UPT is stored in the register of the peripheral module read out by the
図4において、1ビットのUPEは、図3における(2),(3)のいずれかの形式の場合に、診断モジュール40が診断プログラムの実行後に、RAM50中の診断プログラムで指定した比較データに、読み出した周辺モジュールのレジスタの値を書き込むか否かを指定する情報である。すなわち、診断プログラムの実行後に診断プログラム中の比較データ部分を診断対象データの値に更新するか否かを表すビットであり、その値と意味を図9に示す。値が0の場合、更新を行わないことを示し、値が1の場合、診断対象データで上書きすることを示す。図3において比較を行わない(1)および(4)の形式の診断プログラムの場合、UPEは意味を持たないため、いかなる値であっても良い。
In FIG. 4, the 1-bit UPE is compared with the comparison data designated by the diagnostic program in the
図10は、図2における制御状態レジスタ400の詳細を示す図である。ビット15〜8のEX、IED、IER、WCYは診断モジュール40の動作を設定するための制御ビットであり、CPU10によって書き込みを行う。
FIG. 10 is a diagram showing details of the
EXは、診断イネーブルビットと呼び、RAM50に記憶されたプログラムを読み出して処理を実行することを指定するためのレジスタに格納され、CPU10から診断実行可および診断実行不可のいずれの値にも設定可能である。診断モジュール40に診断プログラムを実行させたい場合に1を書き込む。EXビットを1から0に書き換えると、現在実行中の診断プログラムが終了した後、停止状態になる。
EX is called a diagnostic enable bit, and is stored in a register for designating execution of processing by reading a program stored in the
IEDは、診断終了割込みイネーブルビットと呼び、RAM50に記憶された診断モジュール40の処理を終了させることを指定する形式のプログラムを読み出した場合に、診断が終了したことを外部に出力するか否かを指定するためのレジスタに格納され、CPU10から読み出しおよび書き込み可能である。図3における(4)の診断終了形式のプログラムを実行した後に、割込み信号を発生させたい場合に1を書き込む。
The IED is called a diagnosis end interrupt enable bit, and whether or not to output the fact that the diagnosis has ended when a program of a format that specifies the end of the processing of the
IERは、診断エラー割込みイネーブルビットと呼び、RAM50に記憶された図3における(2),(3)のいずれかの形式のプログラムを実行し、プログラムで指定した診断条件が不成立の場合に、診断エラー割込み信号を出力するか否かを指定するためのレジスタに格納され、CPU10から読み出しおよび書き込み可能である。図3における(2)および(3)の形式の診断プログラムを実行し、比較結果が不一致となった場合に割込みを発生させたい場合に1を書き込む。
The IER is called a diagnostic error interrupt enable bit and executes a program in the format (2) or (3) in FIG. 3 stored in the
WCYは、ウエイトサイクル数フィールドと呼び、診断プログラムの実行後に次の診断プログラムを読み出すまでのウエイトサイクル数を設定するレジスタに格納され、CPU10から読み出しおよび書き込み可能である。診断プログラム間に発生させるウエイトサイクル数を指定する。WCYの値とウエイトサイクル数の関係は、本発明を適用するマイコンにおいて適宜決定すれば良いが、例えばウエイトサイクル数は2のWCY乗とするなどが考えられる。
WCY is called a wait cycle number field, is stored in a register for setting the number of wait cycles until the next diagnostic program is read after execution of the diagnostic program, and can be read and written from the
ビット3〜1のFEX、FED、FERは、診断モジュール40の状態を表すビットである。
FEXは、診断実行中フラグと呼び、RAM50に記憶されたプログラムを読み出して処理を実行中であるか否かを示すためのレジスタに格納され、CPU10から読み出し可能である。診断モジュール40が診断プログラムを実行中である場合には1、停止状態にある場合には0が読み出される。
The FEX is called a diagnostic execution flag, and is stored in a register for indicating whether or not processing is being executed by reading a program stored in the
FEDは、診断終了フラグと呼び、診断が終了したか否かを示すためのレジスタに格納され、CPU10から読み出し可能である。診断モジュール40が図3における(4)の診断終了形式のプログラムを実行した後に値が1にセットされる。
The FED is called a diagnosis end flag, is stored in a register for indicating whether or not the diagnosis is completed, and can be read from the
FERは、診断エラーフラグと呼び、診断エラーが発生したか否かを示すためのレジスタに格納され、CPU10から読み出しおよび書き込み可能である。図3における(2)および(3)の形式の診断プログラムを実行し、結果が不一致となった場合に1にセットされる。
The FER is called a diagnostic error flag, is stored in a register for indicating whether or not a diagnostic error has occurred, and can be read and written from the
ビット7〜4とビット0のRSVは予約ビットである。
図11は、診断モジュール40の処理を示すフローチャートである。まず、診断可能か否かの判定を行う(S1)。この診断可能か否かの判定は、図10の制御状態レジスタ400を使って行う。EX=1かつFED=0かつFER=0の場合に、診断可能となる。すなわち、EX=1により診断プログラムの実行が許可されており、FED=0により診断が終了しておらず、FER=0により診断エラーが発生していない場合に、診断プログラムの実行が可能となる。上記以外の条件では、診断モジュール40は待機状態となる。
FIG. 11 is a flowchart showing the processing of the
診断可能状態(Y)になると、診断モジュール40はRAM50に記憶された診断プログラムを読み出す(S2)。診断プログラムのコマンドを解析し(S3)、その形式が比較またはマスク付き比較の場合、アドレス設定の場合、診断終了の場合で、それぞれの処理を行う。
When the diagnosis is possible (Y), the
比較またはマスク付き比較の場合、コマンドに続く診断対象アドレス、比較データ、マスクデータを読み出し(S4)、続いて周辺モジュールレジスタを読み出し(S5)、比較データとの比較を行う(S6)。一致の場合は次のウエイト処理(S10)へ進み、不一致の場合は制御状態レジスタのFERを1にセットして(S7)、ウエイト処理(S10)へ進む。この時、制御状態レジスタのIERが1に設定されている場合は、診断エラー割込みを発生させる。 In the case of comparison or comparison with mask, the diagnosis target address, comparison data, and mask data following the command are read (S4), then the peripheral module register is read (S5), and compared with the comparison data (S6). If they match, the process proceeds to the next wait process (S10). If they do not match, the FER of the control status register is set to 1 (S7), and the process proceeds to the wait process (S10). At this time, if IER of the control status register is set to 1, a diagnostic error interrupt is generated.
コマンドがアドレス設定の場合、コマンドに続く診断プログラムアドレスを読み出し、図2における診断プログラムアドレスレジスタ401に設定して(S8)、次のウエイト処理(S10)に進む。
When the command is an address setting, the diagnostic program address following the command is read out, set in the diagnostic
コマンドが診断終了の場合、制御状態レジスタのFEDを1にセットして(S9)、次のウエイト処理(S10)に進む。 If the command is a diagnosis end, the FED of the control status register is set to 1 (S9), and the process proceeds to the next wait process (S10).
ウエイト処理(S10)では、図10の制御状態レジスタ400のWCYで決まるサイクル数の間ウエイト状態となり、診断可能か否かの判定処理(S1)に戻る。
In the wait process (S10), a wait state is established for the number of cycles determined by WCY in the
図12は、診断プログラム実行時の周辺バス80の動作を表したタイムチャートである。診断モジュール40は診断可能状態になると、周辺バス80のバスマスタであるバスブリッジ30に周辺バス要求を出力する。バスブリッジ30は周辺バス80のバス権を渡せるタイミングで周辺バス要求応答を返す。これを受けて診断モジュール40は周辺バス80のアクセスを開始する。診断プログラムiは、図3における(2)の比較形式であり、RAM50からコマンドPiR1、診断対象アドレスPiR2、比較データPiR3を読み出し、続いて診断対象アドレスが示す周辺モジュールレジスタから診断対象データDiR1を読み出す。診断プログラムiの実行が終わるとウエイト処理に入り、次の診断プログラムjの実行に移る。
FIG. 12 is a time chart showing the operation of the peripheral bus 80 when the diagnostic program is executed. When the
図13は、診断プログラムの実行で、比較結果が不一致となり診断エラー割込みが発生する場合を表したタイムチャートである。診断プログラムkは、図3における(3)のマスク付き比較形式であり、RAM50からコマンドPkR1、診断対象アドレスPkR2、比較データPkR3、マスクデータPkR4を読み出し、続いて診断対象アドレスが示す周辺モジュールレジスタから診断対象データDkR1を読み出す。マスク付き比較の結果が不一致となったため、診断エラー割込みが出力される。
FIG. 13 is a time chart showing the case where the comparison result is inconsistent and a diagnostic error interrupt occurs when the diagnostic program is executed. The diagnostic program k is a comparison format with a mask (3) in FIG. 3, and reads the command PkR1, the diagnostic target address PkR2, the comparative data PkR3, and the mask data PkR4 from the
図14は、図3における(1)の診断プログラムアドレス設定の形式を実行した場合を表したタイムチャートである。診断プログラムnは、図3における(1)の診断プログラムアドレス設定形式であり、RAM50からコマンドPnR1、診断プログラムアドレスPnR2を読み出す。PnR2は図2における診断プログラムアドレスレジスタ401に設定される。診断プログラムnの実行後、ウエイト処理に入り、PnR2をアドレスとして診断プログラム1のコマンドP1R1を読み出す。
FIG. 14 is a time chart showing the case where the diagnostic program address setting format (1) in FIG. 3 is executed. The diagnostic program n has the diagnostic program address setting format (1) in FIG. 3, and reads the command PnR1 and the diagnostic program address PnR2 from the
図15は、図1におけるRAM50に記憶される診断プログラムの例を示す図である。図15において、1列のデータは1バイトである。診断プログラム1は、マスク付き比較形式であり、1バイトのコマンド1、4バイトの診断対象アドレス1、1バイトの比較データ1、1バイトの比較マスクデータ1からなる。診断プログラム2もマスク付き比較形式であるが、比較データと比較マスクデータのサイズが2バイトの例を示す。診断プログラムnは、診断対象アドレス設定形式であり、1バイトのコマンドn、4バイトの診断対象アドレスnからなる。診断対象アドレスnの値は、診断プログラム1のコマンド1のアドレスとすれば、診断プログラム1から診断プログラムnまでを無限に実行できる。
FIG. 15 is a diagram showing an example of a diagnostic program stored in the
図16は、本発明を適用した別の実施の形態のマイコンを説明するためのブロック図である。 FIG. 16 is a block diagram for explaining a microcomputer according to another embodiment to which the present invention is applied.
本実施の形態のマイコン1は、図1におけるROM20がマイコン1に内蔵されない代わりに、外部バス2に外部のROM5が接続されて構成される。他の構成は、図1と同様である。
The
CPU10は、外部バス2を介してROM5から命令およびデータを読み出すことによってプログラムを実行する。ROM5には診断モジュール40が実行するプログラムも記憶されている。診断モジュール40はROM5から診断プログラムを読み出して実行することもできるし、例えばマイコン1をリセットした後にROM5からRAM50に診断プログラムを転送しておくことにより、RAM50から読み出して実行することも可能である。
The
以上のように、前記各実施の形態(図1、図16)のマイコン1によれば、CPU10が接続されたCPUバス70とは別の周辺バス80に接続され、周辺モジュール60,61,62の診断プログラムを記憶するRAM50と、このRAM50に記憶された診断プログラムを読み出して処理を行う診断モジュール40とを有することにより、診断モジュール40が、RAM50から診断プログラムを読み出して解読し、周辺モジュール60,61,62のレジスタを読み出して、診断プログラムに定義される条件に一致するか否かの判定による診断を行うことができるので、CPU10に負荷をかけることなく、周辺モジュール60,61,62の診断を行うことができる。
As described above, according to the
本実施の形態に対して、例えば診断モジュールを持たない従来技術(図17)のマイコン1では、周辺バス80に接続されたRAM50および診断モジュール40がなかった。そのため、周辺モジュール60,61,62のレジスタをCPU10がソフトウエア処理で診断する場合には、RAM21にその診断用のプログラムを用意し、CPU10が診断プログラムおよび周辺モジュールレジスタを読み出して比較を行うことで実現できる。ただし、CPUバス70に比べて周辺バス80は低速クロックで動作させるため、CPU10が周辺モジュールをアクセスする場合には、多くのウエイトサイクルが入る。また、周辺モジュール診断を割込みによって起動させる場合には、割込み処理のオーバヘッドが加わる。このような課題が従来技術にはあったが、本実施の形態においては、上記のようにこれらの課題を解決することができる。
In contrast to the present embodiment, for example, in the
さらに、本実施の形態によれば、割込み要求をCPU10に通知する割込みコントローラ90を有することにより、診断モジュール40が診断プログラムに定義される条件に一致するか否かを判定し、比較条件が不成立の場合には、割込みコントローラ90に診断エラー割込み要求を出力し、割込みコントローラ90が診断モジュール40からの診断エラー割込みをCPU10に通知し、CPU10が診断エラー割込みに対応するプログラム処理を実行することができる。
Furthermore, according to the present embodiment, by having the interrupt
以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。 As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.
本発明は、マイコンに係わり、特に高い信頼性を必要とする制御機器において使用されるマイコンに適用して有効である。 The present invention relates to a microcomputer, and is particularly effective when applied to a microcomputer used in a control device that requires high reliability.
1…マイコン、2…外部バス、3…ネットワーク、4…センサー、5…ROM、10…CPU、20…ROM、21…RAM、30…バスブリッジ、40…診断モジュール、50…RAM、60,61,62…周辺モジュール、70…CPUバス、80…周辺バス、90…割込みコントローラ、91…外部バスコントローラ、400…制御状態レジスタ、401…診断プログラムアドレスレジスタ、402…診断対象アドレスレジスタ、403…診断対象データレジスタ、404…比較データレジスタ、405…マスクデータレジスタ、406…比較条件レジスタ、410…選択回路、411…診断プログラムアドレス生成回路、412…選択回路、413…診断モジュール出力データ選択回路、420,421…バスドライバ、422…バッファ、430,431…マスク回路、432…比較回路、440…制御論理。
DESCRIPTION OF
Claims (21)
前記周辺バスに接続される第2のメモリと、前記第2のメモリに記憶された診断プログラムを読み出して処理を行う診断モジュールとを有し、
前記診断モジュールは、前記診断プログラムでアドレス指定される前記周辺モジュールのレジスタを読み出して、前記診断プログラムで指定される比較条件に基づき、前記診断プログラムで指定される比較データと前記周辺モジュールのレジスタの値とを比較し、この比較条件が成立したか否かを示す信号を出力することを特徴とするマイクロコントローラ。 A CPU, a first memory for storing instructions and data executed by the CPU, a peripheral module, a CPU bus to which the CPU and the first memory are connected, and a peripheral bus to which the peripheral module is connected A microcontroller having a bus bridge for connecting the CPU bus and the peripheral bus when the CPU accesses the peripheral module;
A second memory connected to the peripheral bus; and a diagnostic module for reading and processing a diagnostic program stored in the second memory;
The diagnostic module reads the register of the peripheral module addressed by the diagnostic program, and compares the comparison data specified by the diagnostic program and the register of the peripheral module based on the comparison condition specified by the diagnostic program. A microcontroller that compares a value and outputs a signal indicating whether or not the comparison condition is satisfied.
前記周辺バスに接続される第2のメモリと、前記第2のメモリに記憶された診断プログラムを読み出して処理を行う診断モジュールとを有し、
前記診断モジュールは、前記診断プログラムでアドレス指定される前記周辺モジュールのレジスタを読み出して、前記診断プログラムで指定される比較条件に基づき、前記診断プログラムで指定される比較データと前記周辺モジュールのレジスタの値とを比較し、この比較条件が成立したか否かを判定し、比較条件が不成立の場合には、前記割込みコントローラに診断エラー割込み要求を出力し、
前記割込みコントローラは、前記診断モジュールからの診断エラー割込みを前記CPUに通知し、
前記CPUは、前記診断エラー割込みに対応するプログラム処理を実行することを特徴とするマイクロコントローラ。 A CPU, a first memory for storing instructions and data executed by the CPU, a peripheral module, an interrupt controller for notifying the CPU of an interrupt request, and a CPU bus to which the CPU and the first memory are connected And a peripheral bus to which the peripheral module is connected, and a bus bridge that connects the CPU bus and the peripheral bus when the CPU accesses the peripheral module,
A second memory connected to the peripheral bus; and a diagnostic module for reading and processing a diagnostic program stored in the second memory;
The diagnostic module reads the register of the peripheral module addressed by the diagnostic program, and compares the comparison data specified by the diagnostic program and the register of the peripheral module based on the comparison condition specified by the diagnostic program. Value is compared to determine whether this comparison condition is satisfied, and if the comparison condition is not satisfied, a diagnostic error interrupt request is output to the interrupt controller,
The interrupt controller notifies the CPU of a diagnostic error interrupt from the diagnostic module;
The microcontroller executes a program process corresponding to the diagnostic error interrupt.
前記診断プログラムは、読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式を含むことを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The microcontroller includes a format for specifying an address of a peripheral module register to be read and data to be compared with a value of the peripheral module register.
前記診断プログラムは、読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式を含むことを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic program includes a format for designating an address of a peripheral module register to be read, data to be compared with a value of the peripheral module register, and mask data for designating a bit to be compared with the peripheral module register. Microcontroller.
前記診断プログラムは、次に読み出す診断プログラムのアドレスを指定する形式を含むことを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The microcontroller includes a format for designating an address of a diagnostic program to be read next.
前記診断プログラムは、前記診断モジュールの処理を終了させることを指定する形式を含むことを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The microcontroller characterized in that the diagnostic program includes a format for designating the termination of the processing of the diagnostic module.
前記診断プログラムは、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、
次に読み出す診断プログラムのアドレスを指定する形式と、
診断モジュールの処理を終了させることを指定する形式と、のいずれの形式であるかを識別するための情報を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic program includes:
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
A format for designating an address of a peripheral module register to be read, data to be compared with the value of the peripheral module register, and mask data for designating a bit to be compared with the peripheral module register;
The format to specify the address of the diagnostic program to be read next,
A microcontroller having information for identifying which format is designated to end the processing of the diagnostic module, and which format is designated.
前記診断プログラムは、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、のいずれかの形式の場合に、前記読み出す周辺モジュールレジスタのビット長を示す情報を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic program includes:
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
In the case of any one of the formats for specifying the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data for specifying the bit to be compared with the peripheral module register, A microcontroller having information indicating a bit length of a peripheral module register to be read.
前記診断プログラムは、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、のいずれかの形式の場合に、前記周辺モジュールレジスタと比較データの比較条件として、一致、不一致、大きい、小さいを指定する情報を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic program includes:
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
In the case of any one of the formats for specifying the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data for specifying the bit to be compared with the peripheral module register, A microcontroller having information specifying match, mismatch, large, or small as a comparison condition between a peripheral module register and comparison data.
前記診断モジュールは、前記診断プログラムが、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、のいずれかの形式の場合に、前記診断プログラムの実行後に、読み出した周辺モジュールのレジスタに、前記診断プログラムで指定した比較データの値を書き込む機能を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic module includes the diagnostic program,
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
In the case of any one of the formats for specifying the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data for specifying the bit to be compared with the peripheral module register, A microcontroller having a function of writing a value of comparison data designated by the diagnostic program into a register of a read peripheral module after the diagnostic program is executed.
前記診断プログラムは、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、のいずれかの形式の場合に、前記診断モジュールが診断プログラムの実行後に、読み出した周辺モジュールのレジスタに、前記診断プログラムで指定した比較データの値を書き込むか否かを指定する情報を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic program includes:
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
In the case of any one of the formats for specifying the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data for specifying the bit to be compared with the peripheral module register, A microcontroller comprising: information specifying whether or not to write a value of comparison data specified by the diagnostic program into a register of a peripheral module that has been read after the diagnostic module has executed the diagnostic program.
前記診断モジュールは、前記診断プログラムが、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、のいずれかの形式の場合に、前記診断プログラムの実行後に、前記第2のメモリ中の前記診断プログラムで指定した比較データに、読み出した周辺モジュールのレジスタの値を書き込む機能を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic module includes the diagnostic program,
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
In the case of any one of the formats for specifying the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data for specifying the bit to be compared with the peripheral module register, A microcontroller having a function of writing a read register value of a peripheral module into comparison data designated by the diagnostic program in the second memory after execution of the diagnostic program.
前記診断プログラムは、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、のいずれかの形式の場合に、前記診断モジュールが診断プログラムの実行後に、前記第2のメモリ中の前記診断プログラムで指定した比較データに、読み出した周辺モジュールのレジスタの値を書き込むか否かを指定する情報を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic program includes:
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
In the case of any one of the formats for specifying the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data for specifying the bit to be compared with the peripheral module register, The diagnostic module has information for designating whether or not to write the value of the register of the read peripheral module into the comparison data designated by the diagnostic program in the second memory after the diagnostic program is executed. Microcontroller.
前記診断モジュールは、前記第2のメモリに記憶されたプログラムを読み出して処理を実行することを指定するための診断イネーブルレジスタを有し、前記診断イネーブルレジスタは、前記CPUから診断実行可および診断実行不可のいずれの値にも設定可能であることを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic module includes a diagnostic enable register for designating that the program stored in the second memory is read and the process is executed, and the diagnostic enable register can perform diagnostic execution from the CPU and perform diagnostic execution. A microcontroller that can be set to any of the impossible values.
前記診断モジュールは、前記第2のメモリに記憶されたプログラムを読み出して処理を実行中であるか否かを示すための診断実行中状態レジスタを有し、前記診断実行中状態レジスタは、前記CPUから読み出し可能であることを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic module includes a diagnostic execution status register for indicating whether the program stored in the second memory is read and processing is being executed, and the diagnostic execution status register is the CPU A microcontroller which can be read from
前記診断モジュールは、前記第2のメモリに記憶された、前記診断モジュールの処理を終了させることを指定する形式のプログラムを読み出した場合に、診断が終了したことを外部に出力する信号を有することを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic module has a signal for outputting to the outside that the diagnosis has been completed when a program stored in the second memory is designated so that the process of the diagnostic module is to be terminated. A microcontroller characterized by
前記診断モジュールは、前記第2のメモリに記憶された、前記診断モジュールの処理を終了させることを指定する形式のプログラムを読み出した場合に、診断が終了したことを外部に出力するか否かを指定するための診断終了割込みイネーブルレジスタを有し、前記診断終了割込みイネーブルレジスタは、前記CPUから読み出しおよび書き込み可能であることを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
Whether or not to output the fact that the diagnosis has been completed to the outside when the diagnostic module reads out a program stored in the second memory that specifies the termination of the processing of the diagnostic module A microcontroller comprising a diagnostic end interrupt enable register for designating, wherein the diagnostic end interrupt enable register is readable and writable from the CPU.
前記診断モジュールは、診断が終了したか否かを示すための診断終了状態レジスタを有し、前記診断終了状態レジスタは、前記CPUから読み出し可能であることを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
2. The microcontroller according to claim 1, wherein the diagnostic module includes a diagnostic end status register for indicating whether or not the diagnosis is completed, and the diagnostic end status register can be read from the CPU.
前記診断モジュールは、前記第2のメモリに記憶された、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータとを指定する形式と、
読み出す周辺モジュールレジスタのアドレスと、前記周辺モジュールレジスタの値と比較するデータと、前記周辺モジュールレジスタの比較するビットを指定するマスクデータとを指定する形式と、のいずれかの形式のプログラムを実行し、前記プログラムで指定した診断条件が不成立の場合に、診断エラー割込み信号を出力するか否かを指定するための診断エラー割込みイネーブルレジスタを有し、前記診断エラー割込みイネーブルレジスタは、前記CPUから読み出しおよび書き込み可能であることを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic module is stored in the second memory,
A format for designating the address of the peripheral module register to be read and the data to be compared with the value of the peripheral module register;
Execute a program in one of the formats: specifying the address of the peripheral module register to be read, the data to be compared with the value of the peripheral module register, and the mask data specifying the bit to be compared in the peripheral module register A diagnostic error interrupt enable register for designating whether or not to output a diagnostic error interrupt signal when a diagnostic condition designated by the program is not satisfied, and the diagnostic error interrupt enable register is read from the CPU And a writable microcontroller.
前記診断モジュールは、診断エラーが発生したか否かを示すための診断エラー状態レジスタを有し、前記診断エラー状態レジスタは、前記CPUから読み出しおよび書き込み可能であることを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The microcontroller, wherein the diagnostic module has a diagnostic error status register for indicating whether or not a diagnostic error has occurred, and the diagnostic error status register is readable and writable from the CPU.
前記診断モジュールは、診断プログラムの実行後に次の診断プログラムを読み出すまでのウエイトサイクル数を設定するウエイトサイクルレジスタを有し、前記ウエイトサイクルレジスタは、前記CPUから読み出しおよび書き込み可能であることを特徴とするマイクロコントローラ。 The microcontroller according to claim 1 or 2,
The diagnostic module has a wait cycle register for setting the number of wait cycles until the next diagnostic program is read after execution of the diagnostic program, and the wait cycle register is readable and writable from the CPU. A microcontroller to do.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004366971A JP2006172331A (en) | 2004-12-20 | 2004-12-20 | Microcontroller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004366971A JP2006172331A (en) | 2004-12-20 | 2004-12-20 | Microcontroller |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006172331A true JP2006172331A (en) | 2006-06-29 |
Family
ID=36672994
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004366971A Pending JP2006172331A (en) | 2004-12-20 | 2004-12-20 | Microcontroller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006172331A (en) |
-
2004
- 2004-12-20 JP JP2004366971A patent/JP2006172331A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5717851A (en) | Breakpoint detection circuit in a data processor and method therefor | |
JP3563768B2 (en) | ROM program change device | |
JPH1078889A (en) | Microcomputer | |
JP3432734B2 (en) | DMA control device and DMA control method | |
JPS5938677B2 (en) | Control word transfer control device | |
JP2006172331A (en) | Microcontroller | |
CN110609705B (en) | Method for improving MCU bus efficiency, intelligent terminal, storage medium and chip | |
EP0827080A2 (en) | Mircrocomputer with selfdiagnostic unit | |
JP2004013289A (en) | On-chip debugging method of microcontroller | |
JPH04280334A (en) | One chip microcomputer | |
JP3433824B2 (en) | Failure detection device for pulse input / output circuit | |
JP2004185060A (en) | Microcomputer | |
JPH10312307A (en) | Emulator for computer system | |
JPS63165931A (en) | Storing system for information on discontinuous instruction fetch address | |
CN116361233A (en) | Micro controller | |
JPH0782447B2 (en) | DMA data transfer control device | |
JPS62269237A (en) | Data processor | |
JPH0652333A (en) | Single chip microcomputer | |
JPH11212945A (en) | Microcomputer and it memory | |
JP2007206909A (en) | Data processor and data processing method | |
JPS60201437A (en) | Microprocessor | |
JPH0333939A (en) | Microprocessor | |
JPH0535499A (en) | Data processing device and method | |
JP2002150795A (en) | Semiconductor integrated circuit | |
JPH04367902A (en) | Programmable controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Effective date: 20070205 Free format text: JAPANESE INTERMEDIATE CODE: A621 |
|
A977 | Report on retrieval |
Effective date: 20081119 Free format text: JAPANESE INTERMEDIATE CODE: A971007 |
|
A131 | Notification of reasons for refusal |
Effective date: 20090203 Free format text: JAPANESE INTERMEDIATE CODE: A131 |
|
A02 | Decision of refusal |
Effective date: 20090707 Free format text: JAPANESE INTERMEDIATE CODE: A02 |