JPH0934864A - Single chip microcomputer - Google Patents

Single chip microcomputer

Info

Publication number
JPH0934864A
JPH0934864A JP7178449A JP17844995A JPH0934864A JP H0934864 A JPH0934864 A JP H0934864A JP 7178449 A JP7178449 A JP 7178449A JP 17844995 A JP17844995 A JP 17844995A JP H0934864 A JPH0934864 A JP H0934864A
Authority
JP
Japan
Prior art keywords
terminal
signal
program
input
rom
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP7178449A
Other languages
Japanese (ja)
Inventor
Kenji Ono
謙次 大野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP7178449A priority Critical patent/JPH0934864A/en
Publication of JPH0934864A publication Critical patent/JPH0934864A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide the single chip microcomputer in which an application program is corrected while being mounted on a device without increasing the number of terminals of the single chip microcomputer. SOLUTION: An ACL terminal 23 and a TEST terminal 24 in the single chip microcomputer 11 are part of external connection terminals prepared in advance for program operation. When a debug program stored in a monitor ROM 16 is started, a connection state in a terminal input signal selector 20 is switched to send/receive data required for debugging the user program to/ from a terminal equipment 31 via the ACL terminal 23 and the TEST terminal 24.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、ROM(Read Onl
y Memory)に書込まれたプログラムを実行する機器組込
み型のシングルチップマイクロコンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a ROM (Read Onl
y Memory) is a device-incorporated single-chip microcomputer that executes a program written in the memory.

【0002】[0002]

【従来の技術】従来、一般的に用いられているシングル
チップマイクロコンピュータ(以下単にマイクロコンピ
ュータと称す。)は、機器に組込まれて使用され、内部
のROMに格納されているユーザプログラムによって機
器の制御を行っている。一般的なマスクROM版マイク
ロコンピュータにおいては、マイクロコンピュータ内部
の情報を出力したり、ユーザプログラムの修正を行うた
めの専用の機能が無いために機器に組込まれた状態、す
なわち実際に動作する状態でユーザプログラムのデバッ
グを行うことが困難である。また、ユーザプログラムの
デバッグが可能であってもユーザプログラムはマイクロ
コンピュータのROMに格納されているので、ROMが
マスクROMである場合にはユーザプログラムの書換え
を行うことは困難である。
2. Description of the Related Art Conventionally, a generally used single-chip microcomputer (hereinafter simply referred to as "microcomputer") is used by being incorporated in a device and used by a user program stored in an internal ROM. We are in control. In a general mask ROM version microcomputer, there is no dedicated function for outputting the information inside the microcomputer or modifying the user program, so that it is installed in the equipment, that is, in the state where it actually operates. It is difficult to debug the user program. Further, even if the user program can be debugged, the user program is stored in the ROM of the microcomputer. Therefore, when the ROM is a mask ROM, it is difficult to rewrite the user program.

【0003】上述のようなマイクロコンピュータの開発
は、ICE(In Circuit Emulator)を用いて行われ
る。ICEによってマイクロコンピュータの開発を行う
際には、ユーザプログラムが格納されたROMなどの代
わりにエバリュエーションチップ(以後、「エバーチッ
プ」と称する)を用いる。エバーチップは、マイクロコ
ンピュータにおける端子からの出力だけでなく、内部の
構成要素をそれぞれ接続する信号線における信号レベル
を取出すことができるような構造となっており設けられ
る端子の数が多い。したがって、前記ROMと同じ様に
機器に組込むことができない。そのため、前記ROMが
挿入されるソケットなど、エバーチップ、ICEをケー
ブルで接続しなければならない。ケーブルによって接続
するのでケーブルを介して入力されるノイズなどの影響
についても考慮しなければならない。
Development of the microcomputer as described above is performed by using ICE (In Circuit Emulator). When developing a microcomputer by ICE, an evaluation chip (hereinafter referred to as "ever chip") is used instead of a ROM or the like in which a user program is stored. The ever-chip has a structure that can take out not only the output from the terminal in the microcomputer but also the signal level in the signal lines connecting the internal components, and the number of terminals provided is large. Therefore, it cannot be incorporated in the same device as the ROM. Therefore, the ever chip and ICE such as the socket into which the ROM is inserted must be connected by a cable. Since they are connected by a cable, it is necessary to consider the effect of noise input through the cable.

【0004】また、エバーチップは、マスクROM版マ
イクロコンピュータとは製造プロセスが異なるので、電
気的な特性などが異なる可能性があり、マイクロコンピ
ュータの最終的な評価に用いるには問題がある。
Further, since the EverChip has a different manufacturing process from that of the mask ROM version microcomputer, it may have different electrical characteristics and the like, and there is a problem in using it for the final evaluation of the microcomputer.

【0005】マイクロコンピュータを組込もうとする機
器に直接装着してプログラムの動作評価を行うことがで
きるシングルチップマイクロコンピュータとしてOTP
(One Time Programmable ROM)版がある。OTP版
は、外見的には前記マスクROM版と同様であるので機
器に組込んでプログラムの動作評価を行うことができる
けれども、マイクロコンピュータ内部の情報を外部に出
力する機能を有していないので、プログラムのデバッグ
を行うには非常に手間がかかる。
An OTP as a single-chip microcomputer capable of directly evaluating the operation of a program by directly mounting the microcomputer in a device to be incorporated.
(One Time Programmable ROM) version is available. Since the OTP version is similar to the mask ROM version in appearance, it can be incorporated into a device to evaluate the operation of the program, but it does not have the function of outputting information inside the microcomputer to the outside. , It takes a lot of time to debug a program.

【0006】上述のような従来の技術における問題点を
解決するための第1の技術は、特開平4−332051
号公報に開示されている。第1の先行技術においては、
マイクロコンピュータに備えられるROMにユーザプロ
グラムと共にデバッグ用のプログラムが格納されてい
る。マイクロコンピュータに設けられる通信用のインタ
フェイスを介して端末装置に内部情報を出力し、端末装
置からデバッグコマンドなどが入力される。デバッグ開
始時には、ROMの内容を全てマイクロコンピュータ内
のRAMに読込み、デバッグ用のプログラムはRAMに
対してアクセスするようにする。
A first technique for solving the above-mentioned problems in the conventional technique is disclosed in Japanese Patent Laid-Open No. 4-332051.
No. 6,086,045. In the first prior art,
A ROM provided in the microcomputer stores a program for debugging together with a user program. Internal information is output to the terminal device via a communication interface provided in the microcomputer, and a debug command or the like is input from the terminal device. At the start of debugging, the entire contents of the ROM are read into the RAM in the microcomputer, and the program for debugging accesses the RAM.

【0007】また、第2の技術は、特開平3−2029
24号公報に開示されている。第2の先行技術において
は、デバッグ用のプログラムを記憶した装置とのインタ
フェイスをマイクロコンピュータ内に設けている。マイ
クロコンピュータ内部の端子の切換え状態によってユー
ザプログラムを実行させるかユーザプログラムのデバッ
グを行うかを選択する。この先行技術では、デバッグ用
のプログラムはマイクロコンピュータ外部のデバッグ装
置に記憶されており、デバッグ装置のエミュレーション
用のメモリにユーザプログラムを読込んでユーザプログ
ラムのデバッグを行う。機器に組込まれているマイクロ
コンピュータを介してデバッグ装置からのコマンドが入
力されて動作の確認が行われる。
The second technique is disclosed in Japanese Patent Laid-Open No. 3-2029.
No. 24 discloses this. In the second prior art, an interface with a device that stores a debugging program is provided in the microcomputer. Whether the user program is executed or the user program is debugged is selected depending on the switching state of terminals inside the microcomputer. In this prior art, the debugging program is stored in the debugging device outside the microcomputer, and the user program is read by loading it into the emulation memory of the debugging device. A command is input from a debug device via a microcomputer incorporated in the device to confirm the operation.

【0008】また、第3の技術は特開昭61−5805
2号公報に開示されている。第3の先行技術におけるデ
バッグ装置では、アプリケーションプログラムが記憶さ
れているROMに置換えて前記ROMが装着されるソッ
ケトにプローブを挿入してマイクロコンピュータと信号
の授受を行う。デバッグ装置のRAMには、デバッグし
ようとするユーザプログラムが記憶されており、このプ
ログラムに対してデバッグを行う。デバッグ用のプログ
ラムはデバッグ装置内のROMに記憶されている。
The third technique is disclosed in Japanese Patent Laid-Open No. 61-5805.
No. 2 discloses this. In the debug device according to the third prior art, a probe is inserted into the socket in which the ROM storing the application program is replaced with the ROM storing the application program, and signals are exchanged with the microcomputer. A user program to be debugged is stored in the RAM of the debugging device, and this program is debugged. The debug program is stored in the ROM in the debug device.

【0009】[0009]

【発明が解決しようとする課題】第1の先行技術では、
通信に用いている端子は、通信専用の端子でありマイク
ロコンピュータにおける端子数の増加を招いている。
SUMMARY OF THE INVENTION In the first prior art,
The terminal used for communication is a terminal exclusively for communication, which causes an increase in the number of terminals in the microcomputer.

【0010】また、第2の先行技術では、ユーザプログ
ラムのデバッグを行うにはデバッグ用のプログラムを備
えた装置が別途必要となり、容易にデバッグを行うこと
ができない。データ転送用の端子が複数であるので端子
の切換えを行う切換え装置が必要とする面積が大きくな
る。
Further, in the second prior art, in order to debug the user program, a device equipped with a program for debugging is separately required, and the debugging cannot be performed easily. Since there are a plurality of terminals for data transfer, the area required by the switching device for switching the terminals becomes large.

【0011】第3の先行技術では、ユーザプログラムな
どを記憶しているROMに置換えてROMプローブを挿
入してデバッグ装置とマイクロコンピュータとの間で信
号の授受を行っている。プローブを介して信号の授受を
行いながら実際にユーザプログラムが動作する速度でエ
ミュレーションを行うことはタイミング的な仕様の限界
から、次第に困難に成りつつある。また、プローブによ
る接続はマイクロコンピュータが取付けられる機器のた
とえばROM用のソケットなどを破壊してしまう可能性
があり安全性の点で問題がある。
In the third prior art, a ROM probe is inserted in place of a ROM storing a user program and the like, and a signal is exchanged between the debug device and the microcomputer by inserting a ROM probe. It is becoming more difficult to emulate at the speed at which the user program actually operates while transmitting and receiving signals via the probe, due to the limit of timing specifications. Further, the connection by the probe may break a device such as a ROM socket to which the microcomputer is attached, which is problematic in terms of safety.

【0012】本発明の目的は、シングルチップマイクロ
コンピュータにおける端子数を増加させることなく、機
器に組込んだ状態でアプリケーションプログラムの修正
を行うことができるシングルチップマイクロコンピュー
タを提供することである。
It is an object of the present invention to provide a single-chip microcomputer capable of modifying an application program in a state of being incorporated in a device without increasing the number of terminals in the single-chip microcomputer.

【0013】[0013]

【課題を解決するための手段】本発明は、マイクロプロ
セッサと、マイクロプロセッサによって実行されるアプ
リケーションプログラムと、アプリケーションプログラ
ムをデバッグするためのデバッグ用プログラムとを格納
するROMと、アプリケーションプログラムおよびデバ
ッグ用プログラムに関連する情報が一時的に格納される
RAMと、複数の外部接続端子とを備えるシングルチッ
プマイクロコンピュータにおいて、一部の外部接続端子
を介して外部の装置と情報の授受を行うことが可能な通
信用のインタフェイスと、前記一部の外部接続端子の機
能を切換えるように制御する制御手段とを備え、制御手
段は、デバッグ用のプログラムが起動されたときには前
記一部の外部接続端子の接続を通信用のインタフェイス
に切換え、アプリケーションプログラムが起動されたと
きにはマイクロコンピュータとしてのプログラム動作機
能用に切換えることを特徴とするシングルチップマイク
ロコンピュータである。本発明に従えば、シングルチッ
プマイクロコンピュータは、マイクロプロセッサによっ
て実行されるアプリケーションプログラムと、デバッグ
用のプログラムとがROMに格納されている。アプリケ
ーションプログラムのデバッグを行う際にはデバッグ用
のプログラムを起動する。デバッグ用のプログラムが起
動されると、制御手段は一部の外部接続端子の機能を切
換える。機能が切換えられた外部接続端子を介して、通
信用のインタフェイスは外部の装置との情報の授受を行
う。デバッグ用プログラムは、外部の装置から供給され
る情報に基づいてアプリケーションプログラムのデバッ
グを行う。アプリケーションプログラムが起動されたと
きには、制御手段は外部接続端子をプログラム動作機能
用に切換えて情報の授受を行う。したがって、アプリケ
ーションプログラムのデバッグを行うために必要な外部
の装置との情報の授受は、制御手段によって機能が切換
えられた一部の外部接続端子を用いて行われるので、デ
バッグを行うために情報の授受専用の端子を設ける必要
がなく、シングルチップマイクロコンピュータが形成さ
れるチップの面積を広くしなくてもアプリケーションプ
ログラムのデバッグを行うことができる。
SUMMARY OF THE INVENTION The present invention provides a microprocessor, an application program executed by the microprocessor, a ROM for storing a debug program for debugging the application program, an application program and a debug program. In a single-chip microcomputer that includes a RAM that temporarily stores information related to the above and a plurality of external connection terminals, it is possible to exchange information with an external device through some external connection terminals. A communication interface and control means for controlling to switch the functions of the part of the external connection terminals are provided, and the control means connects the part of the external connection terminals when a debugging program is started. To the interface for communication, When the Activation program is started is a single-chip microcomputer, wherein a switch for the program operation functions as a microcomputer. According to the present invention, in the single-chip microcomputer, the application program executed by the microprocessor and the debugging program are stored in the ROM. When debugging an application program, a debugging program is started. When the debugging program is activated, the control means switches the functions of some external connection terminals. The communication interface exchanges information with an external device via the external connection terminal whose function is switched. The debug program debugs the application program based on information supplied from an external device. When the application program is activated, the control means switches the external connection terminal for the program operation function to exchange information. Therefore, since the exchange of information with an external device necessary for debugging the application program is performed using a part of the external connection terminals whose functions are switched by the control means, the information for the debug is not provided. It is not necessary to provide terminals for exclusive use of transfer, and application programs can be debugged without increasing the area of the chip on which the single-chip microcomputer is formed.

【0014】また本発明の前記ROMは、電気的に書換
え可能なROMであることを特徴とする。本発明に従え
ば、ROMは電気的に書換え可能なROM、たとえばフ
ラッシュメモリなどによって構成される。したがって、
デバッグ用プログラムによって修正されたアプリケーシ
ョンプログラムをシングルチップマイクロコンピュータ
が機器に組込まれた状態のままでROMに記憶すること
ができる。
The ROM of the present invention is characterized in that it is an electrically rewritable ROM. According to the invention, the ROM comprises an electrically rewritable ROM, for example a flash memory. Therefore,
The application program modified by the debugging program can be stored in the ROM with the single-chip microcomputer incorporated in the device.

【0015】また本発明の前記一部の外部接続端子は、
ACL端子またはTEST端子として機能することを特
徴とする。本発明に従えば、デバッグ用プログラムの動
作時に外部の装置との情報の授受を行う一部の外部接続
端子は、ACLまたはTEST端子である。したがっ
て、シングルチップマイクロコンピュータとしての機能
を行う際に使用頻度の低い外部接続端子の機能を切換え
て外部の装置と情報の授受を行うので、アプリケーショ
ンプログラムのデバッグを行う際に、外部接続端子の機
能を頻繁に切換える必要がなく制御手段を簡易な回路で
実現することができる。
Further, the above-mentioned some external connection terminals of the present invention are:
It is characterized in that it functions as an ACL terminal or a TEST terminal. According to the present invention, some external connection terminals for exchanging information with an external device during operation of the debug program are ACL or TEST terminals. Therefore, when performing the function as a single-chip microcomputer, the function of the external connection terminal, which is rarely used, is switched to exchange information with an external device. Therefore, when the application program is debugged, the function of the external connection terminal is changed. The control means can be realized by a simple circuit without the need to switch frequently.

【0016】[0016]

【発明の実施の形態】図1は、シングルチップマイクロ
コンピュータ11の構成を示すブロック図である。シン
グルチップマイクロコンピュータ(以後単にマイクロコ
ンピュータと称する)11は、CPU(中央処理装置)
12と、ROM(Read Only Memory)13と、RAM
(Ramdom Access Memory)14と、比較器19と、端子
入力信号セレクタ20と、ベクタアドレス生成回路21
と、UART(UniversalAsynchronous Receiver and T
ransmitter)22とを含んで構成され、図示しない複数
の外部接続用の端子を備える。図1のマイクロコンピュ
ータ11においては、一部の外部接続用端子としてAC
L(All CLear)端子23とTEST端子24とを示し
た。
1 is a block diagram showing the structure of a single-chip microcomputer 11. As shown in FIG. A single-chip microcomputer (hereinafter simply referred to as a microcomputer) 11 is a CPU (central processing unit).
12, ROM (Read Only Memory) 13, and RAM
(Ramdom Access Memory) 14, comparator 19, terminal input signal selector 20, vector address generation circuit 21
And UART (Universal Asynchronous Receiver and T
ransmitter) 22 and includes a plurality of external connection terminals (not shown). In the microcomputer 11 of FIG. 1, AC is used as a part of external connection terminals.
The L (All CLear) terminal 23 and the TEST terminal 24 are shown.

【0017】ROM13は、ユーザROM15とモニタ
ROM16とによって構成され、たとえばフラッシュメ
モリなどの電気的に書換えが可能なROMである。RA
M14は、ユーザRAM17とエミュレートRAM18
とによって構成される。CPU12には、アドレスバス
25とデータバス26とが接続されている。ROM13
とRAM14とは、CPU12とアドレスバス25とデ
ータバス26とによって接続される。アドレスバス25
によってROM13などのアドレスが指定され、データ
バス26を介してデータの授受が行われる。
The ROM 13 is composed of a user ROM 15 and a monitor ROM 16, and is an electrically rewritable ROM such as a flash memory. RA
M14 is a user RAM 17 and an emulated RAM 18
Composed of and. An address bus 25 and a data bus 26 are connected to the CPU 12. ROM13
And the RAM 14 are connected by the CPU 12, the address bus 25, and the data bus 26. Address bus 25
The address of the ROM 13 or the like is designated by, and data is exchanged via the data bus 26.

【0018】ユーザROM15には、ユーザが開発した
アプリケーションプログラムであるユーザプログラムが
格納されており、モニタROM16には前記ユーザプロ
グラムをデバッグするためのプログラムなどが記憶され
ている。デバッグ用のプログラムによって、外部の端末
装置31との通信制御およびユーザROM15に格納さ
れているユーザプログラムのスタート、ストップなどの
制御を行う。
The user ROM 15 stores a user program which is an application program developed by the user, and the monitor ROM 16 stores a program for debugging the user program. The program for debugging controls communication with the external terminal device 31 and the start and stop of the user program stored in the user ROM 15.

【0019】ユーザRAM17は、ユーザROM15に
格納されているユーザプログラムの動作時にデータの一
時書込みなどが行われる。エミュレートRAM18は、
モニタROM16に格納されているデバッグ用プログラ
ムの起動時に端末装置31から入力されたデータなどを
格納する。
In the user RAM 17, data is temporarily written when the user program stored in the user ROM 15 operates. The emulated RAM 18 is
It stores data and the like input from the terminal device 31 when the debugging program stored in the monitor ROM 16 is activated.

【0020】UART22は、モニタROM16に予め
記憶されているデータの転送速度および一度に転送され
るデータのビット数などの情報に基づいて、2本の信号
線を用いてシリアル方式でデータの送受信を行う。UA
RT22には、端子入力信号セレクタ20を介して端末
装置31からデータが入力される。UART22に入力
されたデータは、エミュレートRAM18およびベクタ
アドレス生成回路21に入力される。
The UART 22 transmits and receives data in a serial manner by using two signal lines based on information such as a data transfer rate stored in advance in the monitor ROM 16 and the number of bits of data transferred at one time. To do. UA
Data is input to the RT 22 from the terminal device 31 via the terminal input signal selector 20. The data input to the UART 22 is input to the emulation RAM 18 and the vector address generation circuit 21.

【0021】マイクロコンピュータ11は、ACL端子
23に予め定めるハイレベルかローレベルかの信号が入
力されることによって電源投入時と同様の動作を行い、
マイクロコンピュータ11内のレジスタなどの値をクリ
アする。また、マイクロコンピュータ11は、電源投入
時にTEST端子24に入力されている信号のレベル
が、予め定めるレベルであったときには、テストモード
と称される処理としてマイクロコンピュータII内の回
路が正常に動作しているかどうかを予め定められるプロ
グラムに従って信号を入力することによって調べる。
The microcomputer 11 performs the same operation as when the power is turned on by inputting a predetermined high level signal or low level signal to the ACL terminal 23,
The value of the register or the like in the microcomputer 11 is cleared. When the level of the signal input to the TEST terminal 24 when the power is turned on is a predetermined level, the microcomputer 11 performs a process called a test mode so that the circuit in the microcomputer II operates normally. It is checked by inputting a signal according to a predetermined program.

【0022】図2は、UART22におけるデータのフ
ォーマットを示す図である。図2(1)では、データ部
分が7もしくは8ビットによって構成されたフォーマッ
トの例を示す。7/8ビットモードにおいては、予め定
めるスタートビットに引続いてビット0からビットn
(nは7もしくは8)までのデータによって構成された
データ部分が設けられる。nが7である場合には、デー
タ部分に引続いて1ビットのデータであるパリティビッ
トが設けられるが、nが8である場合にはパリティビッ
トは設けられない。データ部分もしくはパリティビット
に引続いて1もしくは2ビットからなるストップビット
が設けられる。
FIG. 2 is a diagram showing a data format in the UART 22. FIG. 2A shows an example of a format in which the data portion is composed of 7 or 8 bits. In the 7 / 8-bit mode, bits 0 to n are successively added after a predetermined start bit.
A data portion composed of data up to (n is 7 or 8) is provided. When n is 7, a parity bit, which is 1-bit data, is provided following the data portion, but when n is 8, no parity bit is provided. A stop bit consisting of 1 or 2 bits is provided following the data part or the parity bit.

【0023】図2(2)では、データ部分が9ビットに
よって構成されたフォーマットの例を示す。9ビットモ
ードにおいては、予め定めるスタートビットに引続い
て、ビット0からビットnまでのデータとパリティビッ
トとによって構成されたデータ部分が設けられる。デー
タ部分に引続いては1もしくは2ビットからなるストッ
プビットが設けられる。
FIG. 2 (2) shows an example of a format in which the data portion is composed of 9 bits. In the 9-bit mode, a predetermined start bit is followed by a data portion composed of data from bit 0 to bit n and a parity bit. A stop bit consisting of 1 or 2 bits is provided following the data portion.

【0024】比較器19は、アドレスバス25およびデ
ータバス26のデータと、エミュレートRAM18に記
憶されているデータとの比較を行う。ベクタアドレス生
成回路21は、ACL信号の入力および各種割込み発生
時、たとえば比較器19において行われた比較の結果な
どに基づいて、ユーザROM15およびモニタROM1
6における所定のアドレスを出力する。ベクタアドレス
生成回路21には、たとえばモニタROM16における
デバッグ用プログラムのスタートアドレスなどが格納さ
れていて、ベクタアドレス生成回路21から出力される
アドレスに基づいてプログラムが実行される。
The comparator 19 compares the data on the address bus 25 and the data bus 26 with the data stored in the emulation RAM 18. The vector address generation circuit 21 receives the ACL signal and generates various interrupts, for example, based on the result of the comparison performed in the comparator 19, the user ROM 15 and the monitor ROM 1
The predetermined address in 6 is output. The vector address generation circuit 21 stores, for example, the start address of the debug program in the monitor ROM 16, and the program is executed based on the address output from the vector address generation circuit 21.

【0025】図3は、端子入力信号セレクタ20の構成
を示すブロック図である。端子入力信号セレクタ20
は、レジスタ41と、オートリセット回路42と、信号
切換え回路43と、信号入力許可回路44と、入出力切
換え回路45と、トランジスタ46とを含んで構成され
る。
FIG. 3 is a block diagram showing the configuration of the terminal input signal selector 20. Terminal input signal selector 20
Includes a register 41, an auto reset circuit 42, a signal switching circuit 43, a signal input permission circuit 44, an input / output switching circuit 45, and a transistor 46.

【0026】入出力切換え回路45は、バッファ51
と、n型のFET(Field EffectTransistor)であるト
ランジスタ52と、NANDゲート53と、p型のFE
Tであるトランジスタ54とを含んで構成される。信号
切換え回路43は、ANDゲート55,56とORゲー
ト57とを含んで構成されており、ANDゲート55の
出力がORゲート57の一方の入力端子に入力され、A
NDゲート56の出力がORゲート57の他方の入力端
子に入力される。信号入力許可回路44は、ANDゲー
ト58を含んで構成される。
The input / output switching circuit 45 includes a buffer 51.
A transistor 52 which is an n-type FET (Field Effect Transistor), a NAND gate 53, and a p-type FE
And a transistor 54 which is T. The signal switching circuit 43 is configured to include AND gates 55 and 56 and an OR gate 57, and the output of the AND gate 55 is input to one input terminal of the OR gate 57, and A
The output of the ND gate 56 is input to the other input terminal of the OR gate 57. The signal input permission circuit 44 includes an AND gate 58.

【0027】図3には1つのDフリップフロップとして
示しているが、レジスタ41は端子入力信号セレクタ2
0において複数個設けられており、各レジスタ41を識
別するためのアドレスがそれぞれに割付けられている。
アドレスバス25を介して与えられるアドレス値によっ
て指定されるレジスタ41に内部クロック信号に基づい
てデータバス26のデータが書込まれる。内部クロック
信号がレジスタ41の入力端子CKに入力されると入力
端子Dに入力されている信号のレベルが出力端子Qから
出力され、反転出力端子QBからは出力端子Qの出力を
反転した信号が出力される。出力端子Qから出力される
信号SEL1は、ANDゲート58の一方の入力端子に
入力される。出力端子QBから出力される信号SEB
は、ANDゲート55,56の一方の入力端子にそれぞ
れ入力され、かつバッファ51の制御端子に入力され
る。
Although shown as one D flip-flop in FIG. 3, the register 41 is a terminal input signal selector 2
A plurality of 0s are provided, and an address for identifying each register 41 is assigned to each.
The data on the data bus 26 is written in the register 41 designated by the address value given via the address bus 25 based on the internal clock signal. When the internal clock signal is input to the input terminal CK of the register 41, the level of the signal input to the input terminal D is output from the output terminal Q, and the inverted output terminal QB outputs an inverted signal of the output terminal Q. Is output. The signal SEL1 output from the output terminal Q is input to one input terminal of the AND gate 58. Signal SEB output from output terminal QB
Is input to one of the input terminals of the AND gates 55 and 56, and is also input to the control terminal of the buffer 51.

【0028】オートリセット回路42の出力は、レジス
タ41のリセット端子Rと、ANDゲート55の他方の
入力端子に入力される。ACL端子23に接続される信
号線60は、ANDゲート56の他方の入力端子とAN
Dゲート58の他方の入力端子とに接続される。
The output of the auto reset circuit 42 is input to the reset terminal R of the register 41 and the other input terminal of the AND gate 55. The signal line 60 connected to the ACL terminal 23 is connected to the other input terminal of the AND gate 56 and AN.
It is connected to the other input terminal of D gate 58.

【0029】入出力切換え回路45におけるバッファ5
1には、TEST端子24から信号線59を介して信号
が入力される。信号線59には、p型のFETであるト
ランジスタ46のドレインDが接続されている。トラン
ジスタ46は、ゲートGが接地されており、ソースSに
は所定の電位が与えられている。したがって、TEST
端子24に対して外部からの入力がない場合は、入出力
切換え回路45に入力される信号のレベルはハイレベル
となる。
Buffer 5 in input / output switching circuit 45
1, a signal is input from the TEST terminal 24 through the signal line 59. The drain D of the transistor 46, which is a p-type FET, is connected to the signal line 59. In the transistor 46, the gate G is grounded and the source S is given a predetermined potential. Therefore, TEST
When there is no external input to the terminal 24, the level of the signal input to the input / output switching circuit 45 becomes high level.

【0030】バッファ51には、信号SEBが制御信号
として入力されており、信号SEBがローレベルとなる
とバッファ51の信号出力がハイインピーダンス状態と
なる。バッファ51の出力は、内部TEST信号NTE
としてマイクロコンピュータ11内の他の構成要素に供
給される。なお、バッファ51の出力にはトランジスタ
54のドレインDが接続されている。このトランジスタ
54は、ゲートGが接地されており、ソースSには所定
の電位が与えられている。したがって、バッファ51の
信号出力がハイインピーダンス状態の場合、内部TES
T信号NTEはハイレベルとなる。
The signal SEB is inputted to the buffer 51 as a control signal, and when the signal SEB becomes low level, the signal output of the buffer 51 becomes high impedance state. The output of the buffer 51 is the internal TEST signal NTE
Is supplied to other components in the microcomputer 11. The output of the buffer 51 is connected to the drain D of the transistor 54. In the transistor 54, the gate G is grounded and the source S is given a predetermined potential. Therefore, when the signal output of the buffer 51 is in the high impedance state, the internal TES
The T signal NTE becomes high level.

【0031】トランジスタ54のドレインDは、さらに
NANDゲート53の第1の入力端子に接続される。N
ANDゲート53の第2の入力端子には信号SEL1が
入力され、第3の入力端子にはUART22からの出力
信号OUAが入力される。NANDゲート53の出力
は、トランジスタ52のゲートGに与えられる。トラン
ジスタ52は、ドレインDが接地され、ソースSが信号
線59に接続される。
The drain D of the transistor 54 is further connected to the first input terminal of the NAND gate 53. N
The signal SEL1 is input to the second input terminal of the AND gate 53, and the output signal OUA from the UART 22 is input to the third input terminal. The output of the NAND gate 53 is given to the gate G of the transistor 52. In the transistor 52, the drain D is grounded and the source S is connected to the signal line 59.

【0032】マイクロコンピュータ11に電源が投入さ
れてからの動作について説明する。電源が投入される
と、オートリセット回路42が正のパルス信号を出力
し、レジスタ41がリセットされる。したがって、信号
SEL1はローレベルとなり、信号SEBはハイレベル
となる。信号SEBがバッファ51の制御端子に入力さ
れているので、TEST端子24に入力されている信号
のレベルがそのまま内部TEST信号NTEのレベルと
して出力される。内部TEST信号NTEは、マイクロ
コンピュータ11をTESTモードで動作させる時のみ
ローレベルとなる。
The operation after the microcomputer 11 is powered on will be described. When the power is turned on, the auto reset circuit 42 outputs a positive pulse signal and the register 41 is reset. Therefore, the signal SEL1 goes low and the signal SEB goes high. Since the signal SEB is input to the control terminal of the buffer 51, the level of the signal input to the TEST terminal 24 is output as it is as the level of the internal TEST signal NTE. The internal TEST signal NTE becomes low level only when the microcomputer 11 is operated in the TEST mode.

【0033】アドレスバス25によって示されるレジス
タ41は、入力端子Dに入力されるデータバス26の信
号値を内部クロック信号CKに同期してラッチする。入
力端子Dに入力される信号がハイレベルである場合、信
号SEL1がハイレベルになる。信号SEL1がハイレ
ベルになることによって、ACL端子23に入力される
信号が、信号入力許可回路44のANDゲート58を介
してUART入力信号UAとしてUART22に入力さ
れる。信号入力許可回路44の出力がUART22に供
給されることによって、モニタROM16のデバッグ用
プログラムが起動する。デバッグ用プログラムは、ユー
ザROM15に格納されているアプリケーションプログ
ラムのスタートアドレスの値をエミュレートRAM18
に記憶させる。また、デバッグ用プログラムは、予め定
めるデータをUART22に供給する。
The register 41 indicated by the address bus 25 latches the signal value of the data bus 26 input to the input terminal D in synchronization with the internal clock signal CK. When the signal input to the input terminal D is at high level, the signal SEL1 goes to high level. When the signal SEL1 goes high, the signal input to the ACL terminal 23 is input to the UART 22 as the UART input signal UA via the AND gate 58 of the signal input permission circuit 44. By supplying the output of the signal input permission circuit 44 to the UART 22, the debug program of the monitor ROM 16 is activated. The debug program emulates the value of the start address of the application program stored in the user ROM 15 in the emulation RAM 18
To memorize. The debug program also supplies predetermined data to the UART 22.

【0034】UART22は、前記予め定めるデータを
UART出力信号OUAとして端子入力信号セレクタ2
0の入出力切換え回路45に入力する。入力されたデー
タの信号レベルによってNANDゲート53の出力が定
まる。NANDゲート53の出力がトランジスタ52の
ゲートGに入力されているので、前記データの信号レベ
ルがハイレベルである場合にはトランジスタ52が導通
し、TEST端子24の出力がローレベルとなる。ま
た、前記データの信号レベルがローレベルである場合に
はトランジスタ52は遮断し、TEST端子24からの
出力信号がハイレベルとなる。
The UART 22 uses the predetermined data as the UART output signal OUA to output the terminal input signal selector 2.
0 is input to the input / output switching circuit 45. The output of the NAND gate 53 is determined by the signal level of the input data. Since the output of the NAND gate 53 is input to the gate G of the transistor 52, when the signal level of the data is high level, the transistor 52 becomes conductive and the output of the TEST terminal 24 becomes low level. When the signal level of the data is low level, the transistor 52 is cut off and the output signal from the TEST terminal 24 becomes high level.

【0035】端末装置31がACL端子23およびTE
ST端子24に接続されている場合は、TEST端子2
4を介して入力されるデータに基づいて端末装置31は
ACL端子23およびTEST端子24に接続されてい
ることを示す応答信号であるデータをACL端子23に
供給する。
The terminal device 31 has the ACL terminal 23 and the TE.
When connected to the ST terminal 24, the TEST terminal 2
The terminal device 31 supplies to the ACL terminal 23 data that is a response signal indicating that the terminal device 31 is connected to the ACL terminal 23 and the TEST terminal 24, based on the data input via 4.

【0036】マイクロコンピュータ11においては、T
EST端子24から前記データを出力してから予め定め
る時間以内にACL端子23に端末装置31から応答信
号が入力されていない場合には、端末装置31が接続さ
れていないと判断する。すなわち、端末装置31から応
答信号が入力されない場合には、マイクロコンピュータ
11はプログラムデバッグモードではないと判断する。
In the microcomputer 11, T
If a response signal is not input from the terminal device 31 to the ACL terminal 23 within a predetermined time after the data is output from the EST terminal 24, it is determined that the terminal device 31 is not connected. That is, when the response signal is not input from the terminal device 31, the microcomputer 11 determines that it is not in the program debug mode.

【0037】端末装置31から応答信号が入力されない
と、デバッグ用プログラムはレジスタ41にデータバス
26を介して信号を入力することによってレジスタ41
をクリアしてACL端子23への入力を内部ACL信号
NACとし、TEST端子24への入力が内部TEST
信号NTEとなるようにする。ACL端子23、TES
T端子24の機能切換え後、エミュレートRAM18に
記憶させていたユーザプログラムのスタートアドレスを
アドレスバス25に戻してユーザプログラムを動作させ
る。
If the response signal is not input from the terminal device 31, the debug program inputs a signal to the register 41 via the data bus 26, thereby registering the register 41.
Is cleared to set the input to the ACL terminal 23 as the internal ACL signal NAC, and the input to the TEST terminal 24 is set to the internal TEST.
It becomes the signal NTE. ACL terminal 23, TES
After the function of the T terminal 24 is switched, the start address of the user program stored in the emulation RAM 18 is returned to the address bus 25 to operate the user program.

【0038】端末装置31から応答信号が入力される
と、前記応答信号はACL端子23、信号入力許可回路
44を介してUART22に入力される。UART22
に入力された応答信号に基づいてACL端子23および
TEST端子24が通信専用端子として使用される。デ
バッグ用プログラムは、プログラムデバッグモードであ
ることが確認されたので、引続いてACL端子23を介
して入力されるデバッグコマンドを待ち受ける。
When a response signal is input from the terminal device 31, the response signal is input to the UART 22 via the ACL terminal 23 and the signal input permission circuit 44. UART22
The ACL terminal 23 and the TEST terminal 24 are used as communication-dedicated terminals based on the response signal input to. Since it has been confirmed that the debug program is in the program debug mode, the debug program waits for a debug command that is subsequently input via the ACL terminal 23.

【0039】プログラムデバッグモードにおける処理に
ついて説明する。端末装置31において入力されたデバ
ッグコマンドは、ACL端子23を介して端子入力信号
セレクタ20へと入力される。さらにUART22に入
力され、UART22からエミュレートRAM18に格
納されデバッグ用プログラムによって解析される。
The processing in the program debug mode will be described. The debug command input in the terminal device 31 is input to the terminal input signal selector 20 via the ACL terminal 23. Further, it is input to the UART 22, stored in the emulation RAM 18 from the UART 22, and analyzed by the debug program.

【0040】解析されたコマンドがレジスタなどの内部
データを参照するコマンドである場合は、デバッグ用プ
ログラムはアドレスバス25およびデータバス26から
必要な情報を取込みUART22へと出力する。UAR
T22は、与えられた情報をTEST端子24を介して
端末装置31へと送信する。
When the analyzed command is a command for referring to internal data such as a register, the debug program fetches necessary information from the address bus 25 and the data bus 26 and outputs it to the UART 22. UAR
T22 transmits the given information to the terminal device 31 via the TEST terminal 24.

【0041】解析されたコマンドがブレイクポイントデ
ータの設定である場合は、動作中のデバッグ用プログラ
ムは端末装置31から送られてきたデータをエミュレー
トRAM18に格納する。解析されたコマンドがユーザ
プログラムの実行を指示するコマンドである場合は、エ
ミュレートRAM18に格納されているユーザプログラ
ムのスタートアドレスをアドレスバス25に設定し、示
されたアドレスからユーザプログラムを実行させる。プ
ログラムデバッグモードにおいてユーザプログラムを実
行する際に前もってブレイクポイントデータを設定する
とブレイクポイントデータと各バス25,26のデータ
とを比較器19において比較する。
When the analyzed command is the setting of breakpoint data, the operating debug program stores the data sent from the terminal device 31 in the emulation RAM 18. When the analyzed command is a command for instructing execution of the user program, the start address of the user program stored in the emulation RAM 18 is set on the address bus 25, and the user program is executed from the indicated address. When the breakpoint data is set in advance when the user program is executed in the program debug mode, the breakpoint data and the data on the buses 25 and 26 are compared by the comparator 19.

【0042】エミュレートRAM18に格納されている
ブレイクポイントデータがアドレス値である場合には、
このアドレス値とアドレスバス25を介して転送される
アドレス値とが一致したときにユーザプログラムを停止
させる。エミュレートRAM18に格納されているブレ
イクポイントデータがアドレス値以外の所定のデータで
ある場合には、このデータとデータバス26を介して転
送されるデータとが一致したときにユーザプログラムを
停止させる。ユーザプログラムが停止すると停止したユ
ーザプログラムのアドレスがエミュレートRAM18に
格納されモニタROM16のデバッグ用プログラムが再
び起動される。
If the breakpoint data stored in the emulation RAM 18 is an address value,
When this address value matches the address value transferred via the address bus 25, the user program is stopped. When the breakpoint data stored in the emulation RAM 18 is predetermined data other than the address value, the user program is stopped when this data matches the data transferred via the data bus 26. When the user program stops, the address of the stopped user program is stored in the emulation RAM 18 and the debug program in the monitor ROM 16 is started again.

【0043】図4は、マイクロコンピュータ11におけ
る各信号のタイミングチャートである。時刻t0におい
て、図4(1)に示す電源が投入されると、時刻t1に
おいて図4(2)に示すオートリセット回路42の出力
がロー「L」レベルからハイ「H」レベルへと立上が
る。オートリセット回路42の出力が、ハイレベルとな
ったことによって図4(3)に示す内部ACL信号NA
Cが立上がる。また、図4(9)に示すTEST端子2
4への入力が立上がりはじめ、図4(7)に示す内部T
EST信号NTEが立上がりはじめる。
FIG. 4 is a timing chart of each signal in the microcomputer 11. When the power supply shown in FIG. 4 (1) is turned on at time t0, the output of the auto reset circuit 42 shown in FIG. 4 (2) rises from the low "L" level to the high "H" level at time t1. . Since the output of the auto reset circuit 42 becomes high level, the internal ACL signal NA shown in FIG.
C rises. In addition, the TEST terminal 2 shown in FIG.
4 starts to rise, and the internal T shown in FIG.
The EST signal NTE begins to rise.

【0044】オートリセット回路42の出力が、時刻t
2においてローレベルへと立下がると、内部ACL信号
NACがローレベルと立下がる。オートリセット回路4
2の出力がローレベルになったことによって、図4
(6)に示す信号SEL1が立上がりはじめ時刻t3に
おいてハイレベルとなる。信号SEL1がハイレベルに
なったことによって、時刻t3から図4(8)に示すU
ART出力信号OUAとして前述した所定のデータが端
末装置31へとTEST端子24を介して出力される。
なお、TEST端子24から出力されるデータは図4
(9)に示すように信号OUAとはハイレベルとローレ
ベルとが入換わる。前記データの送出は、時刻t3から
時刻t4までの期間T1において行われる。端末装置3
1は、前記データが入力されると端末装置31が接続さ
れていることを示す応答信号をマイクロコンピュータ1
1へと送出する。
The output of the auto reset circuit 42 is output at time t.
When it falls to the low level at 2, the internal ACL signal NAC falls to the low level. Auto reset circuit 4
As the output of 2 goes low,
The signal SEL1 shown in (6) begins to rise and becomes high level at time t3. Since the signal SEL1 becomes high level, U shown in FIG.
The predetermined data described above as the ART output signal OUA is output to the terminal device 31 via the TEST terminal 24.
The data output from the TEST terminal 24 is shown in FIG.
As shown in (9), the signal OUA switches between high level and low level. The transmission of the data is performed in the period T1 from time t3 to time t4. Terminal device 3
When the data is input, the microcomputer 1 sends a response signal indicating that the terminal device 31 is connected.
Send to 1.

【0045】図4(4)に示す端末装置31から送出さ
れた応答信号が、時刻t5においてACL端子23に入
力されると、図4(5)に示すUART入力信号UAと
してUART22へと入力される。応答信号の受取りは
時刻t5から時刻t6までの期間T2において行われ
る。期間T2においてACL端子23に入力される信号
とUART入力信号UAとは同一レベルとなる。オート
リセット回路42の出力が立下がる時刻t2から応答信
号の受取りが完了する時刻t6までの期間T3におい
て、デバッグ用プログラムの起動およびUART22に
対する応答信号の入力が待ち受けられる。期間T2にお
いて応答信号が入力されると時刻t6以降はプログラム
デバッグモードとなる。
When the response signal sent from the terminal device 31 shown in FIG. 4 (4) is input to the ACL terminal 23 at time t5, it is input to the UART 22 as the UART input signal UA shown in FIG. 4 (5). It The reception of the response signal is performed in the period T2 from time t5 to time t6. In the period T2, the signal input to the ACL terminal 23 and the UART input signal UA have the same level. During the period T3 from the time t2 when the output of the auto reset circuit 42 falls to the time t6 when the reception of the response signal is completed, the start of the debugging program and the input of the response signal to the UART 22 are awaited. When the response signal is input in the period T2, the program debug mode is set after the time t6.

【0046】図5は、マイクロコンピュータ11におけ
る処理を示すフローチャートである。ステップs1で
は、電源が投入されるのを待ち受ける。電源が投入され
るとステップs2に進む。ステップs2では、オートリ
セット回路42において信号が発生され、レジスタ41
がリセットされる。
FIG. 5 is a flow chart showing the processing in the microcomputer 11. In step s1, it waits until the power is turned on. When the power is turned on, the process proceeds to step s2. In step s2, a signal is generated in the auto reset circuit 42 and the register 41
Is reset.

【0047】続くステップs3では、内部TEST信号
NTEの信号レベルがハイレベルであるかどうかを判断
する。内部TEST信号NTEの信号レベルがハイレベ
ルであるときには、ステップs4に進む。ステップs4
では、オートリセット回路42からの信号出力が停止さ
れ、レジスタ41のリセット状態が解除される。リセッ
ト状態が解除されたので、レジスタ41はデータバス2
6の値を内部クロック信号に基づいて取込む。したがっ
て、レジスタ41の出力端子Qから出力される信号SE
L1がハイレベルとなる。
In the following step s3, it is determined whether or not the signal level of the internal TEST signal NTE is high level. When the signal level of the internal TEST signal NTE is the high level, the process proceeds to step s4. Step s4
Then, the signal output from the auto reset circuit 42 is stopped, and the reset state of the register 41 is released. Since the reset state has been released, the register 41 is set to the data bus 2
Take the value of 6 based on the internal clock signal. Therefore, the signal SE output from the output terminal Q of the register 41 is
L1 becomes high level.

【0048】信号SEL1がハイレベルになることによ
って、信号切換え回路43から出力される内部ACL信
号NACの信号レベルがローレベルとなる。また、信号
入力許可回路44から出力されるUART入力信号UA
の信号レベルは、ACL端子23から入力される信号の
レベルに基づいて定められる。すなわち、ACL端子2
3は端末装置31から送られてくるデータ信号の入力端
子となる。
When the signal SEL1 goes high, the signal level of the internal ACL signal NAC output from the signal switching circuit 43 goes low. In addition, the UART input signal UA output from the signal input permission circuit 44
The signal level of is determined based on the level of the signal input from the ACL terminal 23. That is, the ACL terminal 2
3 is an input terminal for a data signal sent from the terminal device 31.

【0049】ステップs5では、ベクタアドレス生成回
路21によって指定されるアドレスに基づいてモニタR
OM16に格納されているデバッグ用プログラムが起動
される。また、ユーザROM15に格納されているユー
ザプログラムのスタートアドレスがエミュレートRAM
18に格納される。
At step s5, the monitor R is read based on the address designated by the vector address generation circuit 21.
The debugging program stored in the OM 16 is started. In addition, the start address of the user program stored in the user ROM 15 is the emulated RAM.
18 is stored.

【0050】続くステップs6においては、UART2
2から所定の信号が出力されTEST端子24を介して
端末装置31へと与えられる。TEST端子24は端末
装置31へとデータ信号を出力する出力端子となる。ス
テップs7では、前記所定の信号に対する端末装置31
からの応答信号がACL端子23を介して入力されたか
どうかを判断する。応答信号を受信した場合は前述した
プログラムデバッグ処理を行う。
In the following step s6, UART2
A predetermined signal is output from 2 and given to the terminal device 31 via the TEST terminal 24. The TEST terminal 24 serves as an output terminal for outputting a data signal to the terminal device 31. In step s7, the terminal device 31 for the predetermined signal
It is determined whether or not the response signal from is input through the ACL terminal 23. When the response signal is received, the program debug process described above is performed.

【0051】また、応答信号を受信しなかった場合に
は、端末装置31が接続されていないと判断し、信号S
EL1をローレベルにする。信号SEL1がローレベル
になることによって、ACL端子23に入力される信号
は、マイクロコンピュータ11において内部ACL信号
NACとして用いられ、TEST端子24に入力される
信号は内部TEST信号NTEとして用いられる。さら
に、エミュレートRAM18に格納されているユーザプ
ログラムのスタートアドレスを読出しユーザプログラム
を起動させる。
When the response signal is not received, it is determined that the terminal device 31 is not connected, and the signal S
Set EL1 to low level. When the signal SEL1 goes low, the signal input to the ACL terminal 23 is used as the internal ACL signal NAC in the microcomputer 11, and the signal input to the TEST terminal 24 is used as the internal TEST signal NTE. Further, the start address of the user program stored in the emulation RAM 18 is read and the user program is activated.

【0052】ステップs3において、TEST端子23
に入力されている信号がローレベルであると判断した時
には、マイクロコンピュータ11は前述したテストモー
ドに入る。
At step s3, the TEST terminal 23
When it is determined that the signal input to the microcomputer is low level, the microcomputer 11 enters the test mode described above.

【0053】以上のように本発明の実施のこの形態によ
れば、マイクロコンピュータ11を起動する際に、AC
L端子23とTEST端子24とに端末装置31が接続
されているかどうかを確認する。端末装置31が接続さ
れている場合には、端子入力信号セレクタ20におい
て、端子の機能を切換えてACL端子23、TEST端
子24を通信専用の端子とする。ユーザプログラムをデ
バッグするプログラムはモニタROM16に格納されて
いるので、端末装置31は送られてきたデータを表示し
たり、デバッグコマンドを入力することができるような
構成であればよく、プログラムデバッグのための専用の
装置を用いる必要がなく、容易にプログラムのデバッグ
を行うことができる。
As described above, according to this embodiment of the present invention, when the microcomputer 11 is activated, the AC
It is confirmed whether the terminal device 31 is connected to the L terminal 23 and the TEST terminal 24. When the terminal device 31 is connected, the terminal input signal selector 20 switches the function of the terminal to make the ACL terminal 23 and the TEST terminal 24 dedicated terminals for communication. Since the program for debugging the user program is stored in the monitor ROM 16, the terminal device 31 may have a configuration capable of displaying the transmitted data and inputting a debug command. The program can be easily debugged without the need to use a dedicated device for.

【0054】また、ACL端子23およびTEST端子
24の機能は、通常のプログラム動作機能時にはあまり
使用されない端子であるので、端子入力信号セレクタ2
0の構造を簡易な構造とすることができる。
Further, since the functions of the ACL terminal 23 and the TEST terminal 24 are terminals which are not often used during the normal program operation function, the terminal input signal selector 2
The structure of 0 can be a simple structure.

【0055】なお、本発明の実施のこの形態では、RO
M13は書換え可能なROMであるとしたが、マスクR
OMのような書換えることができないROMを使用した
場合であっても、デバッグ情報を端子入力信号セレクタ
20を介して読み出すことができるので、マイクロコン
ピュータ11が実際に機器に取付けられた状態でデバッ
グを行うことができる。
In this embodiment of the present invention, RO
M13 is a rewritable ROM, but mask R
Even when a non-rewritable ROM such as an OM is used, the debug information can be read out through the terminal input signal selector 20, so that the debugging can be performed with the microcomputer 11 actually attached to the device. It can be performed.

【0056】[0056]

【発明の効果】以上のように本発明によれば、アプリケ
ーションプログラムのデバッグを行うために必要な外部
の装置との情報の授受は制御手段によって機能が切換え
られた一部の接続端子を用いて行われるので、通信専用
の端子をシングルチップマイクロコンピュータに設ける
必要がなく、シングルチップマイクロコンピュータが形
成されるチップの面積を広くすることなく機器に取付け
られた状態でROMに格納されているアプリケーション
プログラムのデバッグを行うことができる。
As described above, according to the present invention, a part of the connection terminals whose functions are switched by the control means is used for exchanging information with an external device necessary for debugging an application program. Since it is performed, it is not necessary to provide a terminal for exclusive use of communication in the single-chip microcomputer, and the application program stored in the ROM in the state of being attached to the device without increasing the area of the chip on which the single-chip microcomputer is formed. Can be debugged.

【0057】また本発明によれば、ROMは電気的に書
換え可能なROMによって構成されるので、シングルチ
ップマイクロコンピュータを機器に組込んだ状態のまま
でデバッグ用プログラムによってアプリケーションプロ
グラムを修正することができるので、アプリケーション
プログラムのデバッグを容易に行うことができ、アプリ
ケーションプログラムの開発にかかる時間を短縮するこ
とができる。また、デバッグ用プログラムの書換えが可
能となるので、ユーザ独自の制御を行うことができる。
Further, according to the present invention, since the ROM is composed of an electrically rewritable ROM, the application program can be modified by the debug program while the single-chip microcomputer is still incorporated in the equipment. Therefore, the application program can be easily debugged, and the time required for developing the application program can be shortened. Further, since the debugging program can be rewritten, the user's own control can be performed.

【0058】さらに本発明によれば、マイクロコンピュ
ータとしての機能を行う際に使用頻度の低い外部接続端
子の機能を切換えて外部の装置と情報の授受を行うの
で、アプリケーションプログラムのデバッグを行う際に
外部接続端子の機能を頻繁に切換える必要がなく制御手
段を簡易な回路で実現することができる。
Further, according to the present invention, when the function of the microcomputer is performed, the function of the external connection terminal which is less frequently used is switched to exchange information with an external device, so that the application program can be debugged. The control means can be realized by a simple circuit without the need to frequently switch the function of the external connection terminal.

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

【図1】本発明の実施の一形態であるシングルチップマ
イクロコンピュータ11の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing a configuration of a single-chip microcomputer 11 which is an embodiment of the present invention.

【図2】UART22におけるデータのフォーマットを
示す図である。
FIG. 2 is a diagram showing a data format in a UART 22.

【図3】端子入力信号セレクタ20の構成を示すブロッ
ク図である。
3 is a block diagram showing a configuration of a terminal input signal selector 20. FIG.

【図4】マイクロコンピュータ11における各信号のタ
イミングチャートである。
4 is a timing chart of each signal in the microcomputer 11. FIG.

【図5】マイクロコンピュータ11における処理を示す
フローチャートである。
FIG. 5 is a flowchart showing processing in the microcomputer 11.

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

11 シングルチップマイクロコンピュータ 12 CPU 13 ROM 14 RAM 15 ユーザROM 16 モニタROM 17 ユーザRAM 18 エミュレートRAM 19 比較器 20 端子入力信号セレクタ 21 ベクタアドレス生成回路 22 UART 23 ACL端子 24 TEST端子 25 アドレスバス 26 データバス 31 端末装置 11 Single Chip Microcomputer 12 CPU 13 ROM 14 RAM 15 User ROM 16 Monitor ROM 17 User RAM 18 Emulated RAM 19 Comparator 20 Terminal Input Signal Selector 21 Vector Address Generation Circuit 22 UART 23 ACL Terminal 24 TEST Terminal 25 Address Bus 26 Data Bus 31 Terminal

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 マイクロプロセッサと、 マイクロプロセッサによって実行されるアプリケーショ
ンプログラムと、アプリケーションプログラムをデバッ
グするためのデバッグ用プログラムとを格納するROM
と、 アプリケーションプログラムおよびデバッグ用プログラ
ムに関連する情報が一時的に格納されるRAMと、 複数の外部接続端子とを備えるシングルチップマイクロ
コンピュータにおいて、 一部の外部接続端子を介して外部の装置と情報の授受を
行うことが可能な通信用のインタフェイスと、 前記一部の外部接続端子の機能を切換えるように制御す
る制御手段とを備え、制御手段は、デバッグ用のプログ
ラムが起動されたときには前記一部の外部接続端子の接
続を通信用のインタフェイスに切換え、アプリケーショ
ンプログラムが起動されたときにはマイクロコンピュー
タとしてのプログラム動作機能用に切換えることを特徴
とするシングルチップマイクロコンピュータ。
1. A ROM for storing a microprocessor, an application program executed by the microprocessor, and a debugging program for debugging the application program.
In a single-chip microcomputer including a RAM for temporarily storing information related to an application program and a debugging program, and a plurality of external connection terminals, an external device and information are provided through some external connection terminals. A communication interface capable of exchanging data, and control means for controlling so as to switch the functions of the part of the external connection terminals, and the control means is configured to operate when the debugging program is activated. A single-chip microcomputer characterized by switching the connection of some external connection terminals to a communication interface and switching to a program operation function as a microcomputer when an application program is started.
【請求項2】 前記ROMは、電気的に書換え可能なR
OMであることを特徴とする請求項1記載のシングルチ
ップマイクロコンピュータ。
2. The ROM is an electrically rewritable R
The single-chip microcomputer according to claim 1, which is an OM.
【請求項3】 前記一部の外部接続端子は、ACL端子
またはTEST端子として機能することを特徴とする請
求項1または2記載のシングルチップマイクロコンピュ
ータ。
3. The single-chip microcomputer according to claim 1, wherein the part of the external connection terminals functions as an ACL terminal or a TEST terminal.
JP7178449A 1995-07-14 1995-07-14 Single chip microcomputer Pending JPH0934864A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7178449A JPH0934864A (en) 1995-07-14 1995-07-14 Single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7178449A JPH0934864A (en) 1995-07-14 1995-07-14 Single chip microcomputer

Publications (1)

Publication Number Publication Date
JPH0934864A true JPH0934864A (en) 1997-02-07

Family

ID=16048721

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7178449A Pending JPH0934864A (en) 1995-07-14 1995-07-14 Single chip microcomputer

Country Status (1)

Country Link
JP (1) JPH0934864A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019515282A (en) * 2016-04-29 2019-06-06 日本テキサス・インスツルメンツ合同会社 Full pad coverage boundary scan

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019515282A (en) * 2016-04-29 2019-06-06 日本テキサス・インスツルメンツ合同会社 Full pad coverage boundary scan
JP2022043194A (en) * 2016-04-29 2022-03-15 テキサス インスツルメンツ インコーポレイテッド Full pad coverage boundary scan

Similar Documents

Publication Publication Date Title
JP3693721B2 (en) Microcomputer with built-in flash memory and test method thereof
US6668339B1 (en) Microprocessor having a debug interruption function
JPS6327931A (en) Trouble simulation apparatus
JP3943616B2 (en) Data processor with transparent operation in background mode
US7584381B2 (en) Semiconductor integrated circuit device, debug system, microcomputer, and electronic apparatus
US5767694A (en) Information processing apparatus with a mode setting circuit
JPS6360424B2 (en)
JPH0934864A (en) Single chip microcomputer
JPH06180657A (en) Method and equipment for testing computer system board
US6598176B1 (en) Apparatus for estimating microcontroller and method thereof
US20050192791A1 (en) Method for emulating an integrated circuit and semiconductor chip for practicing the method
US6058468A (en) Central processing unit and microcomputer having testing of circuitry external to the central processing unit
JP2003122594A (en) Semiconductor device and evaluation tool
CN113760800A (en) Serial port path selection method, system, terminal and storage medium based on BMC
JPS61112247A (en) Data processor
JPH08137823A (en) One-chip microcomputer for exclusive use of emulator
JP2002110925A (en) System lsi
JP3057539B2 (en) Communication emulator device
KR100557918B1 (en) Error Correction Device Using Joint Test Access Group
JPH05250204A (en) Lsi asic microcomputer
JP3871776B2 (en) Central processing unit for gaming machines
JP2704935B2 (en) Processor with test function
JP3124105B2 (en) Switch operation signal generation circuit
SU1425685A1 (en) Program debugging device
JPH05120459A (en) Single chip microcomputer