JP6070600B2 - Microcomputer - Google Patents
Microcomputer Download PDFInfo
- Publication number
- JP6070600B2 JP6070600B2 JP2014031698A JP2014031698A JP6070600B2 JP 6070600 B2 JP6070600 B2 JP 6070600B2 JP 2014031698 A JP2014031698 A JP 2014031698A JP 2014031698 A JP2014031698 A JP 2014031698A JP 6070600 B2 JP6070600 B2 JP 6070600B2
- Authority
- JP
- Japan
- Prior art keywords
- mode
- test mode
- communication
- microcomputer
- signal
- 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.)
- Expired - Fee Related
Links
Images
Description
本発明は、外部より動作モードを切り替えてテストモードの実行が可能であり、ブレーク要求信号が入力されると、実行中の動作を停止させるCPUを備えてなるマイクロコンピュータに関する。 The present invention relates to a microcomputer that includes a CPU capable of executing a test mode by switching an operation mode from the outside and stopping an operation being executed when a break request signal is input.
マイクロコンピュータ(以下、マイコンと称す)には、所謂オンチップ・デバッグ(以下、OCDと称す)機能を備えており、外部より動作モードを切り替えてテストモードの実行が可能に構成されているものがある。そして、テストモードを実行する際には、マイコンをパーソナルコンピュータ等のデバッガと接続して通信可能とし、デバッガがブレーク要求信号を発行した際にCPUが実行中の動作を停止させるOCDブレーク機能も必要となる。 A microcomputer (hereinafter referred to as a microcomputer) has a so-called on-chip debugging (hereinafter referred to as OCD) function, and is configured to be able to execute a test mode by switching the operation mode from the outside. is there. When executing the test mode, an OCD break function is required to connect the microcomputer to a debugger such as a personal computer so that communication is possible, and when the debugger issues a break request signal, the CPU stops the operation being executed. It becomes.
また、マイコンには、低コスト化及び小型化が不断に要求されているため、製品として通常モードで動作する際には不要となる検査用の端子は極力少なくしたいという事情がある。例えば、特許文献1に開示されている技術は、半導体集積回路にテスト用カウンタ31を備え、テスト信号T0がアサートされている期間をクロック信号にカウントし、最終カウント値C0をテストモードデコーダ33でデコードすることで、多様なテストモードを設定可能にしている。また、マイコンのリセット端子に与えるリセット信号の長さをリセット信号生成回路32でカウントし、そのカウント値が所定値未満の場合は通常(ユーザロジック回路20)のリセットを行い、所定値以上の場合はテスト用カウンタ31をリセットする。
In addition, since the microcomputer is constantly required to be low in cost and downsized, there is a circumstance that it is desired to minimize the number of inspection terminals that are unnecessary when operating in the normal mode as a product. For example, the technique disclosed in
しかしながら、特許文献1では、半導体集積回路をデバッガに接続した状態でデバッグを行うことは想定しておらず、特定のテストモードを設定すると、そのモードに応じて自律的にテストを実行する構成となっている。したがって、デバッガが発行したブレーク要求を受け付けることも想定されていない。リセット信号の長さに応じて与える信号の種類を変化させる構成を利用してブレーク要求を与えることを想定すると、マイコンを起動させる際にCPUがブレーク供給を受け付けて、起動が停止することになってしまう。
However,
本発明は上記事情に鑑みてなされたものであり、その目的は、動作モードの切り替えと、外部との通信と、ブレーク要求信号の入力とを、極力少ない端子で実現可能とするマイクロコンピュータを提供することにある。 The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a microcomputer capable of realizing operation mode switching, external communication, and break request signal input with as few terminals as possible. There is to do.
請求項1記載のマイクロコンピュータによれば、外部より動作モードの切り替えを行うために使用されると共に、回路動作をテストするためのテストモードにおいて、外部とCPUとが通信を行うために使用されるモード切替え/通信用端子を備える。また、初期状態で通常動作モードが設定されていると共に、モード切替え/通信用端子を介して行われる通信により、テストモード書き込みコマンドが入力されるとテストモードが設定されるテストモードレジスタを備える。 According to the microcomputer of the first aspect, the microcomputer is used for switching the operation mode from the outside, and is used for communication between the outside and the CPU in the test mode for testing the circuit operation. A mode switching / communication terminal is provided. In addition, a normal operation mode is set in the initial state, and a test mode register is provided in which a test mode is set when a test mode write command is input by communication performed via a mode switching / communication terminal.
そして、カウンタは、モード切替え/通信用端子に接続され、当該端子のレベルがアクティブに維持されている間カウント動作を継続し、第1比較器は、カウンタのカウンタ値が、前記通信に要する時間よりも長く設定される第1閾値以上で、且つ前記第1閾値よりも大きく設定される第2閾値未満であればCPUにブレーク要求信号を出力する。また、第2比較器は、前記カウンタ値が、前記第2閾値以上になると、テストモードを無効化して通常動作モードを設定するための信号を出力する。このように構成すれば、動作モードの切り替えと、外部との通信と、ブレーク要求信号の入力とを1つのモード切替え/通信用端子を利用して行うことができる。 The counter is connected to the mode switching / communication terminal and continues counting while the level of the terminal is maintained active. The first comparator determines that the counter value of the counter is the time required for the communication. A break request signal is output to the CPU if it is greater than or equal to the first threshold set longer than the first threshold and less than the second threshold set greater than the first threshold . The second comparator, the counter value becomes equal to or larger than the second threshold value, outputs a signal for setting the normal operation mode to disable the test mode. If comprised in this way, switching of an operation mode, communication with the exterior, and the input of a break request signal can be performed using one mode switching / communication terminal.
(第1実施形態)
図1に示すように、マイクロコンピュータ(マイコン)1は、CPU2と、ROM3,RAM4,周辺回路5A及び5Bなどが、アドレスバス6及びデータバス7を介して相互に接続されている。また、アドレスバス6及びデータバス7には、バス制御切替回路8が挿入されており、バス制御切替回路8を介してモード/通信回路9が接続されている。モード/通信回路9は、双方向I/O回路10を介して、マイコン1の外部端子であるモード/通信端子11(モード切替え/通信用端子)に接続されている。
(First embodiment)
As shown in FIG. 1, in a
モード/通信端子11は、外部よりマイコン1の動作モードを切り替え設定するために使用されると共に、動作モードとしてテストモードが設定された際に、例えばパーソナルコンピュータ等のデバッガ(図示せず)が接続されてCPU2とシリアル通信を行うために使用される。モード/通信回路9は、上記の通信を仲介してマイコン1のOCD機能を実現するための回路である。
The mode /
双方向I/O回路10は、モード/通信回路9の通信インターフェイス(I/F)部12に接続されている。通信I/F部12は、双方向I/O回路10との間で、信号の受信と送信とをそれぞれ1線式(シリアル)通信により行うもので、通信I/F部12が受信した信号は、受信デコーダ13においてデコードされてOCDコマンドが発行される。また、通信I/F部12の送信フレーム生成部14は、CPU2が出力したコマンド応答データが入力されると、そのデータを含む送信フレームを生成して双方向I/O回路10に送信する。
The bidirectional I /
上記OCDコマンドは、OCDコマンドI/F部15に入力され、ここでコマンドに対応したアドレス及びデータが生成されてバス制御切替回路8に出力される。また、OCDコマンドI/F部15は、入力されるOCDコマンドに応じて、バス制御切替回路8のバス制御状態を選択する信号を出力する。バス制御切替回路8は、マイコン1がノーマルモード(通常動作モード)に設定されている場合はモード/通信回路9を切り離し、CPU2が通常通り、アドレスバス6及びデータバス7を介してROM3,RAM4,周辺回路5にアクセス可能となるように制御する。
The OCD command is input to the OCD command I /
一方、マイコン1がテストモードに設定された場合、バス制御切替回路8は、OCDコマンドI/F部15を介して発行されたコマンドを、CPU2が受信可能となるように制御する。例えば、上記コマンドは、周辺回路5A内に設けられているOCDコマンドバッファに格納され、CPU2は周辺回路5AにアクセスしてOCDコマンドを取得する。その他、OCDコマンドバッファをバス制御切替回路8の内部に設けても良い。
On the other hand, when the
また、テストモードでは、与えられたOCDコマンドに応じてCPU2が外部のデバッガに送信するデータが、バス制御切替回路8及びOCDコマンドI/F部15を介して通信I/F部12の送信フレーム生成部14に入力される。これにより、外部のデバッガとマイコン1のCPU2との間の双方向通信を可能にしている。
In the test mode, the data transmitted by the
また、OCDコマンドは、テストモードレジスタ16にも入力されている。テストモードレジスタ16は、リセットされた初期状態でノーマルモード設定信号を出力しており、OCDコマンドによりテストモードの設定が指示された場合にテストモード設定信号を出力する。これらのモード設定信号は、テストモード無効化部17を介して、例えば周辺回路5A,5B等に出力されている。
The OCD command is also input to the
双方向I/O回路10の出力端子は、カウンタレジスタ18の入力端子にも接続されており、カウンタレジスタ18は、上記出力端子がアクティブ(例えばロー)レベルとなっている期間をカウントし、カウント値を第1比較器19及び第2比較器20に出力する。尚、図示しないが、モード/通信回路9の各回路は、共通の内部クロック信号によりクロック同期で動作する。また、テストモードレジスタ16及びカウンタレジスタ18には、(マイコン1の)リセット信号が与えられている。
The output terminal of the bidirectional I /
第1比較器19は、カウンタレジスタ18のカウント値が閾値Y以上になるとブレーク要求を検出し、OCDブレーク要求をOCDブレーク無効化部21を介してCPU2に出力する。第2比較器20は、カウンタレジスタ18のカウント値が閾値Z以上になるとノーマルモードの設定要求を検出し、テストモードの無効化信号をテストモード無効化部17に出力する。尚、モード無効化部17より出力されるノーマルモード設定信号は、OCDコマンドI/F部15及びOCDブレーク無効化部21にも入力されている。そして、テストモードレジスタ16がテストモード設定信号を出力している状態で、上記テストモード無効化信号が出力されると、テストモード設定信号は無効化されて、ノーマルモード設定信号が有効になる。
The
ここで、図2に示すように、モード/通信端子11を介した信号制御には3つのパタンがある。(a)のデバッグ通信では、ハイレベルからローレベルに切り替わるとそれがスタートビット(Start Of Flame)となり、それに続いて複数のデータビットがハイ/ロウの二値レベル変化で示される。そして、最後にハイレベルのエンドビット(End Of Flame)が配置され、そこまでが通信の1フレームとなる。そして、この通信フレーム長は、カウンタレジスタ18のカウント値X未満に設定されている。
Here, as shown in FIG. 2, the signal control via the mode /
(b)のOCDブレーク要求は、ローレベル期間をカウント値Y(>X,第1閾値)以上で且つZ未満とするように設定されている。そして、(c)のモード管理(ノーマルモード設定)は、ローレベル期間をカウント値Z(第2閾値)以上とするように設定されている。尚、OCDブレーク要求は、マイコン1がテストモードで動作している場合にのみ有効となる。
The OCD break request in (b) is set so that the low level period is not less than the count value Y (> X, first threshold) and less than Z. The mode management (normal mode setting) in (c) is set so that the low level period is equal to or greater than the count value Z (second threshold). The OCD break request is valid only when the
すなわち、外部のデバッガは、これらのようにモード/通信端子11に与える信号を制御することで、マイコン1に与える信号に異なる意義を付与可能となっている。具体数値例を挙げると、(a)のデバッグ通信に要する時間は数μs程度,(b)のOCDブレーク要求を有効にする時間は数10μs程度,(c)のノーマルモード設定を有効にする時間は数1000μs程度である。
That is, the external debugger can give different meanings to the signal applied to the
また、モード/通信端子11は、マイコン1を製品としてフィールドで使用する際には、ノーマルモードに設定するためローレベルに固定される。この時、カウンタレジスタ19がカウント動作を開始するタイミングは、マイコン1のリセットが解除された時点からとなる(図3参照)。
The mode /
次に、本実施形態の作用について説明する。図4に示すように、マイコン1のデバッグを実行する際には、外部でデバッガを起動させてマイコン1の評価を開始する(D1)。先ず、モード/通信端子11を介してデバッグ通信を行い、テストモードレジスタ16への書き込みコマンド(テストモード設定)を発行する(D2)。すると、マイコン1側では、受信したコマンドを受けてテストモードレジスタ16への書き込みが行われ、テストモードが設定される(M1)。
Next, the operation of this embodiment will be described. As shown in FIG. 4, when debugging the
続いて、デバッガは、デバッグ通信によりCPUバス(アドレスバス6及びデータバス7)の制御コマンドを発行し、更にCPU2にソフトウェアリセットを実行させるコマンドを発行する(D3)。すると、マイコン1側では、受信したコマンドを受けて、ソフトウェアリセットが実行されてCPU2が初期化され、ソフトウェアの実行が再スタートされる(M2)。
Subsequently, the debugger issues a control command for the CPU bus (
以降、デバッガは、ステップD3と同様に、CPUバスの制御コマンドを発行し、評価を行うためのコマンドを発行する(D4)。すると、マイコン1は、受信したコマンドに応じてCPUバスに接続されている回路,周辺回路5やRAM4等の回路情報を読み出し、読み出した情報を「コマンド応答データ」として外部(デバッガ)に送信する(M3)。尚、「回路情報」とは、例えばRAM4に格納されているフラグやデータなどである。
Thereafter, the debugger issues a control command for the CPU bus and issues a command for evaluation (D4), as in step D3. Then, the
そして、評価の内容に応じてステップD3→M3を適宜繰り返して実行した後、デバッガがOCDブレーク要求を発行すると(D5)、マイコン1のCPU2は、OCDブレーク要求を受け付けて、その時点で通信を実行していれば転送中の通信を停止させる(M4)。そして、マイコン1のデバッグ,評価は終了となる(D6)。
Then, after repeatedly executing steps D3 → M3 according to the contents of the evaluation, when the debugger issues an OCD break request (D5), the
以上のように本実施形態によれば、マイコン1に、外部より動作モードの切り替えを行うために使用されると共に、回路動作をテストするためのテストモードにおいて、外部とCPU2とが通信を行うために使用されるモード/通信端子11を備える。また、初期状態でノーマルモードが設定されていると共に、モード/通信端子11を介して行われる通信により、テストモード書き込みコマンドが入力されるとテストモードが設定されるテストモードレジスタ15を備える。
As described above, according to the present embodiment, the
そして、カウンタレジスタ18は、モード/通信端子11に接続され、当該端子のレベルがアクティブに維持されている間カウント動作を継続し、第1比較器19は、カウンタレジスタ18のカウンタ値が、前記通信に要する時間よりも長く設定される第1閾値Y以上で、且つ前記第1閾値Yよりも大きく設定される第2閾値Z未満であれば、CPU2にブレーク要求信号を出力する。また、第2比較器20は、前記カウンタ値が、第2閾値Z以上になると、テストモードを無効化してノーマルモードを設定するための信号を出力する。このように構成すれば、動作モードの切り替えと、外部との通信と、ブレーク要求信号の入力とを1つのモード/通信端子11を利用して行うことができる。したがって、マイコン1を小型に構成することが可能になる。
The
(第2実施形態)
以下、第1実施形態と同一部分には同一符号を付して説明を省略し、異なる部分について説明する。図5に示すように、第2実施形態のマイコン31は、第1実施形態のマイコン1におけるテストモード無効化部17を削除し、第2比較器20が出力するノーマルモード検出信号をテストモードレジスタ32に入力している。そして、テストモードレジスタ32は、ノーマルモード検出信号が与えられるとリセットされて、テストモード設定信号を出力している状態であればその出力を停止し、ノーマルモード検出信号を出力する。
(Second Embodiment)
Hereinafter, the same parts as those in the first embodiment are denoted by the same reference numerals, description thereof will be omitted, and different parts will be described. As shown in FIG. 5, the
以上のように第2実施形態によれば、第2比較器20は、テストモードレジスタ32をリセットする信号を出力してテストモードを無効化するので、第1実施形態と同様の効果が得られる。
As described above, according to the second embodiment, since the
本発明は上記し、又は図面に記載した実施形態にのみ限定されるものではなく、以下のような変形又は拡張が可能である。
アドレスバス6及びデータバス7に接続される周辺回路の構成,種類は任意である。
CPU2がステップM2で実行するソフトウェアは、アプリケーションプログラムとは別個に用意されているテスト用のプログラムであっても良い。
The present invention is not limited to the embodiments described above or shown in the drawings, and the following modifications or expansions are possible.
The configuration and type of peripheral circuits connected to the
The software executed by the
図面中、1はマイクロコンピュータ、2はCPU、9はモード/通信回路、11はモード/通信端子(モード切替え/通信用端子)、16はテストモードレジスタ、18はカウンタレジスタ、19は第1比較器、20は第2比較器を示す。 In the drawings, 1 is a microcomputer, 2 is a CPU, 9 is a mode / communication circuit, 11 is a mode / communication terminal (mode switching / communication terminal), 16 is a test mode register, 18 is a counter register, and 19 is a first comparison. 20 represents a second comparator.
Claims (2)
外部より動作モードの切り替えを行うために使用されると共に、回路動作をテストするためのテストモードにおいて、外部と前記CPUとが通信を行うために使用されるモード切替え/通信用端子(11)と、
このモード切替え/通信用端子に接続され、当該端子のレベルがアクティブに維持されている間カウント動作を継続するカウンタ(18)と、
初期状態で通常動作モードが設定されていると共に、前記モード切替え/通信用端子を介して行われる通信により、テストモード書き込みコマンドが入力されるとテストモードが設定されるテストモードレジスタ(16,32)と、
前記カウンタのカウンタ値が、前記通信に要する時間よりも長く設定される第1閾値以上で、且つ前記第1閾値よりも大きく設定される第2閾値未満であれば前記ブレーク要求信号を出力する第1比較器(19)と、
前記カウンタのカウンタ値が、前記第2閾値以上になると、前記テストモードを無効化して前記通常動作モードを設定するための信号を出力する第2比較器(20)とを備えたことを特徴とするマイクロコンピュータ。 When the break request signal is input, the CPU (2) that stops the operation being executed;
A mode switching / communication terminal (11) used for switching the operation mode from the outside and used for communication between the CPU and the outside in a test mode for testing the circuit operation ,
A counter (18) connected to the mode switching / communication terminal and continuing the counting operation while the level of the terminal is maintained active;
A normal operation mode is set in the initial state, and a test mode register (16, 32) that sets a test mode when a test mode write command is input by communication performed via the mode switching / communication terminal. )When,
Count value of the counter is, at the least the first threshold value is set longer than the time required for communication, the you output a break request signal if and second less than a threshold value is set larger than the first threshold value A first comparator (19);
Count value of the counter becomes equal to or larger than before Symbol second threshold, further comprising a second comparator for outputting a signal for setting the normal operation mode to disable the test mode (20) A featured microcomputer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014031698A JP6070600B2 (en) | 2014-02-21 | 2014-02-21 | Microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014031698A JP6070600B2 (en) | 2014-02-21 | 2014-02-21 | Microcomputer |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015156196A JP2015156196A (en) | 2015-08-27 |
JP6070600B2 true JP6070600B2 (en) | 2017-02-01 |
Family
ID=54775456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014031698A Expired - Fee Related JP6070600B2 (en) | 2014-02-21 | 2014-02-21 | Microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6070600B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7202225B2 (en) * | 2019-03-12 | 2023-01-11 | ローム株式会社 | Semiconductor device and debug system |
US20200341058A1 (en) * | 2019-04-28 | 2020-10-29 | Nuvoton Technology Corporation | Time-limited debug mode |
EP4331838A1 (en) | 2021-04-28 | 2024-03-06 | Kureha Corporation | Piezoelectric laminated film and method for producing piezoelectric laminated film |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5727041A (en) * | 1980-07-25 | 1982-02-13 | Hitachi Ltd | Large-scale integrated circuit having testing function |
JPS63228336A (en) * | 1987-03-18 | 1988-09-22 | Fujitsu Ltd | Runaway prevention circuit for processor |
JPH0219931A (en) * | 1988-07-08 | 1990-01-23 | Fujitsu Ltd | Test mode control system for microprocessor |
JP2002202900A (en) * | 2000-12-28 | 2002-07-19 | Seiko Epson Corp | Debug device |
JP2005274357A (en) * | 2004-03-25 | 2005-10-06 | Kawasaki Microelectronics Kk | Semiconductor integrated circuit |
-
2014
- 2014-02-21 JP JP2014031698A patent/JP6070600B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2015156196A (en) | 2015-08-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4652394B2 (en) | Multiburst protocol device controller | |
US9275000B2 (en) | Electronic device with address programmable through reduced number of terminals | |
KR101283431B1 (en) | Microcomputer | |
JP2009099054A (en) | Semiconductor integrated circuit and debug mode determination method | |
JP6070600B2 (en) | Microcomputer | |
JP6546479B2 (en) | Information processing device | |
US20160350024A1 (en) | Integrated circuit chip and method therefor | |
US20150106636A1 (en) | Data processor and data processing system | |
US10977206B2 (en) | Data communication device and method for data communication | |
JP5918192B2 (en) | Data processing apparatus and method in PLC system | |
US10067852B2 (en) | Switching between traditional and history program trace modes without halting a processor | |
KR100826496B1 (en) | Semiconductor integrated circuit device and operating method thereof | |
JP2008041059A (en) | Multiprocessor controller and information processor | |
TWI473110B (en) | Flash memory apparatus with serial interface and rsest method thereof | |
JP2009163531A (en) | Interruption management mechanism and microcomputer | |
US9378782B1 (en) | Apparatus with write-back buffer and associated methods | |
JP2020140380A (en) | Semiconductor device and debugging system | |
JP5917325B2 (en) | Bridge circuit | |
JP6396352B2 (en) | Semiconductor device | |
US11841782B2 (en) | Semiconductor device and debugging system | |
JP2008033657A (en) | Memory control device, information processor and memory control method | |
JP2012216108A (en) | Information processing apparatus and program transfer method | |
TWI581103B (en) | Method and system for implementing bus operations with precise timing | |
JP6626216B2 (en) | controller | |
US20140281759A1 (en) | Bus protocol checker, system on chip including the same, bus protocol checking method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160415 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160907 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20161018 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20161116 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20161206 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20161219 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6070600 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |