JPH1166030A - Semiconductor integrated circuit and micro-computer - Google Patents

Semiconductor integrated circuit and micro-computer

Info

Publication number
JPH1166030A
JPH1166030A JP9230802A JP23080297A JPH1166030A JP H1166030 A JPH1166030 A JP H1166030A JP 9230802 A JP9230802 A JP 9230802A JP 23080297 A JP23080297 A JP 23080297A JP H1166030 A JPH1166030 A JP H1166030A
Authority
JP
Japan
Prior art keywords
data
control
register
data register
port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP9230802A
Other languages
Japanese (ja)
Inventor
Akihiro Ito
昭広 伊藤
Tadashi Otsubo
匡 大坪
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.)
Hitachi Microcomputer System Ltd
Hitachi Ltd
Original Assignee
Hitachi Microcomputer System Ltd
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Microcomputer System Ltd, Hitachi Ltd filed Critical Hitachi Microcomputer System Ltd
Priority to JP9230802A priority Critical patent/JPH1166030A/en
Publication of JPH1166030A publication Critical patent/JPH1166030A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To input/output data to/from the data register of a port circuit from the outer terminal of the port circuit in asynchronizintg with an inner bus cycle by accessing first data register means from first outer terminals in synchronism with control signals supplied from a second input terminal. SOLUTION: A first control logic means 9 enables the first data register means 22-25 and a second data register means 26 to read/write data in synchronism with access from a central processing unit. A second control logic means 28 enables the first outer terminals P1(0)-P1(7) to access the first data register means 22-25 in synchronism with the control signals supplied from the second outer terminals P2(0)-P2(7). Control information deciding an input/output operation by the first control logic means 9 or that by a second control logic means 8 is given to a control register means 27 from the central processing unit.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、半導体集積回路、
さらにはマイクロコンピュータのポート回路に係り、ポ
ート回路の多機能化若しくは汎用化に適用して有効な技
術に関するものである。
[0001] The present invention relates to a semiconductor integrated circuit,
Further, the present invention relates to a port circuit of a microcomputer, and relates to a technology effective when applied to multifunctional or general-purpose port circuits.

【0002】[0002]

【従来の技術】マイクロコンピュータには、外部とデー
タを入出力するためにデータ端子が存在するが、マクロ
コンピュータにはデータ端子以外にポート回路を有する
ものがある。ポート回路は内部バスに接続されるデータ
レジスタを有し、データレジスタの各ビットは、ポート
回路の外部端子(ポート端子)に一対一対応される。ポ
ート回路のデータレジスタはポート端子から外部に出力
するデータを保持し、また、ポート端子から入力された
データを保持する。また、ポート端子の入出力制御用に
制御レジスタが設けられている。この制御レジスタに中
央処理装置(CPU)が制御情報を設定することによ
り、ポート回路の入力、出力又は入出力機能が決定さ
れ、また、入出力信号の種類が決定される。
2. Description of the Related Art Microcomputers have data terminals for inputting and outputting data to and from the outside. Some microcomputers have a port circuit in addition to the data terminals. The port circuit has a data register connected to the internal bus, and each bit of the data register has one-to-one correspondence with an external terminal (port terminal) of the port circuit. The data register of the port circuit holds data output from the port terminal to the outside, and holds data input from the port terminal. Further, a control register is provided for input / output control of the port terminal. When the central processing unit (CPU) sets control information in this control register, the input, output or input / output function of the port circuit is determined, and the type of input / output signal is determined.

【0003】また、アドレス、データなど常時使用する
端子以外の端子をポート端子と兼用することで、マイク
ロコンピュータ全体の端子数が増加しないように工夫さ
れているものがある。例えば、特定の周辺回路の外部イ
ンタフェース端子としてポート端子を兼用する。
There is also a device in which terminals other than terminals that are always used, such as addresses and data, are also used as port terminals so that the number of terminals of the entire microcomputer does not increase. For example, a port terminal is also used as an external interface terminal of a specific peripheral circuit.

【0004】尚、マイクロコンピュータのポート回路に
ついて記載された文献の例として、平成6年9月に株式
会社日立製作所発行の「H8/3398,H8/3337,H8/3334ハー
ドウェアマニュアル」第113頁〜第149頁がある。
As an example of a document describing a port circuit of a microcomputer, see "H8 / 3398, H8 / 3337, H8 / 3334 Hardware Manual", published by Hitachi, Ltd. in September 1994, page 113. ~ 149 pages.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、従来の
ポート回路は、1個のポート端子に対してデータレジス
タの1ビットしか対応していない。換言すれば、1バイ
トのような一組のポート端子には例えば1バイトのデー
タレジスタが1個しか対応されていない。このため、ポ
ート回路の入出力機能の多様化は、ポート端子と兼用で
きる端子の数を増やすだけに留まっていた。また、ポー
ト回路のデータレジスタの外部入出力タイミングはCP
Uのバスサイクルに同期されるだけであった。したがっ
て、外部からポート回路にデータを入力する場合、外部
回路は、マイクロコンピュータに内蔵されたCPUのバ
スサイクルに同期して動作しなければならない。
However, in the conventional port circuit, only one bit of the data register corresponds to one port terminal. In other words, for example, only one 1-byte data register corresponds to a set of port terminals such as 1 byte. For this reason, the diversification of the input / output functions of the port circuit has only increased the number of terminals that can also be used as port terminals. The external input / output timing of the data register of the port circuit is CP
It was only synchronized with the U bus cycle. Therefore, when data is externally input to the port circuit, the external circuit must operate in synchronization with the bus cycle of the CPU built in the microcomputer.

【0006】本発明の目的は、ポート回路の外部端子に
対するデータ入出力機能を多様化できる半導体集積回
路、さらにはマイクロコンピュータを提供することにあ
る。
An object of the present invention is to provide a semiconductor integrated circuit and a microcomputer which can diversify data input / output functions for external terminals of a port circuit.

【0007】本発明の別の目的は、内部のバスサイクル
と非同期でポート回路の外部端子からポート回路のデー
タレジスタにデータを入出力可能なマイクロコンピュー
タを提供することにある。
Another object of the present invention is to provide a microcomputer capable of inputting and outputting data from an external terminal of a port circuit to a data register of the port circuit asynchronously with an internal bus cycle.

【0008】本発明のその他の目的は、ポート回路の外
部端子の数を増やすことなくポート回路のデータ入出力
機能を向上させることにある。すなわち、ポート回路の
外部端子数で決まる並列入出力データビット数のデータ
を複数単位保持して、入出力できるようにすることであ
る。
Another object of the present invention is to improve the data input / output function of a port circuit without increasing the number of external terminals of the port circuit. That is, a plurality of units of data of the number of parallel input / output data bits determined by the number of external terminals of the port circuit are held so that input / output is possible.

【0009】本発明の前記並びにその他の目的と新規な
特徴は本明細書の記述及び添付図面から明らかになるで
あろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0010】[0010]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application.

【0011】すなわち、本発明に係る半導体集積回路
は、半導体基板に、バスアクセス制御手段(3,4)
と、このバスアクセス制御手段に接続された内部バス
(5,6,7)と、前記内部バスに接続されると共に半
導体基板の外部とインタフェース可能にされたポート回
路(8A)とを含む。前記ポート回路(8A)は、第1
のデータレジスタ手段(22〜25)と、第2のデータ
レジスタ手段(26)と、前記第1のデータレジスタ手
段に対するデータの外部入出力に割り当てられた第1の
外部端子(P1(0)〜P1(7))と、前記第2のデータレ
ジスタ手段に対するデータの外部入出力に割り当てられ
た第2の外部端子(P2(0)〜P2(7))と、前記内部バ
スからのアクセスに同期して前記第1のデータレジスタ
手段及び第2のデータレジスタ手段をリード・ライト可
能にする第1のレジスタ制御手段(9)と、前記第2の
入力端子から供給される制御信号に同期して前記第1の
データレジスタ手段を前記第1の外部端子からアクセス
可能にする第2のレジスタ制御手段(27,28)とを
含んで構成される。
That is, in the semiconductor integrated circuit according to the present invention, the bus access control means (3, 4) is provided on the semiconductor substrate.
And an internal bus (5, 6, 7) connected to the bus access control means, and a port circuit (8A) connected to the internal bus and capable of interfacing with the outside of the semiconductor substrate. The port circuit (8A) has a first
Data register means (22 to 25), second data register means (26), and first external terminals (P1 (0) to (P1 (0)) assigned to external input / output of data with respect to the first data register means. P1 (7)) and second external terminals (P2 (0) to P2 (7)) assigned to external input / output of data to and from the second data register means, and synchronized with access from the internal bus. A first register control means (9) for making the first data register means and the second data register means readable and writable, and a control signal supplied from the second input terminal. Second register control means (27, 28) for making the first data register means accessible from the first external terminal.

【0012】上記手段によれば、第1のデータレジスタ
手段に対するデータ入出力動作を第2の外部端子を介し
て外部から制御することができる。すなわち、半導体集
積回路内部のバスアクセス制御手段によるバスサイクル
とは非同期で第1のデータレジスタ手段に外部からアク
セスすることができる。
According to the above means, the data input / output operation with respect to the first data register means can be externally controlled via the second external terminal. That is, the first data register means can be externally accessed asynchronously with the bus cycle by the bus access control means inside the semiconductor integrated circuit.

【0013】本発明の別の観点によるマイクロコンピュ
ータは、中央処理装置(3)と、前記中央処理装置によ
ってアクセスされると共に外部とインタフェース可能に
されたポート回路(8A)とを含む。前記ポート回路
は、第1のデータレジスタ手段(22〜25)と、第2
のデータレジスタ手段(26)と、前記第1のデータレ
ジスタ手段に対するデータの外部入出力に割り当てられ
た第1の外部端子(P1(0)〜P1(7))と、前記第2の
データレジスタ手段に対するデータの外部入出力に割り
当てられた第2の外部端子(P2(0)〜P2(7))と、前
記中央処理装置からのアクセスに同期して前記第1のデ
ータレジスタ手段及び第2のデータレジスタ手段をリー
ド・ライト可能にする第1の制御論理手段(9)と、前
記第2の外部端子から供給される制御信号に同期して前
記第1のデータレジスタ手段を前記第1の外部端子から
アクセス可能にする第2の制御論理手段(28)と、前
記第1の制御論理手段による入出力動作か前記第2の制
御論理手段による入出力動作かを決定する制御情報が前
記中央処理装置によって与えられる制御レジスタ手段
(27)とを含む。
A microcomputer according to another aspect of the present invention includes a central processing unit (3) and a port circuit (8A) accessed by the central processing unit and interfaced with the outside. The port circuit includes first data register means (22 to 25) and second data register means (22 to 25).
Data register means (26), first external terminals (P1 (0) to P1 (7)) assigned to external input / output of data to and from the first data register means, and the second data register means A second external terminal (P2 (0) to P2 (7)) assigned to external input / output of data to / from the means, and the first data register means and the second data register means synchronized with access from the central processing unit. A first control logic means (9) for making the data register means readable / writable, and the first data register means in synchronization with the control signal supplied from the second external terminal. The second control logic means (28) which can be accessed from an external terminal, and the control information for determining whether the input / output operation by the first control logic means or the input / output operation by the second control logic means is the central control means. Depending on the processing equipment Given control register means includes a (27).

【0014】上記手段によれば、第1のデータレジスタ
手段に対するデータ入出力動作を第2の外部端子を介し
て外部から制御することができる。すなわち、マイクロ
コンピュータ内部のバスサイクルとは非同期で第1のデ
ータレジスタ手段に外部からアクセスすることができ
る。第1のデータレジスタ手段に対するアクセス制御を
マイクロコンピュータ内部のバスサイクルの同期させる
か、第2の外部端子から供給される信号に同期させるか
は、制御レジスタ手段を介してCPUが決定することが
できる。
According to the above means, the data input / output operation with respect to the first data register means can be externally controlled via the second external terminal. That is, the first data register means can be externally accessed asynchronously with the bus cycle inside the microcomputer. Whether the access control to the first data register means is synchronized with the bus cycle inside the microcomputer or the signal supplied from the second external terminal can be determined by the CPU via the control register means. .

【0015】前記制御レジスタ手段は、前記第1の制御
論理手段による入出力動作か前記第2の制御論理手段に
よる入出力動作かを指定する第1の制御情報(CNT
R)の記憶領域を有することにより、ポート回路に前記
何れのインタフェース同期形式を採用するかは、CPU
の動作プログラムにしたがって任意に決定でき、随時変
更することも可能になる。
The control register means includes first control information (CNT) for designating an input / output operation by the first control logic means or an input / output operation by the second control logic means.
By having the storage area of R), which of the interface synchronization types is adopted for the port circuit depends on the CPU.
Can be arbitrarily determined according to the operation program described above, and can be changed at any time.

【0016】前記第1のデータレジスタ手段は、前記第
1の制御論理手段及び第2の制御論理手段によって夫々
動作が選択される複数個のデータレジスタ(22〜2
5)を有する。したがって、複数のデータレジスタの中
から任意に選択されたデータレジスタを第1の外部端子
に接続できるから、ポート回路の外部端子の数を増やす
ことなくポート回路のデータ入出力機能を向上させるこ
とができる。換言すれば、ポート回路の外部端子数で決
まる並列入出力データビット数のデータを複数個のデー
タレジスタに複数単位保持させ、或いは複数単位保持さ
れたデータを選択して出力させることができる。ポート
端子と兼用できる端子数を単に増やすのとは別の意味
で、ポート回路の高機能化を実現できる。
The first data register means includes a plurality of data registers (22 to 2) whose operations are selected by the first control logic means and the second control logic means, respectively.
5). Therefore, a data register arbitrarily selected from a plurality of data registers can be connected to the first external terminal, so that the data input / output function of the port circuit can be improved without increasing the number of external terminals of the port circuit. it can. In other words, data of the number of parallel input / output data bits determined by the number of external terminals of the port circuit can be held in a plurality of data registers in a plurality of units, or data held in a plurality of units can be selected and output. In a sense different from simply increasing the number of terminals that can also be used as port terminals, a high-performance port circuit can be realized.

【0017】前記第2の制御論理手段は、前記第2の外
部端子から供給される制御信号に含まれるレジスタ指定
情報(sel0〜sel3)に従って前記第1のレジス
タ手段に含まれるデータレジスタを選択し、前記第2の
外部端子から供給される制御信号に含まれるリード・ラ
イト指定情報(EX/IN)に従って前記データレジス
タに対するリード・ライト動作を選択し、前記第2の外
部端子から供給される制御信号に含まれるタイミング情
報(ST)に同期して前記データレジスタにリード・ラ
イト動作をさせることができる。
The second control logic means selects a data register included in the first register means in accordance with register designation information (sel0 to sel3) included in a control signal supplied from the second external terminal. A read / write operation for the data register is selected in accordance with read / write designation information (EX / IN) included in a control signal supplied from the second external terminal, and a control supplied from the second external terminal is selected. The read / write operation can be performed on the data register in synchronization with the timing information (ST) included in the signal.

【0018】前記第2の制御論理手段は、前記レジスタ
指定情報に代えて、前記第1の外部端子の特定の状態毎
に前記データレジスタの選択を順次切換え可能にするこ
とも可能である。このとき、前記制御レジスタ手段は、
レジスタ選択を前記レジスタ指定情報に基づいて行う
か、又は前記第1の外部端子の特定の状態毎に切換える
かを前記第2の制御論理手段に指示する第2の制御情報
(MD0,MD1)の記憶領域を有することができる。
The second control logic means can switch the selection of the data register for each specific state of the first external terminal in place of the register designation information. At this time, the control register means:
The second control information (MD0, MD1) for instructing the second control logic means whether to select a register based on the register designation information or to switch for each specific state of the first external terminal. It can have a storage area.

【0019】[0019]

【発明の実施の形態】図6には本発明の一実施例に係る
マイクロコンピュータのブロック図が示される。同図に
示されるマイクロコンピュータは、特に制限されない
が、CMOSなどの公知の半導体集積回路製造技術によ
って単結晶シリコンのような1個の半導体基板に形成さ
れる。
FIG. 6 is a block diagram of a microcomputer according to an embodiment of the present invention. Although not particularly limited, the microcomputer shown in FIG. 1 is formed on one semiconductor substrate such as single crystal silicon by a known semiconductor integrated circuit manufacturing technique such as CMOS.

【0020】同図に示されるマイクロコンピュータにお
いて、CPU3はアドレスバス1およびデータバス2に
対し、アドレス、データの入出力機能を有する。また、
バスステートコントローラ4は、アドレスバス1、デー
タバス2、周辺アドレスバス6、周辺データバス7に対
し、アドレス、データの入出力機能を有する。CPU3
とバスステートコントローラ4は、アドレスバス1およ
びデータバス2を共有する。さらに、周辺アドレスバス
6及び周辺データバス7には、周辺回路の一例としてポ
ート回路8A,8Bが接続されている。前記CPU3
は、特に制限されないが、前記周辺アドレスバス6及び
周辺データバス7に接続された図示を省略するプログラ
ムメモリから命令をフェッチし、フェッチした命令を解
読して実行する。例えば、CPU3がロード命令又はス
トア命令などを実行するとき、アクセス対象領域が周辺
アドレスバス6及び周辺データバス7に接続された周辺
回路上にある場合、その時のアドレスバス1上のアクセ
スアドレスに従って前記バスステートコントローラ4が
周辺アドレスバス6及び周辺データバス7を用いたバス
サイクルを起動する。
In the microcomputer shown in FIG. 1, a CPU 3 has an address and data input / output function for an address bus 1 and a data bus 2. Also,
The bus state controller 4 has an address and data input / output function with respect to the address bus 1, the data bus 2, the peripheral address bus 6, and the peripheral data bus 7. CPU3
And bus state controller 4 share address bus 1 and data bus 2. Further, port circuits 8A and 8B are connected to the peripheral address bus 6 and the peripheral data bus 7 as an example of a peripheral circuit. The CPU 3
Fetches an instruction from a program memory (not shown) connected to the peripheral address bus 6 and the peripheral data bus 7, and decodes and executes the fetched instruction. For example, when the CPU 3 executes a load instruction or a store instruction, and the access target area is on a peripheral circuit connected to the peripheral address bus 6 and the peripheral data bus 7, the access target area is described according to the access address on the address bus 1 at that time. The bus state controller 4 starts a bus cycle using the peripheral address bus 6 and the peripheral data bus 7.

【0021】前記ポート回路8Bは一般的なポート回路
の構成を有し、前記ポート回路8Aは多機能化されたポ
ート回路であり、夫々は入出力ポートモジュールを構成
する。
The port circuit 8B has a general port circuit configuration, and the port circuit 8A is a multifunctional port circuit, each of which constitutes an input / output port module.

【0022】先ず、図5に従って前記ポート回路8Bの
構成を説明する。特に制限されないが、ポート回路8B
はポート3とポート4を構成する。ポート3は、特に制
限されないが、8個のポート端子P3(0)〜P3(7)、端
子制御ロジック15、データレジスタ13及び制御レジ
スタ12を有する。ポート4は、特に制限されないが、
8個のポート端子P4(0)〜P4(7)、端子制御ロジック
19、データレジスタ17及び制御レジスタ18を有す
る。前記制御レジスタ12,18及びデータレジスタ1
3,17はモジュール内データバス11を介してデータ
ラッチ回路10に結合される。
First, the configuration of the port circuit 8B will be described with reference to FIG. Although not particularly limited, the port circuit 8B
Constitutes port 3 and port 4. The port 3 has eight port terminals P3 (0) to P3 (7), a terminal control logic 15, a data register 13, and a control register 12, although not particularly limited. Port 4 is not particularly limited,
It has eight port terminals P4 (0) to P4 (7), terminal control logic 19, data register 17, and control register 18. The control registers 12, 18 and the data register 1
Reference numerals 3 and 17 are connected to the data latch circuit 10 via the data bus 11 in the module.

【0023】前記制御レジスタ12,18及びデータレ
ジスタ13,17に対するレジスタ選択はデコーダ9が
行う。デコーダ9は周辺アドレスバス6から供給される
アドレス信号をデコードして前記制御レジスタ12,1
8及びデータレジスタ13,17の中から一つのレジス
タを排他的に選択する。選択されたレジスタはモジュー
ル内データバス11とデータラッチ回路10を介して周
辺データバス7に接続される。前記制御レジスタ12,
18及びデータレジスタ13,17に対するリード・ラ
イトなど指示はバスステートコントローラ4から周辺コ
ントロールバス5を介して与えられる。前記バスステー
トコントローラ4は、周辺バス6,7を利用したバスサ
イクルを起動するとき、ライト信号、リード信号、アク
セスサイズ信号などの制御信号を周辺コントロールバス
5に出力する。これにより、データレジスタ13,17
及び制御レジスタ12,18はCPU3によって自由に
アクセスされる。レジスタライト時、データラッチ回路
10より出力されるデータが、デコーダ9によって選択
されたレジスタに書き込まれる。レジスタリード時は、
デコーダ9によって選択されたレジスタのデータがデー
タラッチ回路10に送られ、さらにデータラッチ回路1
0から周辺データバス7を通してバスステートコントロ
ーラ4に送られる。
The decoder 9 selects the registers for the control registers 12 and 18 and the data registers 13 and 17. The decoder 9 decodes an address signal supplied from the peripheral address bus 6 and decodes the control register 12, 1
8 and one of the data registers 13 and 17 is exclusively selected. The selected register is connected to the peripheral data bus 7 via the data bus 11 in the module and the data latch circuit 10. The control register 12,
Instructions such as read / write 18 and data registers 13 and 17 are given from the bus state controller 4 via the peripheral control bus 5. The bus state controller 4 outputs control signals such as a write signal, a read signal, and an access size signal to the peripheral control bus 5 when activating a bus cycle using the peripheral buses 6 and 7. Thereby, the data registers 13, 17
The control registers 12 and 18 are freely accessed by the CPU 3. At the time of register write, data output from the data latch circuit 10 is written to a register selected by the decoder 9. When reading the register,
The data of the register selected by the decoder 9 is sent to the data latch circuit 10, and the data latch circuit 1
0 to the bus state controller 4 through the peripheral data bus 7.

【0024】前記ポート3のポート端子P3(0)〜P3
(7)は端子制御ロジック15を介して信号線14と前記
データレジスタ13に接続される。この例に従えば、8
ビットのポート端子P3(0)〜P3(7)に対応して、前記
信号線14とデータレジスタ13は夫々8ビット構成と
される。端子制御ロジック15は、制御レジスタ12か
ら与えられる制御情報にしたがって、信号線14のデー
タをポート端子P3(0)〜P3(7)から出力する状態、デ
ータレジスタ13の値をポート端子P3(0)〜P3(7)か
ら出力する状態、ポート端子P3(0)〜P3(7)からの入
力信号を信号線14に供給する状態、ポート端子P3
(0)〜P3(7)からの入力信号をデータレジスタ13に供
給する状態、又はポート端子P3(0)〜P3(7)の入出力
動作を無効にする状態の中から何れかの状態を選択す
る。
The port terminals P3 (0) to P3 of the port 3
(7) is connected to the signal line 14 and the data register 13 via the terminal control logic 15. According to this example, 8
The signal line 14 and the data register 13 each have an 8-bit configuration corresponding to the bit port terminals P3 (0) to P3 (7). The terminal control logic 15 outputs the data of the signal line 14 from the port terminals P3 (0) to P3 (7) in accordance with the control information given from the control register 12, and outputs the value of the data register 13 to the port terminal P3 (0 ) -P3 (7), output from port terminals P3 (0) -P3 (7) to signal line 14, port terminal P3
(0) to P3 (7) to supply the input signal to the data register 13 or to disable any of the input / output operations of the port terminals P3 (0) to P3 (7). select.

【0025】同様に、前記ポート4のポート端子P4
(0)〜P4(7)は端子制御ロジック19を介して信号線2
1と前記データレジスタ17に接続される。この例に従
えば、8ビットのポート端子P4(0)〜P4(7)に対応し
て、前記信号線21とデータレジスタ17は夫々8ビッ
ト構成とされる。端子制御ロジック19は、制御レジス
タ18から与えられる制御情報にしたがって、信号線2
1のデータをポート端子P4(0)〜P4(7)から出力する
状態、データレジスタ17の値をポート端子P4(0)〜
P4(7)から出力する状態、ポート端子P4(0)〜P4
(7)からの入力信号を信号線21に供給する状態、ポー
ト端子P4(0)〜P4(7)からの入力信号をデータレジス
タ17に供給する状態、又はポート端子P4(0)〜P4
(7)の入出力動作を無効にする状態の中から何れかの状
態を選択する。
Similarly, the port terminal P4 of the port 4
(0) to P4 (7) are connected to the signal line 2 via the terminal control logic 19.
1 and the data register 17. According to this example, the signal line 21 and the data register 17 each have an 8-bit configuration corresponding to the 8-bit port terminals P4 (0) to P4 (7). The terminal control logic 19 controls the signal line 2 according to the control information given from the control register 18.
1 data is output from the port terminals P4 (0) to P4 (7), and the value of the data register 17 is changed from the port terminals P4 (0) to P4 (0).
Output from P4 (7), port terminals P4 (0) to P4
(7) is supplied to the signal line 21, the input signals from the port terminals P4 (0) to P4 (7) are supplied to the data register 17, or the port terminals P4 (0) to P4
Either of the states in which the input / output operation of (7) is invalidated is selected.

【0026】前記信号線14、21はポート以外の図示
を省略する別の内部モジュールと接続されている。すな
わち、ポート端子P3(0)〜P3(7)は信号線14の端子
を兼ねている。同様に、ポート端子P4(0)〜P4(7)は
信号線21の端子を兼ねている。
The signal lines 14 and 21 are connected to other internal modules other than ports, not shown. That is, the port terminals P3 (0) to P3 (7) also serve as terminals of the signal line 14. Similarly, the port terminals P4 (0) to P4 (7) also serve as terminals of the signal line 21.

【0027】上記より明らかなように、ポート回路8B
では、ポート端子P3(0)〜P3(7),P4(0)〜P4(7)
を介するデータ入出力動作において、データレジスタ1
3,17の選択はバスステートコントローラ4が周辺ア
ドレスバス6に出力するアドレス出力動作に同期され、
データレジスタ13,17に対するリード・ライト動作
の指示はバスステートコントローラ4から周辺コントロ
ールバス5に出力される制御信号に同期され、また、デ
ータレジスタ13,17と周辺データバス7との間のデ
ータ転送はバスステートコントローラ4が起動するバス
サイクルに同期される。したがって、ポート回路8Bの
データ入出力動作は、基本的にマイクロコンピュータ内
部のバスサイクルに同期して行われるだけである。
As is clear from the above, the port circuit 8B
Then, the port terminals P3 (0) to P3 (7), P4 (0) to P4 (7)
In the data input / output operation via the
The selection of 3, 17 is synchronized with the address output operation that the bus state controller 4 outputs to the peripheral address bus 6,
The instruction of the read / write operation to the data registers 13 and 17 is synchronized with the control signal output from the bus state controller 4 to the peripheral control bus 5, and the data transfer between the data registers 13 and 17 and the peripheral data bus 7 is performed. Are synchronized with the bus cycle activated by the bus state controller 4. Therefore, the data input / output operation of the port circuit 8B is basically performed only in synchronization with the bus cycle inside the microcomputer.

【0028】次に前記ポート回路8Aの一例を図1を参
照しながら説明する。特に制限されないが、ポート回路
8Aはポート1とポート2を構成する。ポート1は、特
に制限されないが、8個のポート端子P1(0)〜P1
(7)、端子制御ロジック16、データレジスタ22〜2
5及び制御レジスタ32を有する。ポート2は、特に制
限されないが、8個のポート端子P2(0)〜P2(7)、端
子制御ロジック20、データレジスタ26及び制御レジ
スタ38を有する。前記制御レジスタ32,38及びデ
ータレジスタ22〜25,26はモジュール内データバ
ス31を介してラッチ回路33に結合される。特に制限
されないが、前記データレジスタ22〜26,26及び
制御レジスタ32,38は夫々8ビットの構成を有す
る。
Next, an example of the port circuit 8A will be described with reference to FIG. Although not particularly limited, the port circuit 8A configures the port 1 and the port 2. Although the port 1 is not particularly limited, eight port terminals P1 (0) to P1
(7), terminal control logic 16, data registers 22-2
5 and a control register 32. The port 2 includes, but is not limited to, eight port terminals P2 (0) to P2 (7), a terminal control logic 20, a data register 26, and a control register 38. The control registers 32 and 38 and the data registers 22 to 25 and 26 are connected to a latch circuit 33 via a data bus 31 in the module. Although not particularly limited, each of the data registers 22 to 26 and 26 and the control registers 32 and 38 has an 8-bit configuration.

【0029】ポート回路8Aにおいて、ポート端子P1
(0)〜P1(7),P2(0)〜P2(7)を介するデータ入出力
動作は、前記ポート回路8Bと同様にマイクロコンピュ
ータ内部のバスサイクルに同期して行うと第1の入出力
制御モード、又は、ポート端子P2(0)〜P2(7)を介し
て外部から供給されるタイミング信号などに同期してポ
ート端子P1(0)〜P1(7)から入出力される第2の入出
力制御モードを選択できるように構成されている。
In the port circuit 8A, the port terminal P1
When the data input / output operation via (0) to P1 (7) and P2 (0) to P2 (7) is performed in synchronization with the bus cycle inside the microcomputer as in the case of the port circuit 8B, the first input / output operation is performed. The control mode or the second input / output from the port terminals P1 (0) to P1 (7) in synchronization with a timing signal or the like externally supplied via the port terminals P2 (0) to P2 (7). The input / output control mode is configured to be selectable.

【0030】先ず、前記第1の入出力制御モードを実現
するために、前記制御レジスタ32,38及びデータレ
ジスタ22〜26に対するレジスタ選択を行うデコーダ
34が設けられる。デコーダ34は周辺アドレスバス6
から供給されるアドレス信号をデコードして前記制御レ
ジスタ32,38及びデータレジスタ22〜26の中か
ら一つのレジスタを排他的に選択する。特にデータレジ
スタ22〜25に対する選択態様は後述する二通りの態
様がある。選択されたレジスタはモジュール内データバ
ス31とデータラッチ33を介して周辺データバス7に
接続される。前記制御レジスタ32,38及びデータレ
ジスタ22〜26に対するリード・ライトなど指示は前
記周辺コントロールバス5を介して与えられる。これに
より、前記制御レジスタ32,38及びデータレジスタ
22〜26はCPU3によって自由にアクセスされる。
レジスタライト時、データラッチ回路33より出力され
るデータが、デコーダ34によって選択されたレジスタ
に書き込まれる。レジスタリード時は、デコーダ34に
よって選択されたレジスタのデータがデータラッチ回路
33に送られ、さらにデータラッチ回路33から周辺デ
ータバス7を通してバスステートコントローラ4に送ら
れる。
First, in order to realize the first input / output control mode, a decoder 34 for selecting the control registers 32 and 38 and the data registers 22 to 26 is provided. The decoder 34 is connected to the peripheral address bus 6
And exclusively selects one register from the control registers 32 and 38 and the data registers 22 to 26. In particular, there are two modes for selecting the data registers 22 to 25, which will be described later. The selected register is connected to the peripheral data bus 7 via the module data bus 31 and the data latch 33. Instructions such as read / write for the control registers 32 and 38 and the data registers 22 to 26 are given via the peripheral control bus 5. Thus, the control registers 32 and 38 and the data registers 22 to 26 can be freely accessed by the CPU 3.
At the time of register write, data output from the data latch circuit 33 is written to a register selected by the decoder 34. At the time of register reading, the data of the register selected by the decoder 34 is sent to the data latch circuit 33, and further sent from the data latch circuit 33 to the bus state controller 4 through the peripheral data bus 7.

【0031】前記ポート1のポート端子P1(0)〜P1
(7)は端子制御ロジック16を介して前記信号線14と
前記データレジスタ22〜25に接続される。端子制御
ロジック16は、制御レジスタ32から与えられる制御
情報にしたがって、信号線14のデータをポート端子P
1(0)〜P1(7)から出力する状態、データレジスタ22
〜25の中から選択された一つのデータレジスタの値を
ポート端子P1(0)〜P1(7)から出力する状態、ポート
端子P1(0)〜P1(7)からの入力信号を信号線14に供
給する状態、ポート端子P1(0)〜P1(7)からの入力信
号をデータレジスタ22〜25の中から選択された一つ
のデータレジスタに供給する状態、又はポート端子P1
(0)〜P1(7)の入出力動作を無効にする状態、の中から
何れかの状態を選択する。
Port terminals P1 (0) to P1 of the port 1
(7) is connected to the signal line 14 and the data registers 22 to 25 via the terminal control logic 16. The terminal control logic 16 transfers the data of the signal line 14 to the port terminal P in accordance with the control information given from the control register 32.
1 (0) to output from P1 (7), data register 22
25, a state in which the value of one data register selected from among the data terminals is output from the port terminals P1 (0) to P1 (7), and the input signal from the port terminals P1 (0) to P1 (7) is , The state where the input signals from the port terminals P1 (0) to P1 (7) are supplied to one data register selected from the data registers 22 to 25, or the state where the port terminal P1
One of the states (0) to P1 (7) in which the input / output operation is invalidated is selected.

【0032】同様に、前記ポート2のポート端子P2
(0)〜P2(7)は端子制御ロジック20を介して前記信号
線21と前記データレジスタ26に接続される。端子制
御ロジック20は、制御レジスタ38から与えられる制
御情報にしたがって、信号線21のデータをポート端子
P2(0)〜P2(7)から出力する状態、データレジスタ2
6の値をポート端子P2(0)〜P2(7)から出力する状
態、ポート端子P2(0)〜P2(7)からの入力信号を信号
線21に供給する状態、ポート端子P2(0)〜P2(7)か
らの入力信号をデータレジスタ26に供給する状態、又
はポート端子P2(0)〜P2(7)の入出力動作を無効にす
る状態、の中から何れかの状態を選択する。
Similarly, the port terminal P2 of the port 2
(0) to P2 (7) are connected to the signal line 21 and the data register 26 via the terminal control logic 20. The terminal control logic 20 outputs the data of the signal line 21 from the port terminals P2 (0) to P2 (7) according to the control information given from the control register 38.
6, the state where the value of 6 is output from the port terminals P2 (0) to P2 (7), the state where the input signals from the port terminals P2 (0) to P2 (7) are supplied to the signal line 21, the state where the port terminal P2 (0) PP2 (7) is supplied to the data register 26, or the input / output operation of the port terminals P2 (0) 〜P2 (7) is disabled. .

【0033】上記説明から明らかなように、このポート
回路8Aは、一組のポート端子P1(0)〜P1(7)に対し
て4個のデータレジスタ22〜25が設けられている。
これにより、複数のデータレジスタ22〜25の内から
選択されたデータレジスタに一組のポート端子P1(0)
〜P1(7)を接続でき、ポート回路の外部端子の数を増
やすことなくポート回路のデータ入出力機能を向上させ
ることができる。換言すれば、ポート回路の外部端子数
で決まる並列入出力データビット数のデータを複数個の
データレジスタに複数単位保持させ、或いは複数単位保
持されたデータを選択して出力させることができる。
As is clear from the above description, this port circuit 8A is provided with four data registers 22 to 25 for a set of port terminals P1 (0) to P1 (7).
As a result, a set of port terminals P1 (0) is stored in a data register selected from the plurality of data registers 22 to 25.
~ P1 (7) can be connected, and the data input / output function of the port circuit can be improved without increasing the number of external terminals of the port circuit. In other words, data of the number of parallel input / output data bits determined by the number of external terminals of the port circuit can be held in a plurality of data registers in a plurality of units, or data held in a plurality of units can be selected and output.

【0034】ポート回路8Aにおいて前記第2の入出力
制御モードを実現するために、制御論理回路28及びイ
ネーブルレジスタ27が設けられている。前記制御論理
回路28は、前記ポート端子P2(0)〜P2(7)から供給
される制御信号に応答して前記第1のデータレジスタ2
2〜25を前記第1のポート端子P1(0)〜P1(7)から
アクセス可能にする制御論理を有する。前記イネーブル
レジスタ27は、少なくとも、前記第1の入出力制御モ
ードか前記第2の入出力制御モードかを制御するための
制御情報がCPU3によって設定されるレジスタであ
る。このイネーブルレジスタ27は前記制御レジスタ3
2と同様にデコーダ34及びラッチ33を介して制御情
報が設定される。
In order to realize the second input / output control mode in the port circuit 8A, a control logic circuit 28 and an enable register 27 are provided. The control logic circuit 28 responds to a control signal supplied from the port terminals P2 (0) to P2 (7) to control the first data register 2
It has control logic for making 2 to 25 accessible from the first port terminals P1 (0) to P1 (7). The enable register 27 is a register in which at least control information for controlling the first input / output control mode or the second input / output control mode is set by the CPU 3. The enable register 27 is provided in the control register 3
Control information is set via the decoder 34 and the latch 33 in the same manner as in (2).

【0035】図2には前記第2の入出力状態においてポ
ート端子P2(0)〜P2(7)から端子制御ロジック20を
介して制御論理回路28に供給される制御情報(コント
ロール信号)の仕様の一例が示される。図2においてD
0〜D7は例えばポート端子P2(0)〜P2(7)に対応さ
れるものと理解されたい。データレジスタ22〜25の
中からアクセスするデータレジスタを選択するために、
D7〜D4はレジスタ指定情報(レジスタ選択信号)s
el3〜sel0とされる。レジスタ選択信号sel3
〜sel0は、論理値“1”若しくはハイレベル“H”
が選択、論理値“0”若しくはローレベル(“L”)が
非選択を指示する。D3は、データレジスタ22〜25
にアクセスするとき、リード動作かライト動作かを指示
するリード・ライト指定情報(リード・ライト信号)E
X/INとされる。リード・ライト信号EX/INは、
論理値“1”がレジスタライト動作(端子入力動作)を
指示し、論理値“0”がレジスタライト動作(端子出力
動作)を指示する。特に制限されないが、前記端子入力
動作中にCPU3が同じデータレジスタに対しライトし
ようとした場合、前記端子入力動作が優先され、CPU
3のライト動作は無視される。逆に、端子出力動作中に
CPU3が同じデータレジスタにライトしようとした場
合、CPU3のライト動作が優先されるようになってい
るから、データラッチ回路10から出力されるライトデ
ータがデータレジスタにライトされ、ポート端子P1
(0)〜P1(7)にはデータラッチ回路10が出力するライ
トデータが出力される。D2は前記レジスタ選択信号s
el3〜sel0などのコントロール信号の入力に並行
してポート端子P1(0)〜P1(7)から入出力されるデー
タなどの有効性を示すストローブ信号STとされる。特
に制限されないが、ストローブ信号STは、論理値
“0”がデータの有効を意味する。このストローブ信号
STは、データレジスタ22〜25に対して実際にリー
ド・ライト動作を行うときのタイミング信号として位置
付けられる。
FIG. 2 shows the specifications of the control information (control signal) supplied to the control logic circuit 28 from the port terminals P2 (0) to P2 (7) via the terminal control logic 20 in the second input / output state. Is shown. In FIG.
It should be understood that 0 to D7 correspond to, for example, port terminals P2 (0) to P2 (7). In order to select a data register to be accessed from the data registers 22 to 25,
D7 to D4 are register designation information (register selection signal) s
el3 to sel0. Register selection signal sel3
Ssel0 is a logical value “1” or a high level “H”
Indicates selection, and a logical value “0” or a low level (“L”) indicates non-selection. D3 is the data register 22 to 25
When accessing the read / write operation, read / write designation information (read / write signal) E indicating a read operation or a write operation
X / IN. The read / write signal EX / IN is
A logical value “1” indicates a register write operation (terminal input operation), and a logical value “0” indicates a register write operation (terminal output operation). Although not particularly limited, if the CPU 3 attempts to write to the same data register during the terminal input operation, the terminal input operation has priority and the CPU 3
The write operation of No. 3 is ignored. Conversely, if the CPU 3 attempts to write to the same data register during the terminal output operation, the write operation of the CPU 3 is prioritized, so that the write data output from the data latch circuit 10 is written to the data register. And the port terminal P1
Write data output from the data latch circuit 10 is output to (0) to P1 (7). D2 is the register selection signal s
The strobe signal ST indicates the validity of data input / output from the port terminals P1 (0) to P1 (7) in parallel with the input of control signals such as el3 to sel0. Although not particularly limited, the logic value “0” of the strobe signal ST means that data is valid. The strobe signal ST is positioned as a timing signal when actually performing a read / write operation on the data registers 22 to 25.

【0036】図3には前記イネーブルレジスタ27のデ
ータ仕様の一例が示される。D7は制御ビットON/O
FFであり、当該ビットON/OFFに論理値“1”が
設定されることにより、ポート1のデータレジスタ22
〜25の全てを有効(すなわち選択可)にし、当該ビッ
トON/OFFの論理値“0”によりポート1のデータ
レジスタ22〜25の内の一つのデータレジスタ22だ
けを有効とする。この制御ビットON/OFFによる指
示は、特に制限されないが、制御論理回路28を介して
制御信号線39からデコーダ34に与えられる。ビット
D6は制御ビットCNTRとされる。制御ビットCNT
Rは、論理値“1”で端子制御モード、論理値“0”で
CPU制御モードが指定される。端子制御モードは前記
第2の入出力制御モードを実現する動作モードである。
CPU制御モードは前記第1の入出力制御モードを実現
する動作モードである。特に制限されないが、端子制御
モードにおいて、前記端子出力動作では、CPU3はデ
ータレジスタ(ON/OFF=“1”のときはデータレ
ジスタ22〜25、ON/OFF=“0”のときはデー
タレジスタ22)に対して書き込みを行うことができ
る。一方、前記端子制御モードにおける前記端子入力動
作では、信号線39を介してデコーダ34によるデータ
レジスタ22〜25の選択は抑止され、CPU3は前記
データレジスタ22〜25に対する書き込みを行うこと
はできない。
FIG. 3 shows an example of the data specification of the enable register 27. D7 is a control bit ON / O
When the logical value “1” is set to the bit ON / OFF, the data register 22 of the port 1
To 25 are made valid (that is, selectable), and only one of the data registers 22 to 25 of the port 1 is made valid by the logical value “0” of the bit ON / OFF. The instruction by the control bit ON / OFF is not particularly limited, but is given from the control signal line 39 to the decoder 34 via the control logic circuit 28. Bit D6 is set as control bit CNTR. Control bit CNT
R designates a terminal control mode by a logical value “1” and a CPU control mode by a logical value “0”. The terminal control mode is an operation mode for realizing the second input / output control mode.
The CPU control mode is an operation mode for realizing the first input / output control mode. Although not particularly limited, in the terminal control mode, in the terminal output operation, the CPU 3 controls the data register (data registers 22 to 25 when ON / OFF = "1", and the data register 22 when ON / OFF = "0"). ) Can be written. On the other hand, in the terminal input operation in the terminal control mode, selection of the data registers 22 to 25 by the decoder 34 via the signal line 39 is suppressed, and the CPU 3 cannot perform writing to the data registers 22 to 25.

【0037】イネーブルレジスタ27のD5,D4は、
端子制御モードにおけるデータレジスタ22〜25の選
択に対するマニュアルモード、自動検出モードの設定ビ
ットである。マニュアルモードでは、データレジスタ2
2〜25の選択は、前記選択信号sel3〜sel0に
よって行われる。自動検出モードが設定されると、ポー
ト端子P1(0)〜P1(7)の状態検出回路40によってポー
ト端子P1(0)〜P1(7)が特定の状態(例えば論理値
“1”と論理値“0”の中間レベル)にされる毎に前記
データレジスタ22〜25の選択状態は順次自動的に切
換えられる。制御論理回路28は、自動検出モードが設
定されると、状態検出回路40から出力される検出信号
41によって前記中間レベルを認識する毎に、データレ
ジスタの選択状態を次にデータレジスタに切換え制御す
る。データレジスタの切換え順序は、特に制限されない
が、データレジスタ22から25の順番とされる。この
とき、イネーブルレジスタ27の制御ビットCONTが
論理値“0”のときは自動検出モードによるデータレジ
スタの自動切換えをデータレジスタ22から25まで一
順して終了する。制御ビットCONTが論理値“1”の
ときは、前記制御ビットMD0がネゲートされるまで、
自動検出モードによるデータレジスタの自動切換えを繰
り返す。
D5 and D4 of the enable register 27 are
These are setting bits for manual mode and automatic detection mode for the selection of the data registers 22 to 25 in the terminal control mode. In manual mode, data register 2
Selection of 2 to 25 is performed by the selection signals sel3 to sel0. When the automatic detection mode is set, the port terminals P1 (0) to P1 (7) are set to a specific state (for example, a logical value “1” and a logical The selection state of the data registers 22 to 25 is automatically switched sequentially each time the value is set to an intermediate level of the value "0". When the automatic detection mode is set, the control logic circuit 28 switches the selection state of the data register to the next data register every time the intermediate level is recognized by the detection signal 41 output from the state detection circuit 40. . The order of switching the data registers is not particularly limited, but is the order of the data registers 22 to 25. At this time, when the control bit CONT of the enable register 27 has the logical value "0", the automatic switching of the data registers in the automatic detection mode is sequentially completed from the data registers 22 to 25. When the control bit CONT is a logical value "1", the control bit
The automatic switching of the data register in the automatic detection mode is repeated.

【0038】図4には前記制御ビットON/OFF=
“1”、CNTR=“1”により4本のデータレジスタ
22〜25を用いた端子制御モードが設定され、MD1
=“1”、MD0=“0”によってマニュアルモードが
設定されたときの、ポート1の動作タイミングチャート
の一例が示される。
FIG. 4 shows the control bit ON / OFF =
The terminal control mode using the four data registers 22 to 25 is set by “1” and CNTR = “1”.
An example of an operation timing chart of the port 1 when the manual mode is set according to = “1” and MD0 = “0” is shown.

【0039】図4においてφはマイクロコンピュータの
バスクロックである。ポート2のポート端子P2(0)〜
P2(7)からの、選択信号sel0〜sel3、信号E
X/IN及びストローブ信号STが、前記バスクロック
φとは非同期で供給される。このとき、選択信号sel
0の論理値“1”(データレジスタ22の選択)に同期
してデータH’12がポート端子P1(0)〜P1(7)から
供給され(バスクロックφとは非同期)、ストローブ信
号STのローレベル期間に同期して当該データがレジス
タ22に書き込まれる。以下、ストローブ信号STのロ
ーレベル期間に同期して順次、ポート端子P1(0)〜P
1(7)から入力されたデータH’56がデータレジスタ
23にライトされ、データH’9Aがデータレジス24
からポート端子P1(0)に出力され、データH’DEが
データレジスタ25からポート端子P1(0)〜P1(7)か
ら出力される。
In FIG. 4, φ is a microcomputer bus clock. Port 2 port terminal P2 (0) ~
Select signals sel0-sel3 and signal E from P2 (7)
The X / IN and the strobe signal ST are supplied asynchronously with the bus clock φ. At this time, the selection signal sel
Data H'12 is supplied from the port terminals P1 (0) to P1 (7) in synchronization with the logical value "1" of 0 (selection of the data register 22) (asynchronous with the bus clock φ), and the strobe signal ST The data is written to the register 22 in synchronization with the low level period. Hereinafter, the port terminals P1 (0) to P1 (P) are sequentially synchronized with the low level period of the strobe signal ST.
The data H'56 input from 1 (7) is written to the data register 23, and the data H'9A is stored in the data register 24.
To the port terminal P1 (0), and the data H'DE is output from the data register 25 from the port terminals P1 (0) to P1 (7).

【0040】次に、図1のポート回路8Aの動作を全体
的に説明する。前記イネーブルレジスタ27の制御ビッ
トON/OFFが“0”にされているときは、ポート1
はデータレジスタ22だけが有効とされ、ポート回路8
Aのポート1、ポート2は、ポート回路8Bのポート
3、ポート4と同じ機能を実現する。従ってこの時は、
ポート1のデータレジスタ23〜25は使用されない。
Next, the operation of the port circuit 8A of FIG. 1 will be described generally. When the control bit ON / OFF of the enable register 27 is set to “0”, the port 1
Indicates that only the data register 22 is valid and the port circuit 8
Ports 1 and 2 of A realize the same functions as ports 3 and 4 of the port circuit 8B. Therefore, at this time,
Port 1 data registers 23-25 are not used.

【0041】イネーブルレジスタ27の制御ビットON
/OFFが“1”にされているときは、データレジスタ
22〜25の中から任意のレジスタを選択して利用する
ことができる。このとき、イネーブルレジスタ27の制
御ビットCNTRにより端子制御モードが選択されてい
るときは、ポート2のポート端子P2(0)〜P2(7)から
入力される選択信号sel3〜sel0を制御論理回路
28がデコードしてデータレジスタ22〜25を選択
し、選択されたデータレジスタに対して、外部からのス
トローブ信号STに同期してリード又はライトすること
ができる。したがって、この端子制御モードでは、CP
U3のバスサイクルと非同期に外部からデータレジスタ
22〜25をリード又はライトすることができる。
Control bit ON of enable register 27
When / OFF is "1", an arbitrary register can be selected from the data registers 22 to 25 and used. At this time, when the terminal control mode is selected by the control bit CNTR of the enable register 27, the selection signals sel3 to sel0 input from the port terminals P2 (0) to P2 (7) of the port 2 are transmitted to the control logic circuit 28. Can decode and select the data registers 22 to 25, and read or write to the selected data register in synchronization with an external strobe signal ST. Therefore, in this terminal control mode, CP
The data registers 22 to 25 can be externally read or written asynchronously with the bus cycle of U3.

【0042】前記制御情報ON/OFFが“1”に設定
されているとき、イネーブルレジスタ27にCPU制御
モードが設定されたときは、制御レジスタ32,38の
設定値にしたがって端子制御ロジック16,20が制御
され、CPU3のバスサイクルに従ってデータレジスタ
22〜25,26がリード・ライトされる。
When the control information ON / OFF is set to "1" and the CPU control mode is set in the enable register 27, the terminal control logics 16 and 20 are set according to the set values of the control registers 32 and 38. Are controlled, and the data registers 22 to 25 and 26 are read / written according to the bus cycle of the CPU 3.

【0043】また、イネーブルレジスタ27の制御ビッ
トMD0,MD1によって自動検出モードが選択されて
いる場合には、例えばポート端子P1(0)〜P1(7)を介
してデータレジスタ22がアクセスされてから当該レジ
スタアクセスの終了が前記検出信号41によって認識さ
れると、次のレジスタアクセス時にはデータレジスタ2
3が自動的に選択される。以下同様に、データレジスタ
25まで自動的な切換えが行われる。このとき、イネー
ブルレジスタ27の制御ビットCONTで自動検出モー
ドを1サイクルで終わらせるように設定している時は、
本機能は自動的にマニュアルモードに戻る。無限に繰り
返すように設定している時は、アクセス先が更に自動的
にデータレジスタ22に戻る。
When the automatic detection mode is selected by the control bits MD0 and MD1 of the enable register 27, for example, after the data register 22 is accessed via the port terminals P1 (0) to P1 (7). When the end of the register access is recognized by the detection signal 41, the data register 2 is accessed at the next register access.
3 is automatically selected. Similarly, automatic switching is performed up to the data register 25 in the same manner. At this time, when the automatic detection mode is set to end in one cycle by the control bit CONT of the enable register 27,
This function automatically returns to the manual mode. When it is set to repeat indefinitely, the access destination automatically returns to the data register 22 further.

【0044】以上本発明者によってなされた発明を実施
形態に基づいて具体的に説明したが、本発明はそれに限
定されるものではなく、その要旨を逸脱しない範囲にお
いて種々変更可能であることは言うまでもない。
Although the invention made by the inventor has been specifically described based on the embodiments, it is needless to say that the present invention is not limited to the embodiments and can be variously modified without departing from the gist of the invention. No.

【0045】例えば、一組のポート端子のビット数、デ
ータレジスタのビット数などは8ビットに限定されず、
16ビット、32ビットなどのビット数を採用すること
も可能である。また、ポート1に示されるようなデータ
レジスタの数は4個に限定されず、2個、6個、8個な
ど適宜の個数を採用することが可能である。また、端子
制御モードによって外部から供給される選択信号はse
l0〜sel3に限定されず、2ビットとし、これを制
御論理回路の内部でデコードしてレジスタ選択信号を形
成してもよい。また、図6ではポート回路を周辺バス
6,7に接続したが、CPU3に直結されるアドレスバ
ス1及びデータバス2に接続することも可能である。ま
た、データレジスタの選択状態の自動切換えは、ポート
端子のハイレベルとローレベルの中間レベル状態を検出
して行う場合に限定されない。信号論理値の定義、若し
くは信号線の駆動形式に応じて、検出すべき状態は種々
変更可能である。
For example, the number of bits of a set of port terminals and the number of bits of a data register are not limited to 8 bits.
It is also possible to adopt a bit number such as 16 bits or 32 bits. Further, the number of data registers as shown in the port 1 is not limited to four, and an appropriate number such as two, six, or eight can be adopted. The selection signal supplied from the outside in the terminal control mode is
The register selection signal is not limited to 10 to sel3, and may be 2 bits, which may be decoded inside the control logic circuit to form a register selection signal. Although the port circuits are connected to the peripheral buses 6 and 7 in FIG. 6, the port circuits may be connected to the address bus 1 and the data bus 2 directly connected to the CPU 3. Further, the automatic switching of the selection state of the data register is not limited to the case where the selection is performed by detecting an intermediate level state between the high level and the low level of the port terminal. The state to be detected can be variously changed according to the definition of the signal logic value or the driving form of the signal line.

【0046】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるマイク
ロコンピュータに適用した場合について説明したが、本
発明はそれに限定されず、マイクロプロセッサ、通信プ
ロトコル制御などに用いられる専用論理LSIなどの各
種半導体集積回路に広く適用することができる。
In the above description, the case where the invention made by the present inventor is mainly applied to a microcomputer which is a field of application as a background has been described. However, the present invention is not limited to this, and a microprocessor, a communication protocol control, and the like. The present invention can be widely applied to various semiconductor integrated circuits such as dedicated logic LSIs used for such purposes.

【0047】[0047]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.

【0048】すなわち、第2の外部端子から供給される
制御情報に従って、ポート回路のデータレジスタを第1
の外部端子からデータリード・データライトすることが
できる。したがって、ポート回路のデータレジスタをマ
イクロコンピュータ若しくは半導体集積回路の内部バス
サイクルに同期させて、また、内部バスサイクルとは非
同期で、アクセスしてデータの入出力を行うことができ
る。
That is, according to the control information supplied from the second external terminal, the data register of the port circuit is stored in the first register.
Data can be read / written from the external terminal of Therefore, data input / output can be performed by accessing the data register of the port circuit in synchronization with the internal bus cycle of the microcomputer or the semiconductor integrated circuit and asynchronously with the internal bus cycle.

【0049】また、前記第1の外部端子に対してデータ
レジスタが複数個設けられることにより、複数個のデー
タレジスタの中から任意に選択されたデータレジスタを
第1の外部端子に接続でき、ポート回路の外部端子の数
を増やすことなくポート回路のデータ入出力機能を向上
させることができる。換言すれば、ポート回路の外部端
子数で決まる並列入出力データビット数のデータを複数
個のデータレジスタに複数単位保持させ、或いは複数単
位保持されたデータを選択して出力させることができ
る。
Further, by providing a plurality of data registers for the first external terminal, a data register arbitrarily selected from the plurality of data registers can be connected to the first external terminal. The data input / output function of the port circuit can be improved without increasing the number of external terminals of the circuit. In other words, data of the number of parallel input / output data bits determined by the number of external terminals of the port circuit can be held in a plurality of data registers in a plurality of units, or data held in a plurality of units can be selected and output.

【0050】前記複数個のデータレジスタに対してアド
レス信号又はそれに類似する選択情報を用いて個々に所
望のデータレジスタを選択する動作と、第1の外部端子
の中間レベル状態のような特定の状態毎にデータレジス
タの選択状態を自動的に切りかえる動作とを選択するこ
とができる。
An operation of individually selecting a desired data register for the plurality of data registers using an address signal or selection information similar thereto, and a specific state such as an intermediate level state of the first external terminal. An operation of automatically switching the selection state of the data register can be selected every time.

【0051】上記により、ポート端子と兼用できる端子
数を単に増やすのとは別の意味で、ポート回路の高機能
化を実現することができる。
As described above, it is possible to realize a high-performance port circuit in a sense different from simply increasing the number of terminals that can also be used as port terminals.

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

【図1】CPU制御モードと端子制御モードとを有する
ポート回路の一例を示すブロック図である。
FIG. 1 is a block diagram illustrating an example of a port circuit having a CPU control mode and a terminal control mode.

【図2】端子制御モードにおいてポート端子から制御論
理回路に供給される制御情報(コントロール信号)の仕
様の一例を示す説明図である。
FIG. 2 is an explanatory diagram showing an example of specifications of control information (control signal) supplied to a control logic circuit from a port terminal in a terminal control mode.

【図3】イネーブルレジスタのデータ仕様の一例を示す
説明図である。
FIG. 3 is an explanatory diagram showing an example of data specifications of an enable register.

【図4】端子制御モードによる入出力動作の一例を示す
タイミングチャートである。
FIG. 4 is a timing chart showing an example of an input / output operation in a terminal control mode.

【図5】端子制御モードを備えていないポート回路の一
例説明図である。
FIG. 5 is an explanatory diagram of an example of a port circuit having no terminal control mode.

【図6】本発明の一実施例に係るマイクロコンピュータ
のブロック図である。
FIG. 6 is a block diagram of a microcomputer according to one embodiment of the present invention.

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

1 アドレスバス 2 データバス 3 CPU 4 バスステートコントローラ 5 周辺コントロールバス 6 周辺アドレスバス 7 周辺データバス 8A,8B ポート回路 P1(0)〜P1(7),P2(0)〜P2(7) ポート端子 16 端子制御ロジック 20 端子制御ロジック 22〜25 データレジスタ 27 イネーブルレジスタ 26 データレジスタ 28 制御論理回路 32 制御レジスタ 34 デコーダ 38 制御レジスタ 40 状態検出回路 sel3〜sel0 選択信号 EX/IN リード・ライト信号 ST ストローブ信号 DESCRIPTION OF SYMBOLS 1 Address bus 2 Data bus 3 CPU 4 Bus state controller 5 Peripheral control bus 6 Peripheral address bus 7 Peripheral data bus 8A, 8B Port circuit P1 (0) -P1 (7), P2 (0) -P2 (7) port terminal 16 terminal control logic 20 terminal control logic 22 to 25 data register 27 enable register 26 data register 28 control logic circuit 32 control register 34 decoder 38 control register 40 state detection circuit sel3 to sel0 selection signal EX / IN read / write signal ST strobe signal

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 半導体基板に、バスアクセス制御手段
と、このバスアクセス制御手段に接続された内部バス
と、前記内部バスに接続されると共に半導体基板の外部
とインタフェース可能にされたポート回路とを含み、 前記ポート回路は、第1のデータレジスタ手段と、第2
のデータレジスタ手段と、前記第1のデータレジスタ手
段に対するデータの外部入出力に割り当てられた第1の
外部端子と、前記第2のデータレジスタ手段に対するデ
ータの外部入出力に割り当てられた第2の外部端子と、
前記内部バスからのアクセスに同期して前記第1のデー
タレジスタ手段及び第2のデータレジスタ手段をリード
・ライト可能にする第1のレジスタ制御手段と、前記第
2の入力端子から供給される制御信号に同期して前記第
1のデータレジスタ手段を前記第1の外部端子からアク
セス可能にする第2のレジスタ制御手段と、を含んで成
るものであることを特徴とする半導体集積回路。
1. A semiconductor substrate comprising: a bus access control means; an internal bus connected to the bus access control means; and a port circuit connected to the internal bus and capable of interfacing with the outside of the semiconductor substrate. Wherein the port circuit comprises: first data register means;
A data register means, a first external terminal assigned to external input / output of data to the first data register means, and a second external terminal assigned to external input / output of data to the second data register means. External terminals,
First register control means for making the first data register means and second data register means readable / writable in synchronization with access from the internal bus, and control supplied from the second input terminal A second register control means for making the first data register means accessible from the first external terminal in synchronization with a signal.
【請求項2】 中央処理装置と、前記中央処理装置によ
ってアクセスされると共に外部とインタフェース可能に
されたポート回路とを含み、 前記ポート回路は、第1のデータレジスタ手段と、第2
のデータレジスタ手段と、前記第1のデータレジスタ手
段に対するデータの外部入出力に割り当てられた第1の
外部端子と、前記第2のデータレジスタ手段に対するデ
ータの外部入出力に割り当てられた第2の外部端子と、
前記中央処理装置からのアクセスに同期して前記第1の
データレジスタ手段及び第2のデータレジスタ手段をリ
ード・ライト可能にする第1の制御論理手段と、前記第
2の外部端子から供給される制御信号に同期して前記第
1のデータレジスタ手段を前記第1の外部端子からアク
セス可能にする第2の制御論理手段と、前記第1の制御
論理手段による入出力動作か前記第2の制御論理手段に
よる入出力動作かを決定する制御情報が前記中央処理装
置によって与えられる制御レジスタ手段と、を含んで成
るものであることを特徴とするマイクロコンピュータ。
2. A central processing unit, and a port circuit accessed by the central processing unit and interfaced with the outside, the port circuit comprising: first data register means;
A data register means, a first external terminal assigned to external input / output of data to the first data register means, and a second external terminal assigned to external input / output of data to the second data register means. External terminals,
First control logic means for making the first data register means and second data register means readable / writable in synchronization with access from the central processing unit; and supplied from the second external terminal. A second control logic means for making the first data register means accessible from the first external terminal in synchronization with a control signal; and an input / output operation by the first control logic means or the second control And a control register means provided with control information for determining whether the input / output operation is performed by the logic means by the central processing unit.
【請求項3】 前記制御レジスタ手段は、前記第1の制
御論理手段による入出力動作か前記第2の制御論理手段
による入出力動作かを指定する第1の制御情報の記憶領
域を有するものであることを特徴とする請求項2に記載
のマイクロコンピュータ。
3. The control register means has a storage area for first control information for designating an input / output operation by the first control logic means or an input / output operation by the second control logic means. 3. The microcomputer according to claim 2, wherein:
【請求項4】 前記第1のデータレジスタ手段は、前記
第1の制御論理手段及び第2の制御論理手段によって夫
々動作が選択される複数個のデータレジスタを有するも
のであることを特徴とする請求項2に記載のマイクロコ
ンピュータ。
4. The first data register means has a plurality of data registers whose operations are selected by the first control logic means and the second control logic means, respectively. The microcomputer according to claim 2.
【請求項5】 前記第2の制御論理手段は、前記第2の
外部端子から供給される制御信号に含まれるレジスタ指
定情報に従って前記第1のレジスタ手段に含まれるデー
タレジスタを選択し、前記第2の外部端子から供給され
る制御信号に含まれるリード・ライト指定情報に従って
前記データレジスタに対するリード・ライト動作を選択
し、前記第2の外部端子から供給される制御信号に含ま
れるタイミング情報に同期して前記データレジスタにリ
ード・ライト動作をさせるものであることを特徴とする
請求項4に記載のマイクロコンピュータ。
5. The second control logic means selects a data register included in the first register means according to register designation information included in a control signal supplied from the second external terminal, and selects the data register. A read / write operation for the data register is selected in accordance with read / write designation information included in a control signal supplied from the second external terminal, and synchronized with timing information included in the control signal supplied from the second external terminal 5. The microcomputer according to claim 4, wherein said microcomputer performs a read / write operation on said data register.
【請求項6】 前記第2の制御論理手段は、前記レジス
タ指定情報に代えて、前記第1の外部端子の特定の状態
毎に前記データレジスタの選択を順次切換え可能にされ
て成るものであることを特徴とする請求項5に記載のマ
イクロコンピュータ。
6. The second control logic means is capable of sequentially switching the selection of the data register for each specific state of the first external terminal in place of the register designation information. The microcomputer according to claim 5, wherein:
【請求項7】 前記制御レジスタ手段は、レジスタ選択
を前記レジスタ指定情報に基づいて行うか、又は前記第
1の外部端子の特定の状態毎に切換えるかを前記第2の
制御論理手段に指示する第2の制御情報の記憶領域を有
するものであることを特徴とする請求項6に記載のマイ
クロコンピュータ。
7. The control register means instructs the second control logic means whether to select a register based on the register designation information or to switch over for each specific state of the first external terminal. 7. The microcomputer according to claim 6, comprising a storage area for second control information.
JP9230802A 1997-08-27 1997-08-27 Semiconductor integrated circuit and micro-computer Withdrawn JPH1166030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9230802A JPH1166030A (en) 1997-08-27 1997-08-27 Semiconductor integrated circuit and micro-computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9230802A JPH1166030A (en) 1997-08-27 1997-08-27 Semiconductor integrated circuit and micro-computer

Publications (1)

Publication Number Publication Date
JPH1166030A true JPH1166030A (en) 1999-03-09

Family

ID=16913510

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9230802A Withdrawn JPH1166030A (en) 1997-08-27 1997-08-27 Semiconductor integrated circuit and micro-computer

Country Status (1)

Country Link
JP (1) JPH1166030A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009104653A (en) * 2003-07-31 2009-05-14 Fujitsu Microelectronics Ltd Operation mode control circuit, and microcomputer

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009104653A (en) * 2003-07-31 2009-05-14 Fujitsu Microelectronics Ltd Operation mode control circuit, and microcomputer

Similar Documents

Publication Publication Date Title
US9754562B2 (en) Semiconductor device and data processing system selectively operating as one of a big endian or little endian system
CA2231362C (en) A data maximizing serial to parallel bus interface in a data processing system and method therefor
JPH0612863A (en) Dual port dram
US7162563B2 (en) Semiconductor integrated circuit having changeable bus width of external data signal
US5606715A (en) Flexible reset configuration of a data processing system and method therefor
US8239658B2 (en) Internally derived address generation system and method for burst loading of a synchronous memory
JP2001118387A (en) Synchronizing type semiconductor memory
JPH1166030A (en) Semiconductor integrated circuit and micro-computer
JP2002358232A (en) Memory access device
US20030145245A1 (en) Microcontroller
JP2000181899A (en) Microprocessor, method for controlling shared terminal and method for executing reset processing
JP3201439B2 (en) Direct memory access control circuit
KR100206898B1 (en) Multiset dram control unit
JPH1083384A (en) Microcomputer
JP2000132491A (en) Method and system for device control
JPH096750A (en) Terminal state control circuit and microcomputer
JPH0667769A (en) Single chip microcomputer
JPH0969070A (en) Control circuit of information processor
JP2000267774A (en) Microcontroller unit
JPH052525A (en) Memory control system
JPH04131948A (en) Memory controller
JPH11338817A (en) System controller
JP2000207379A (en) Cpu and microcomputer system
JPH10116247A (en) Microcomputer
JPH0844663A (en) Data communication system

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20041102