JPH05108527A - Input/output circuit for microcomputer - Google Patents

Input/output circuit for microcomputer

Info

Publication number
JPH05108527A
JPH05108527A JP27137391A JP27137391A JPH05108527A JP H05108527 A JPH05108527 A JP H05108527A JP 27137391 A JP27137391 A JP 27137391A JP 27137391 A JP27137391 A JP 27137391A JP H05108527 A JPH05108527 A JP H05108527A
Authority
JP
Japan
Prior art keywords
level
port
input
output
ports
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
JP27137391A
Other languages
Japanese (ja)
Inventor
Harumitsu Miyagawa
晴光 宮川
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 JP27137391A priority Critical patent/JPH05108527A/en
Publication of JPH05108527A publication Critical patent/JPH05108527A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the number of ports at a microcomputer for connecting an input/output equipment by switching a port for sharing inputting/outputting to be used as the input port and the output port to an input operation and an output operation while sharing time. CONSTITUTION:First and second select signal terminals S1 and S2 are connected to the bases of two transistors TR 1 and TR 2, and the collectors of these transistors are connected to a power supply terminal VDD of a microcomputer 1. Between the emitters of the two transistors TR 1 and TR 2 and four shared ports 101-104, eight LED LE1-LE 8 are respectively connected through resistors 3. Among the power supply terminal VDD of the microcomputer 1, the first and second select signal terminals S1 and S2 and the shared ports 101-104, resistors 4 are connected. Since four select signals S1, S2, T1 and T2 are switched to an H level and an L level while sharing time in this input/output circuit, the shared ports 101-104 are switched to the input operation and the output operation.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、たとえばスイッチな
どの複数の入力機器とLED(発光ダイオード)などの
複数の出力機器に接続されたマイコン(マイクロコンピ
ュータ)の入出力回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an input / output circuit of a microcomputer (microcomputer) connected to a plurality of input devices such as switches and a plurality of output devices such as LEDs (light emitting diodes).

【0002】[0002]

【従来の技術】図3は、従来のマイコンの入出力回路の
1例を示している。
2. Description of the Related Art FIG. 3 shows an example of a conventional microcomputer input / output circuit.

【0003】図3において、マイコン(1) は、入力機器
である8つのスイッチ(SW1) 〜(SW8) と出力機器である
8つのLED(LE1) 〜(LE8) に接続されている。マイコ
ン(1) には4つの入力ポート(I1)〜(I4)と4つの出力ポ
ート(O1)〜(O4)が設けられており、マイコン(1) の2つ
のセレクト信号端子(S1)(S2)からセレクト信号S1、S2が
それぞれ出力されるようになっている。
In FIG. 3, a microcomputer (1) is connected to eight switches (SW1) to (SW8) which are input devices and eight LEDs (LE1) to (LE8) which are output devices. The microcomputer (1) is provided with four input ports (I1) to (I4) and four output ports (O1) to (O4), and two select signal terminals (S1) (S2) of the microcomputer (1). ), Select signals S1 and S2 are output respectively.

【0004】4つの入力ポート(I1)〜(I4)と2つのセレ
クト信号端子(S1)(S2)の間に、8つのスイッチ(SW1) 〜
(SW8) がそれぞれダイオード(2) を介して接続されてい
る。2つのセレクト信号端子(S1)(S2)が2つのトランジ
スタ(TR1)(TR2)のベースにそれぞれ接続され、これらの
トランジスタ(TR1)(TR2)のコレクタがマイコン(1) の電
源端子(VDD) に接続されている。また、2つのトランジ
スタ(TR1)(TR2)のエミッタと4つの出力ポート(O1)〜(O
4)の間に、8つのLED(LE1) 〜(LE8) がそれぞれ抵抗
(3) を介して接続されている。また、マイコン(1) の電
源端子(VDD) とセレクト信号端子(S1)(S2)および入力ポ
ート(I1)〜(I4)との間に、抵抗(4) が接続されている。
Between the four input ports (I1)-(I4) and the two select signal terminals (S1) (S2), eight switches (SW1)-
Each (SW8) is connected via a diode (2). The two select signal terminals (S1) (S2) are connected to the bases of the two transistors (TR1) (TR2), and the collectors of these transistors (TR1) (TR2) are the power supply terminals (VDD) of the microcomputer (1). It is connected to the. Also, the emitters of the two transistors (TR1) (TR2) and the four output ports (O1) to (O
Between 4), 8 LEDs (LE1) to (LE8) have resistance.
Connected via (3). A resistor (4) is connected between the power supply terminal (VDD) of the microcomputer (1), the select signal terminals (S1) (S2), and the input ports (I1) to (I4).

【0005】2つのセレクト信号S1、S2は、一方がH
(High)レベル、他方がL(Low )レベルとなるように
切替えられる。4つの入力ポート(I1)〜(I4)は常にHレ
ベルの出力を出しており、2つの出力ポート(O1)〜(O4)
は、それぞれHレベルとLレベルに切替えられる。
One of the two select signals S1 and S2 is H.
(High) level and the other is switched to L (Low) level. The four input ports (I1) to (I4) always output H level, and the two output ports (O1) to (O4)
Are switched to H level and L level, respectively.

【0006】第1セレクト信号S1がLレベルの場合、第
1入力ポート(I1)で第1スイッチ(SW1) 、第2入力ポー
ト(I2)で第3スイッチ(SW3) 、第3入力ポート(I3)で第
5スイッチ(SW5) 、第4入力ポート(I4)で第7スイッチ
(SW7) の状態がそれぞれ読取られる。第1入力ポート(I
1)は常にHレベルの出力を出しているので、第1セレク
ト信号S1がHレベルのときは、第1スイッチ(SW1) が開
状態であっても閉状態であっても第1入力ポート(I1)は
Hレベルのままであり、したがって、第1スイッチ(SW
1) の状態を読取ることはできない。これに対し、第1
セレクト信号(S1)がLレベルのときは、第1スイッチ(S
W1) が開状態であれば第1入力ポート(I1)はHレベルの
ままであるが、第1スイッチ(SW1) が閉状態であれば第
1入力ポート(I1)はLレベルになり、したがって、第1
スイッチ(SW1) の状態を読取ることができる。第3、第
5および第7スイッチ(SW3)(SW5)(SW7) についても同様
である。
When the first select signal S1 is at L level, the first switch (SW1) is at the first input port (I1), the third switch (SW3) is at the second input port (I2), and the third input port (I3). ) Is the 5th switch (SW5) and the 4th input port (I4) is the 7th switch
The status of (SW7) is read. First input port (I
Since 1) always outputs H level, when the first select signal S1 is H level, the first input port (SW1) is open or closed. I1) remains at H level, and therefore the first switch (SW
The status of 1) cannot be read. In contrast, the first
When the select signal (S1) is at L level, the first switch (S
If W1) is in the open state, the first input port (I1) remains at the H level, but if the first switch (SW1) is in the closed state, the first input port (I1) is at the L level, so , First
The status of the switch (SW1) can be read. The same applies to the third, fifth and seventh switches (SW3) (SW5) (SW7).

【0007】同様に、第2セレクト信号(S2)がLレベル
の場合、第1入力ポート(I1)で第2スイッチ(SW2) 、第
2入力ポート(I2)で第4スイッチ(SW4) 、第3入力ポー
ト(I3)で第6スイッチ(SW6) 、第4入力ポート(I4)で第
8スイッチ(SW8) の状態がそれぞれ読取られる。
Similarly, when the second select signal (S2) is at L level, the second switch (SW2) is at the first input port (I1), the fourth switch (SW4) is at the second input port (I2), The state of the sixth switch (SW6) is read at the 3rd input port (I3), and the state of the 8th switch (SW8) is read at the 4th input port (I4).

【0008】第1トランジスタ(TR1) がオンの場合、第
1出力ポート(O1)がLレベルであれば第1LED(LE1)
が点灯する。第1トランジスタ(TR1) がオフの場合は、
第1LED(LE1) に通電せず、したがって、第1LED
(LE1) は消灯している。第1トランジスタ(TR1) がオン
になっても、第1出力ポート(O1)がHレベルであれば、
やはり第1LED(LE1) に通電せず、したがって、第1
LED(LE1) は消灯している。そして、第1トランジス
タ(TR1) がオンになって、第1出力ポート(O1)がLレベ
ルであれば、第1LED(LE1) に通電し、したがって、
第1LED(LE1) は点灯する。
When the first transistor (TR1) is on and the first output port (O1) is at L level, the first LED (LE1)
Lights up. If the first transistor (TR1) is off,
The first LED (LE1) is not energized and therefore the first LED
(LE1) is off. Even if the first transistor (TR1) is turned on, if the first output port (O1) is at H level,
Again, the first LED (LE1) is not energized, so
LED (LE1) is off. When the first transistor (TR1) is turned on and the first output port (O1) is at L level, the first LED (LE1) is energized, and therefore,
The first LED (LE1) lights up.

【0009】同様に、第1トランジスタ(TR1) がオンの
場合、第2出力ポート(O2)がLレベルであれば第2LE
D(LE2) が、第3出力ポート(O3)がLレベルであれば第
3LED(LE3) が、第4出力ポート(O4)がLレベルであ
れば第4LED(LE4) がそれぞれ点灯する。また、第2
トランジスタ(TR2) がオンの場合、第1出力ポート(O1)
がLレベルであれば第5LED(LE5) が、第2出力ポー
ト(O2)がLレベルであれば第6LED(LE6) が、第3出
力ポート(O3)がLレベルであれば第7LED(LE7) が、
第8出力ポート(O8)がLレベルであれば第8LED(LE
8) がそれぞれ点灯する。
Similarly, when the first transistor (TR1) is on, if the second output port (O2) is at L level, the second LE
If D (LE2) is the L level of the third output port (O3), the third LED (LE3) is lit, and if the fourth output port (O4) is the L level, the fourth LED (LE4) is lit. Also, the second
When the transistor (TR2) is on, the first output port (O1)
Is the L level, the fifth LED (LE5) is the sixth LED (LE6) when the second output port (O2) is the L level, and the seventh LED (LE7) is the third output port (O3) is the L level. ) But,
If the eighth output port (O8) is at L level, the eighth LED (LE
8) lights up respectively.

【0010】次に、この入出力回路の動作の1例を図4
のタイミングチャートを参照して説明する。
Next, an example of the operation of this input / output circuit is shown in FIG.
The timing chart will be described.

【0011】時間t1からt5の間は、第1セレクト信号S1
がHレベル、第2セレクト信号S2がLレベルになってい
るため、第1入力ポート(I1)で第2スイッチ(SW2) 、第
2入力ポート(I2)で第4スイッチ(SW4) 、第3入力ポー
ト(I3)で第6スイッチ(SW6)、第4入力ポート(I4)で第
8スイッチ(SW8) の読取りがそれぞれ行なわれる。ま
た、この間、第1トランジスタ(TR1)がオン、第2トラ
ンジスタ(TR2) がオフになっている。このうち、時間t1
からt2の間は、第1出力ポート(O1)がLレベル、第2〜
第4出力ポート(O2)〜(O4)がHレベルになっているた
め、第1LED(LE1) だけが点灯する。時間t2からt3の
間は、第2出力ポート(O2)がLレベル、第1、第3およ
び第4出力ポート(O1)(O3)(O4)がHレベルになっている
ため、第2LED(LE2) だけが点灯する。時間t3からt4
の間は、第3出力ポート(O3)がLレベル、第1、第2お
よび第4出力ポート(O1)(O2)(O4)がHレベルになってい
るため、第3LED(LE3) だけが点灯する。時間t4から
t5の間は、第4出力ポート(O4)がLレベル、第1〜第3
出力ポート(O1)(O2)(O3)がHレベルになっているため、
第4LED(LE4) だけが点灯する。
During the period from time t1 to t5, the first select signal S1
Is at H level and the second select signal S2 is at L level, the second switch (SW2) is at the first input port (I1), the fourth switch (SW4) is at the second input port (I2), and the third switch is at the third level. The sixth switch (SW6) is read at the input port (I3), and the eighth switch (SW8) is read at the fourth input port (I4). Further, during this period, the first transistor (TR1) is on and the second transistor (TR2) is off. Of these, time t1
From 1 to t2, the first output port (O1) is at L level,
Since the fourth output ports (O2) to (O4) are at the H level, only the first LED (LE1) lights up. From time t2 to t3, the second output port (O2) is at L level and the first, third and fourth output ports (O1) (O3) (O4) are at H level, so the second LED ( Only LE2) lights up. Time t3 to t4
During this period, the third output port (O3) is at the L level, and the first, second and fourth output ports (O1) (O2) (O4) are at the H level, so only the third LED (LE3) is Light. From time t4
During t5, the fourth output port (O4) is at L level, and the first to third
Since the output ports (O1) (O2) (O3) are at H level,
Only the 4th LED (LE4) lights up.

【0012】時間t5からt9の間は、第1セレクト信号S1
がLレベル、第2セレクト信号S2がHレベルになってい
るため、第1入力ポート(I1)で第1スイッチ(SW1) 、第
2入力ポート(I2)で第3スイッチ(SW3) 、第3入力ポー
ト(I3)で第5スイッチ(SW5)、第4入力ポート(I4)で第
7スイッチ(SW7) の読取りがそれぞれ行なわれる。ま
た、この間、第1トランジスタ(TR1)がオフ、第2トラ
ンジスタ(TR2) がオンになっている。このうち、時間t5
からt6の間は、第1出力ポート(O1)がLレベル、第2〜
第4出力ポート(O2)〜(O4)がHレベルになっているた
め、第5LED(LE5) だけが点灯する。時間t6からt7の
間は、第2出力ポート(O2)がLレベル、第1、第3およ
び第4出力ポート(O1)(O3)(O4)がHレベルになっている
ため、第6LED(LE6) だけが点灯する。時間t7からt8
の間は、第3出力ポート(O3)がLレベル、第1、第2お
よび第4出力ポート(O1)(O2)(O4)がHレベルになってい
るため、第7LED(LE7) だけが点灯する。時間t8から
t9の間は、第4出力ポート(O4)がLレベル、第1〜第3
出力ポート(O1)(O2)(O3)がHレベルになっているため、
第8LED(LE8) だけが点灯する。
During the period from time t5 to t9, the first select signal S1
Is at the L level and the second select signal S2 is at the H level, the first switch (SW1) is at the first input port (I1), the third switch (SW3) is at the second input port (I2), and the third switch is at the third level. Reading of the fifth switch (SW5) is performed at the input port (I3), and reading of the seventh switch (SW7) is performed at the fourth input port (I4). Further, during this period, the first transistor (TR1) is off and the second transistor (TR2) is on. Of these, time t5
From 1 to t6, the first output port (O1) is at L level,
Since the fourth output ports (O2) to (O4) are at the H level, only the fifth LED (LE5) lights up. From time t6 to t7, the second output port (O2) is at L level and the first, third and fourth output ports (O1) (O3) (O4) are at H level, so the sixth LED ( Only LE6) lights up. Time t7 to t8
During this period, the third output port (O3) is at L level, and the first, second and fourth output ports (O1) (O2) (O4) are at H level, so only the seventh LED (LE7) is Light. From time t8
During t9, the fourth output port (O4) is at L level, and the first to third
Since the output ports (O1) (O2) (O3) are at H level,
Only the 8th LED (LE8) lights up.

【0013】[0013]

【発明が解決しようとする課題】上記の従来のマイコン
の入出力回路では、最大、セレクト信号の数と入力ポー
トの数との積の数の入力機器と、セレクト信号の数と出
力ポートの数との積の数の出力機器が使用可能である
が、入力ポートと出力ポートがそれぞれ別に必要であ
り、入力機器および出力機器の数の増大によってマイコ
ンのポート数が不足することがある。
In the above-mentioned conventional input / output circuit of the microcomputer, the maximum number of input devices is the product of the number of select signals and the number of input ports, and the number of select signals and the number of output ports. Although the number of output devices equal to the product of and can be used, an input port and an output port are required separately, and the number of ports of the microcomputer may become insufficient due to the increase in the number of input devices and output devices.

【0014】この発明の目的は、上記の問題を解決し、
マイコンのポートの数が少なくてすむマイコンの入出力
回路を提供することにある。
The object of the present invention is to solve the above problems,
It is to provide a microcomputer input / output circuit that requires a small number of microcomputer ports.

【0015】[0015]

【課題を解決するための手段】この発明によるマイコン
の入出力回路は、複数の入力機器および出力機器に接続
されたマイコンの入出力回路であって、入力ポートと出
力ポートを兼用する入出力兼用ポートが設けられ、この
入出力兼用ポートが時分割で入力動作と出力動作に切替
えられるようになされていることを特徴とするものであ
る。
An input / output circuit of a microcomputer according to the present invention is an input / output circuit of a microcomputer connected to a plurality of input devices and output devices, and has a dual input / output function. A port is provided, and this input / output port can be switched to an input operation and an output operation in a time division manner.

【0016】[0016]

【作用】入出力兼用ポートが時分割で入力動作と出力動
作に切替えられるので、1つの入出力兼用ポートで入力
動作と出力動作を行なうことができる。
Since the I / O port is switched to the input operation and the output operation in a time division manner, the input operation and the output operation can be performed by one I / O port.

【0017】[0017]

【実施例】以下、図1および図2を参照して、この発明
の実施例について説明する。
Embodiments of the present invention will be described below with reference to FIGS.

【0018】図1はマイコン(1) の入出力回路の1例を
示し、図3の従来例と同じ部分には同一の符号を付して
いる。
FIG. 1 shows an example of the input / output circuit of the microcomputer (1), and the same parts as those in the conventional example of FIG. 3 are designated by the same reference numerals.

【0019】図1において、マイコン(1) は、図3の場
合と同様、8つのスイッチ(SW1) 〜(SW8) と8つのLE
D(LE1) 〜(LE8) に接続されている。また、マイコン
(1) には4つの入出力兼用ポート(IO1) 〜(IO4) が設け
られており、4つのセレクト信号端子(S1)(S2)(T1)(T2)
からセレクト信号S1、S2、T1、T2がそれぞれ出力される
ようになっている。
In FIG. 1, the microcomputer (1) has eight switches (SW1) to (SW8) and eight LEs as in the case of FIG.
It is connected to D (LE1) to (LE8). Also, the microcomputer
(1) has four I / O ports (IO1) to (IO4) and four select signal terminals (S1) (S2) (T1) (T2)
The select signals S1, S2, T1 and T2 are respectively output from the.

【0020】4つの兼用ポート(IO1) 〜(IO4) と第3お
よび第4セレクト信号端子(T1)(T2)の間に、8つのスイ
ッチ(SW1) 〜(SW8) がそれぞれダイオード(2) を介して
接続されている。第1および第2セレクト信号端子(S1)
(S2)が2つのトランジスタ(TR1)(TR2)のベースにそれぞ
れ接続され、これらのトランジスタ(TR1)(TR2)のコレク
タがマイコン(1) の電源端子(VDD) に接続されている。
また、2つのトランジスタ(TR1)(TR2)のエミッタと4つ
の兼用ポート(IO1) 〜(IO4) の間に、8つのLED(LE
1) 〜(LE8) がそれぞれ抵抗(3) を介して接続されてい
る。また、マイコン(1) の電源端子(VDD) と第1および
第2セレクト信号端子(S1)(S2)ならびに兼用ポート(IO
1) 〜(IO4) との間に、抵抗(4)が接続されている。
Eight switches (SW1) to (SW8) respectively connect the diode (2) between the four dual-purpose ports (IO1) to (IO4) and the third and fourth select signal terminals (T1) and (T2). Connected through. First and second select signal terminals (S1)
(S2) is connected to the bases of the two transistors (TR1) (TR2), and the collectors of these transistors (TR1) (TR2) are connected to the power supply terminal (VDD) of the microcomputer (1).
Also, between the emitters of the two transistors (TR1) (TR2) and the four dual-purpose ports (IO1) to (IO4), 8 LEDs (LE
1) to (LE8) are connected via a resistor (3). In addition, the power supply terminal (VDD) of the microcomputer (1), the first and second select signal terminals (S1) (S2), and the dual-purpose port (IO
A resistor (4) is connected between 1) and (IO4).

【0021】この入出力回路では、4つのセレクト信号
S1、S2、T1、T2を次のように時分割でHレベルとLレベ
ルに切替えることにより、4つの兼用ポート(IO1) 〜(I
O4)が入力動作と出力動作に切替えられる。
In this input / output circuit, four select signals
By switching S1, S2, T1, and T2 between H level and L level in a time division manner as follows, four dual-purpose ports (IO1) to (I
O4) is switched between input operation and output operation.

【0022】入力動作を行なう場合、第1および第2セ
レクト信号S1、S2がともにLレベルに切替えられる。ま
た、第3および第4セレクト信号T1、T2の一方がHレベ
ルに、他方がLレベルに切替えられる。そして、このよ
うな状態で必要な兼用ポート(IO1) 〜(IO4) がHレベル
に切替えられ、Hレベルになっている兼用ポート(IO1)
〜(IO4) において、その兼用ポート(IO1) 〜(IO4) とL
レベルになっているセレクト信号T1、T2に対応するスイ
ッチ(SW1) 〜(SW8) の状態が読取られる。第1および第
2セレクト信号S1、S2がともにLレベルに切替えられて
いる場合、2つのトランジスタ(TR1)(TR2)はともにオフ
になっており、したがって、兼用ポート(IO1) 〜(IO4)
をHレベルとLレベルのいずれに切替えてもいずれのL
ED(LE1) 〜(LE8) も点灯しない。すなわち、この場合
は、出力動作を行なうことはできない。このような状態
で、第3セレクト信号T3がLレベル、第4セレクト信号
T4がHレベルに切替えられ、さらに第1兼用ポート(IO
1) がHレベルに切替えられていれば、このポート(IO1)
で第1スイッチ(SW1) の状態が読取られる。第4セレ
クト信号T4がHレベルであれば、第2スイッチ(SW2) が
開状態であっても閉状態であっても第1兼用ポート(IO
1) の状態は変わらず、したがって、第2スイッチ(SW2)
の状態を読取ることはできない。第3セレクト信号T3
がLレベルであれば、第1スイッチ(SW1) が開状態であ
ると第1兼用ポート(IO1) はHレベルのままであるが、
第1スイッチ(SW1) が閉状態であれば第1兼用ポート(I
O1) はLレベルになり、したがって、第1スイッチ(SW
1) の状態を読取ることができる。同様に、第3セレク
ト信号T3がLレベル、第4セレクト信号T4がHレベルに
切替えられている状態で、第2兼用ポート(IO2) がHレ
ベルに切替えられていればこのポート(IO2) で第3スイ
ッチ(SW3) の状態が、第3兼用ポート(IO3) がHレベル
に切替えられていればこのポート(IO3) で第5スイッチ
(SW5) の状態が、第4兼用ポート(IO4) がHレベルに切
替えられていればこのポート(IO4) で第7スイッチ(SW
7) の状態がそれぞれ読取られる。また、第3セレクト
信号T3がHレベル、第4セレクト信号T4がLレベルに切
替えられている場合、第1兼用ポート(IO2)がHレベル
に切替えられていればこのポート(IO1) で第2スイッチ
(SW2) の状態が、第2兼用ポート(IO2) がHレベルに切
替えられていればこのポート(IO2) で第4スイッチ(SW
4) の状態が、第3兼用ポート(IO3) がHレベルに切替
えられていればこのポート(IO3) で第6スイッチ(SW6)
の状態が、第4兼用ポート(IO4)がHレベルに切替えら
れていればこのポート(IO4) で第8スイッチ(SW8) の状
態がそれぞれ読取られる。
When performing the input operation, both the first and second select signals S1 and S2 are switched to the L level. Further, one of the third and fourth select signals T1 and T2 is switched to the H level and the other is switched to the L level. In this state, the required dual-purpose ports (IO1) to (IO4) are switched to the H level, and the dual-purpose ports (IO1) that are at the H level
~ (IO4) and its dual-purpose ports (IO1) to (IO4) and L
The states of the switches (SW1) to (SW8) corresponding to the select signals T1 and T2 that are at the level are read. When both the first and second select signals S1 and S2 are switched to the L level, the two transistors (TR1) and (TR2) are both off, and therefore the dual-purpose ports (IO1) to (IO4)
Is set to H level or L level, whichever L
ED (LE1) to (LE8) also do not light. That is, in this case, the output operation cannot be performed. In such a state, the third select signal T3 is at L level and the fourth select signal is
T4 is switched to H level, and the first dual-purpose port (IO
If 1) is switched to H level, this port (IO1)
The state of the first switch (SW1) is read with. If the fourth select signal T4 is at the H level, the first dual-purpose port (IO) can be set whether the second switch (SW2) is open or closed.
The state of 1) does not change, so the second switch (SW2)
Can not read the state of. Third select signal T3
Is at the L level, the first combined port (IO1) remains at the H level when the first switch (SW1) is in the open state.
If the first switch (SW1) is closed, the first combined port (I
O1) becomes L level, and therefore the first switch (SW
The status of 1) can be read. Similarly, while the third select signal T3 is switched to L level and the fourth select signal T4 is switched to H level, if the second combined port (IO2) is switched to H level, this port (IO2) If the state of the third switch (SW3) is such that the third combined port (IO3) has been switched to the H level, this port (IO3) causes the fifth switch
If the status of (SW5) is such that the fourth combined port (IO4) has been switched to the H level, the seventh switch (SW4)
The state of 7) is read respectively. Further, when the third select signal T3 is switched to the H level and the fourth select signal T4 is switched to the L level, if the first combined port (IO2) is switched to the H level, the second port at this port (IO1) switch
If the status of (SW2) is such that the second combined port (IO2) is switched to H level, this port (IO2) will cause the fourth switch (SW2)
In the state of 4), if the third combined port (IO3) is switched to the H level, the sixth switch (SW6) will be used at this port (IO3).
If the fourth combined port (IO4) is switched to the H level, the state of the eighth switch (SW8) is read by this port (IO4).

【0023】出力動作を行なう場合、第3および第4セ
レクト信号がともにHレベルに切替えられる。また、第
1および第2セレクト信号S1、S2の少なくともいずれか
一方がLレベルに切替えられる。そして、このような状
態で、兼用ポート(IO1) 〜(IO4) をHレベルあるいはL
レベルに切替えることにより、その兼用ポート(IO1)〜
(IO4) とLレベルになっているセレクト信号S1、S2に対
応するLED(LE1) 〜(LE8) が消灯あるいは点灯に切替
えられる。第3および第4セレクト信号T3、T4がともに
Hレベルに切替えられている場合、スイッチ(SW1) 〜(S
W8) が開状態であっても閉状態であっても兼用ポート(I
O1) 〜(IO4) の状態は変わらず、したがって、スイッチ
(SW1) 〜(SW8) の状態を読取ることはできない。すなわ
ち、この場合は、入力動作を行なうことはできない。こ
のような状態で、第1セレクト信号S1がHレベルに切替
えられている場合、第1兼用ポート(IO1) がHレベルで
あれば第1LED(LE1) は消灯、第1兼用ポート(IO1)
がLレベルであれば第1LED(LE1) は点灯し、第2兼
用ポート(IO2) がHレベルであれば第2LED(LE2) は
消灯、第2兼用ポート(IO2) がLレベルであれば第2L
ED(LE2) は点灯し、第3兼用ポート(IO3) がHレベル
であれば第3LED(LE3) は消灯、第3兼用ポート(IO
3) がLレベルであれば第3LED(LE3) は点灯し、第
4兼用ポート(IO4) がHレベルであれば第4LED(LE
4) は消灯、第4兼用ポート(IO4) がLレベルであれば
第4LED(LE4) は点灯する。同様に、第2セレクト信
号S2がHレベルに切替えられている場合、第1兼用ポー
ト(IO1) がHレベルであれば第5LED(LE5) は消灯、
第1兼用ポート(IO1) がLレベルであれば第5LED(L
E5)は点灯し、第2兼用ポート(IO2) がHレベルであれ
ば第6LED(LE6) は消灯、第2兼用ポート(IO2)がL
レベルであれば第6LED(LE6) は点灯し、第3兼用ポ
ート(IO3) がHレベルであれば第7LED(LE7) は消
灯、第3兼用ポート(IO3) がLレベルであれば第7LE
D(LE7) は点灯し、第4兼用ポート(IO4) がHレベルで
あれば第8LED(LE8) は消灯、第4兼用ポート(IO4)
がLレベルであれば第8LED(LE8) は点灯する。
When performing the output operation, both the third and fourth select signals are switched to the H level. Further, at least one of the first and second select signals S1 and S2 is switched to the L level. Then, in such a state, the dual-purpose ports (IO1) to (IO4) are set to H level or L level.
By switching to the level, the dual-purpose port (IO1) ~
The LEDs (LE1) to (LE8) corresponding to (IO4) and the select signals S1 and S2 that are at the L level are switched off or on. When the third and fourth select signals T3 and T4 are both switched to the H level, the switches (SW1) to (S
Whether the W8) is open or closed, the dual-purpose port (I
The states of (O1) to (IO4) do not change, and
The status of (SW1) to (SW8) cannot be read. That is, in this case, the input operation cannot be performed. In this state, when the first select signal S1 is switched to H level, if the first combined port (IO1) is at H level, the first LED (LE1) is turned off and the first combined port (IO1)
If the L-level is, the first LED (LE1) is lit, if the second I / O port (IO2) is H-level, the second LED (LE2) is off, and if the second I / O port (IO2) is L-level, 2L
ED (LE2) lights up, if the third combined port (IO3) is at H level, the third LED (LE3) goes off, and the third combined port (IO
If 3) is at L level, the third LED (LE3) is lit, and if 4th combined port (IO4) is at H level, the fourth LED (LE3) is
4) goes off, and if the fourth combined port (IO4) is at L level, the fourth LED (LE4) goes on. Similarly, when the second select signal S2 is switched to H level, the fifth LED (LE5) is turned off if the first combined port (IO1) is at H level.
If the first combined port (IO1) is at L level, the fifth LED (L
E5) lights up, and if the second combined port (IO2) is at H level, the sixth LED (LE6) goes off, and the second combined port (IO2) goes to L.
If the level is 6th LED (LE6) is on, if the third combined port (IO3) is H level, then the 7th LED (LE7) is off, if the 3rd combined port (IO3) is L level, it is the 7th LE.
D (LE7) lights up, if the fourth combined port (IO4) is at H level, the eighth LED (LE8) goes off, fourth combined port (IO4)
If is the L level, the eighth LED (LE8) is turned on.

【0024】次に、この入出力回路の動作の1例を図2
のタイミングチャートを参照して説明する。
Next, an example of the operation of this input / output circuit is shown in FIG.
The timing chart will be described.

【0025】時間t11 からt12 の間、時間t13 からt14
の間、時間t15 からt16 の間、時間t17 からt18 の間の
間は、第1および第2セレクト信号S1、S2がともにLレ
ベル、第3セレクト信号T3がLレベル、第4セレクト信
号T4がHレベル、4つの兼用ポート(IO1) 〜(IO4) がと
もにHレベルになっているため、第1兼用ポート(IO1)
で第1スイッチ(SW1) 、第2兼用ポート(IO2) で第3ス
イッチ(SW3) 、第3兼用ポート(IO3) で第5スイッチ(S
W5) 、第4兼用ポート(IO4) で第7スイッチ(SW7) の状
態の読取りがそれぞれ行なわれる。
Between times t11 and t12, times t13 and t14
During the period between time t15 and t16 and during the period between time t17 and t18, both the first and second select signals S1 and S2 are L level, the third select signal T3 is L level, and the fourth select signal T4 is H level, 4 dual-purpose ports (IO1) to (IO4) are both high level, so the first dual-purpose port (IO1)
Is the first switch (SW1), the second combined port (IO2) is the third switch (SW3), and the third combined port (IO3) is the fifth switch (S
The state of the seventh switch (SW7) is read at W5) and the fourth combined port (IO4).

【0026】時間t12 からt13 の間、時間t14 からt15
の間、時間t16 からt17 の間、時間t18 からt19 の間
は、第3および第4セレクト信号T1、T2がともにHレベ
ル、第1セレクト信号S1がHレベル、第2セレクト信号
S2がLレベルになっているため、第1〜第4LED(LE
1) 〜(LE4) に対する出力動作が行なわれる。このう
ち、時間t12 から時間t13 の間は、第1兼用ポート(IO
1) がLレベル、第2〜第4兼用ポート(IO2) 〜(IO4)
がHレベルになっているため、第1LED(LE1) だけが
点灯する。時間t14 からt15 の間は、第2兼用ポート(I
O2) がLレベル、第1、第3および第4兼用ポート(IO
1)(IO3)(IO4) がHレベルになっているため、第2LE
D(LE2) だけが点灯する。時間t16 からt17 の間は、第
3兼用ポート(IO3)がLレベル、第1、第2および第4
兼用ポート(IO1)(IO2)(IO4) がHレベルになっているた
め、第3LED(LE3) だけが点灯する。時間t18 から時
間t19 の間は、第4兼用ポート(IO4) がLレベル、第1
〜第3兼用ポート(IO1) 〜(IO3) がHレベルになってい
るため、第4LED(LE4) だけが点灯する。
Between times t12 and t13, times t14 and t15
During time t16 to t17 and during time t18 to t19, both the third and fourth select signals T1 and T2 are at H level, the first select signal S1 is at H level, and the second select signal is
Since S2 is at L level, the first to fourth LEDs (LE
1) Output operation for (LE4) is performed. Of these, from time t12 to time t13, the first dual-purpose port (IO
1) is L level, second to fourth combined ports (IO2) to (IO4)
Since it is at H level, only the first LED (LE1) lights up. From time t14 to t15, the second combined port (I
O2) is L level, and the 1st, 3rd and 4th combined ports (IO
1) (IO3) (IO4) is H level, so 2nd LE
Only D (LE2) lights up. From time t16 to t17, the third combined port (IO3) is at L level, and the first, second and fourth ports are
Since the dual-purpose ports (IO1) (IO2) (IO4) are at H level, only the third LED (LE3) lights up. From time t18 to time t19, the fourth combined port (IO4) is at L level, first
~ Since the third combined ports (IO1) to (IO3) are at the H level, only the fourth LED (LE4) lights up.

【0027】時間t19 からt20 の間、時間t21 からt22
の間、時間t23 からt24 の間、時間t25 からt26 の間の
間は、第1および第2セレクト信号S1、S2がともにLレ
ベル、第3セレクト信号T3がHレベル、第4セレクト信
号T4がLレベル、4つの兼用ポート(IO1) 〜(IO4) がと
もにHレベルになっているため、第1兼用ポート(IO1)
で第2スイッチ(SW2) 、第2兼用ポート(IO2) で第4ス
イッチ(SW4) 、第3兼用ポート(IO3) で第6スイッチ(S
W6) 、第4兼用ポート(IO4) で第8スイッチ(SW8) の状
態の読取りがそれぞれ行なわれる。
From time t19 to t20, time t21 to t22
During the period from time t23 to t24 and from time t25 to t26, the first and second select signals S1 and S2 are both at L level, the third select signal T3 is at H level, and the fourth select signal T4 is at Since the L level and the four dual-purpose ports (IO1) to (IO4) are all high, the first dual-purpose port (IO1)
Is the second switch (SW2), the second combined port (IO2) is the fourth switch (SW4), and the third combined port (IO3) is the sixth switch (S
W6) and the fourth combined port (IO4) read the status of the eighth switch (SW8).

【0028】時間t20 からt21 の間、時間t22 からt23
の間、時間t24 からt25 の間、時間t26 からt27 の間
は、第3および第4セレクト信号T1、T2がともにHレベ
ル、第1セレクト信号S1がLレベル、第2セレクト信号
S2がHレベルになっているため、第5〜第8LED(LE
5) 〜(LE8) に対する出力動作が行なわれる。このう
ち、時間t20 から時間t21 の間は、第1兼用ポート(IO
1) がLレベル、第2〜第4兼用ポート(IO2) 〜(IO4)
がHレベルになっているため、第5LED(LE5) だけが
点灯する。時間t22 からt23 の間は、第2兼用ポート(I
O2) がLレベル、第1、第3および第4兼用ポート(IO
1)(IO3)(IO4) がHレベルになっているため、第6LE
D(LE2) だけが点灯する。時間t24 からt25 の間は、第
3兼用ポート(IO3)がLレベル、第1、第2および第4
兼用ポート(IO1)(IO2)(IO4) がHレベルになっているた
め、第7LED(LE7) だけが点灯する。時間t26 から時
間t27 の間は、第4兼用ポート(IO4) がLレベル、第1
〜第3兼用ポート(IO1) 〜(IO3) がHレベルになってい
るため、第8LED(LE8) だけが点灯する。
Between times t20 and t21, times t22 and t23
During time t24 to t25 and during time t26 to t27, the third and fourth select signals T1 and T2 are both at H level, the first select signal S1 is at L level, and the second select signal is
Since S2 is at H level, the 5th-8th LED (LE
5) Output operation for (LE8) is performed. Of these, from time t20 to time t21, the first dual-purpose port (IO
1) is L level, second to fourth combined ports (IO2) to (IO4)
Since it is at H level, only the fifth LED (LE5) lights up. From time t22 to t23, the second port (I
O2) is L level, and the 1st, 3rd and 4th combined ports (IO
1) (IO3) (IO4) is at H level, so 6th LE
Only D (LE2) lights up. From time t24 to t25, the third combined port (IO3) is at L level, and the first, second and fourth ports are
Since the dual-purpose ports (IO1) (IO2) (IO4) are at H level, only the 7th LED (LE7) is lit. From time t26 to time t27, the fourth combined-use port (IO4) is at L level, first
~ Since the third combined ports (IO1) to (IO3) are at H level, only the eighth LED (LE8) lights up.

【0029】この図1の入出力回路の場合、兼用ポート
(IO1) 〜(IO4) が時分割で入力動作と出力動作に切替え
られるので、入力機器と出力機器の数が同じであれば、
兼用ポート(IO1) 〜(IO4) の数は図3の従来例の入力ポ
ート(I1)〜(I4)と出力ポート(O1)〜(O4)を合わせた数の
半分ですむ。そして、入力動作と出力動作を切替えるた
めに第3および第4セレクト信号端子(T1)(T2)の2つの
ポートを付加するだけでよいから、全体のポート数が少
なくてすむ。また、この差は、接続される入力機器およ
び出力機器の数が増大するほど大きくなる。
In the case of the input / output circuit of FIG. 1, a dual-purpose port
Since (IO1) to (IO4) can be switched to input operation and output operation in time division, if the number of input devices and output devices is the same,
The number of dual-purpose ports (IO1) to (IO4) is half of the total number of input ports (I1) to (I4) and output ports (O1) to (O4) of the conventional example in FIG. Since only two ports of the third and fourth select signal terminals (T1) and (T2) need to be added to switch the input operation and the output operation, the total number of ports can be reduced. Further, this difference becomes larger as the number of connected input devices and output devices increases.

【0030】[0030]

【発明の効果】この発明のマイコンの入出力回路によれ
ば、上述のように、1つの入出力兼用ポートで入力動作
と出力動作の両方を行なうことができ、必要なポート数
が少なくてすむ。このため、より少ない数のポートに多
数の入出力機器を接続することができ、より良いマンマ
シンインタフェースを実現することができる。
According to the input / output circuit of the microcomputer of the present invention, as described above, one input / output port can perform both input operation and output operation, and the number of required ports can be reduced. .. Therefore, a large number of input / output devices can be connected to a smaller number of ports, and a better man-machine interface can be realized.

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

【図1】この発明の実施例を示すマイコンの入出力回路
の電気回路図である。
FIG. 1 is an electric circuit diagram of an input / output circuit of a microcomputer showing an embodiment of the present invention.

【図2】図1の回路の動作の1例を示すタイミングチャ
ートである。
2 is a timing chart showing an example of the operation of the circuit of FIG.

【図3】従来例を示すマイコンの入出力回路の電気回路
図である。
FIG. 3 is an electric circuit diagram of an input / output circuit of a microcomputer showing a conventional example.

【図4】図3の回路の動作の1例を示すタイミングチャ
ートである。
4 is a timing chart showing an example of the operation of the circuit of FIG.

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

(1) マイ
コン (SW1)(SW2)(SW3)(SW4)(SW5)(SW6)(SW7)(SW8) スイ
ッチ(入力機器) (LE1)(LE2)(LE3)(LE4)(LE5)(LE6)(LE7)(LE8) LE
D(出力機器) (IO1)(IO2)(IO3)(IO4) 入出
力兼用ポート
(1) Microcomputer (SW1) (SW2) (SW3) (SW4) (SW5) (SW6) (SW7) (SW8) Switch (Input device) (LE1) (LE2) (LE3) (LE4) (LE5) (LE6 ) (LE7) (LE8) LE
D (output device) (IO1) (IO2) (IO3) (IO4) I / O port

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】複数の入力機器および出力機器に接続され
たマイコンの入出力回路であって、入力ポートと出力ポ
ートを兼用する入出力兼用ポートが設けられ、この入出
力兼用ポートが時分割で入力動作と出力動作に切替えら
れるようになされていることを特徴とするマイコンの入
出力回路。
1. An input / output circuit of a microcomputer connected to a plurality of input devices and output devices, wherein an input / output port that also serves as an input port and an output port is provided, and the input / output port is time-shared. An input / output circuit of a microcomputer, which is designed to be switched between input operation and output operation.
JP27137391A 1991-10-18 1991-10-18 Input/output circuit for microcomputer Pending JPH05108527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27137391A JPH05108527A (en) 1991-10-18 1991-10-18 Input/output circuit for microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27137391A JPH05108527A (en) 1991-10-18 1991-10-18 Input/output circuit for microcomputer

Publications (1)

Publication Number Publication Date
JPH05108527A true JPH05108527A (en) 1993-04-30

Family

ID=17499169

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27137391A Pending JPH05108527A (en) 1991-10-18 1991-10-18 Input/output circuit for microcomputer

Country Status (1)

Country Link
JP (1) JPH05108527A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7398367B2 (en) 2001-03-02 2008-07-08 Hitachi, Ltd. Storage subsystem that connects fibre channel and supports online backup

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61114361A (en) * 1984-11-07 1986-06-02 Olympus Optical Co Ltd Input and output controller for microcomputer
JPS62287323A (en) * 1986-06-06 1987-12-14 Matsushita Electric Ind Co Ltd Microcomputer

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61114361A (en) * 1984-11-07 1986-06-02 Olympus Optical Co Ltd Input and output controller for microcomputer
JPS62287323A (en) * 1986-06-06 1987-12-14 Matsushita Electric Ind Co Ltd Microcomputer

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7398367B2 (en) 2001-03-02 2008-07-08 Hitachi, Ltd. Storage subsystem that connects fibre channel and supports online backup
US7904646B2 (en) 2001-03-02 2011-03-08 Hitachi, Ltd. Storage subsystem that connects fibre channel and supports online backup
US8234449B2 (en) 2001-03-02 2012-07-31 Hitachi, Ltd. Storage subsystem that connects fibre channel and supports online backup
US8806119B2 (en) 2001-03-02 2014-08-12 Hitachi, Ltd. Storage subsystem that connects fibre channel and supports online backup

Similar Documents

Publication Publication Date Title
US6639397B2 (en) Automatic test equipment for testing a device under test
US4692901A (en) Semiconductor memory
US4369503A (en) Decoder circuit
JPS6245729B2 (en)
US4385370A (en) Decoder circuit
US4918450A (en) Analog/digital converter circuit
JPH05108527A (en) Input/output circuit for microcomputer
KR19980028828A (en) Driving device of liquid crystal display device
US4897820A (en) Bi-CMOS type of semiconductor memory device
US7262727B1 (en) Digital-to-analog data converter and method for conversion thereof
US4733218A (en) Combined digital-to-analog converter and latch memory circuit
US5854772A (en) Decoder circuit with less transistor elements
US3970865A (en) Pseudo-complementary decode driver
US6269028B1 (en) Method and apparatus for multistage readout operation
US5754129A (en) Data conversion circuit
US5430336A (en) Emitter coupled logic circuit
KR100502402B1 (en) Successive approximation approximation type analog to digital convering circuit
JPS59131227A (en) Logical signal converting circuit
JPH057159A (en) Digital-analog converter
JPH0567955A (en) Input circuit
JP2545502B2 (en) Storage device
JPS63246927A (en) Reference voltage generating circuit
JP3578077B2 (en) Barrel shift circuit
JP2751387B2 (en) Input circuit of ECL circuit
JPS6330719B2 (en)

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19980113