JP2619167B2 - I / O control circuit - Google Patents

I / O control circuit

Info

Publication number
JP2619167B2
JP2619167B2 JP30467791A JP30467791A JP2619167B2 JP 2619167 B2 JP2619167 B2 JP 2619167B2 JP 30467791 A JP30467791 A JP 30467791A JP 30467791 A JP30467791 A JP 30467791A JP 2619167 B2 JP2619167 B2 JP 2619167B2
Authority
JP
Japan
Prior art keywords
bit
serial
output
input
clock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP30467791A
Other languages
Japanese (ja)
Other versions
JPH05143509A (en
Inventor
尚 原田
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP30467791A priority Critical patent/JP2619167B2/en
Publication of JPH05143509A publication Critical patent/JPH05143509A/en
Application granted granted Critical
Publication of JP2619167B2 publication Critical patent/JP2619167B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Information Transfer Systems (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、その端子を入出力ポー
トと共用する入出力回路の入出力状態を制御レジスタの
各ビット値で選択する入出力制御回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an input / output control circuit for selecting an input / output state of an input / output circuit whose terminal is shared with an input / output port by using each bit value of a control register.

【0002】[0002]

【従来の技術】図1は8ビットのクロック同期型シリア
ルI/O を2本内蔵した従来のシリアルI/O 制御回路の構
成を示すブロック図である。図中1は通常の転送機能と
自動転送機能とを内蔵し、2つを切り替えて使用するシ
リアルI/O 、2は通常の転送機能のみのシリアルI/O で
ある。
2. Description of the Related Art FIG. 1 is a block diagram showing a configuration of a conventional serial I / O control circuit incorporating two 8-bit clock synchronous serial I / Os. In the figure, reference numeral 1 denotes a serial I / O having a built-in normal transfer function and automatic transfer function and switching between the two, and reference numeral 2 denotes a serial I / O having only a normal transfer function.

【0003】シリアルI/O 1,2の入出力端子110, 11
1, 112, 113,214, 215,216 は入出力ポートと共用に
なっており、入出力ポートとして使用するかシリアル入
出力端子として使用するかは、後述するシリアルI/O 1
制御レジスタ61及びシリアルI/O 2制御レジスタ62の各
ビット値により選択される。
The input / output terminals 110, 11 of the serial I / Os 1, 2
1, 112, 113, 214, 215, and 216 are shared with input / output ports, and it is determined whether to use them as input / output ports or serial input / output terminals by a serial I / O 1 described later.
It is selected by each bit value of the control register 61 and the serial I / O2 control register 62.

【0004】シリアルI/O 1には、自動転送モード用と
して32バイトのSI/O自動転送RAM 14、SI/O自動転送デー
タポインタ15、シリアルI/O 自動転送コントローラ16及
び5ビットのカウンタで構成される自動転送間隔レジス
タ17が接続されている。
[0004] The serial I / O 1 includes a 32-byte SI / O automatic transfer RAM 14, an SI / O automatic transfer data pointer 15, a serial I / O automatic transfer controller 16 and a 5-bit counter for the automatic transfer mode. The configured automatic transfer interval register 17 is connected.

【0005】図2はシリアルI/O 1制御レジスタ61及び
シリアルI/O 2制御レジスタ62のそれぞれのビット構成
を示す図である。図2(a) に示すシリアルI/O 1制御レ
ジスタ61のビット構成を例に説明すると、ビット0,
1,2は内部クロック選択時の同期クロック発振周波数
を設定する内部同期クロック選択ビット、ビット3は入
出力ポート( P1 , P2 , P3 )として使用するかシリ
アル出力端子 SOUT 又はクロック入出力端子 SCLK とし
て使用するかを選択するシリアルI/O 1ポート選択ビッ
ト、ビット4は入出力ポート( P3 )として使用するか
SRDY /CS端子として使用するかを選択する SRDY 出力
選択ビット、ビット5はデータ転送を最下位ビットから
行うか( LSBファースト)、最上位ビットから行うか
( MSBファースト)を選択する転送方向選択ビット、ビ
ット6は同期クロックとして内部クロックを使用するか
外部クロックを使用するかを選択する同期クロック選択
ビットである。
FIG. 2 is a diagram showing the bit configuration of each of the serial I / O 1 control register 61 and the serial I / O 2 control register 62. The bit configuration of the serial I / O 1 control register 61 shown in FIG.
1,2 Internal synchronous clock selection bits are used to set the synchronous clock oscillation frequency when the internal clock selection, bit 3 input ports (P 1, P 2, P 3) to use the serial output terminal S OUT or clock input as serial I / O 1 port selection bits for selecting whether to use as the output terminal S CLK, whether the bit 4 is used as input and output ports (P 3)
Or S RDY output select bits, bits 5 to select whether to use the S RDY / CS terminal transfers data from the least significant bit (LSB first), the transfer direction for selecting whether to perform the most significant bit (MSB first) The selection bit, bit 6, is a synchronous clock selection bit for selecting whether to use an internal clock or an external clock as the synchronous clock.

【0006】図3はシリアルI/O 自動転送制御レジスタ
7のビット構成図である。ビット0はシリアルI/O 1を
通常モードで使用するか自動転送モードで使用するかを
選択する自動転送制御ビットで、割り込み要因の切り替
えもこのビットで行っており、通常モードのときはシリ
アル転送終了ごとにシリアルI/O 1割り込みが発生し、
自動転送モードのときは自動転送終了後にシリアルI/O
自動転送割り込みが発生する。
FIG. 3 is a bit configuration diagram of the serial I / O automatic transfer control register 7. Bit 0 is an automatic transfer control bit that selects whether to use serial I / O 1 in normal mode or automatic transfer mode. This bit also switches the interrupt factor. In normal mode, serial transfer is performed. A serial I / O 1 interrupt is generated every time
In automatic transfer mode, serial I / O after automatic transfer ends
Automatic transfer interrupt occurs.

【0007】ビット1は自動転送の開始及び終了を設定
する自動転送スタートビット、ビット2は自動転送の
際、送信専用モードにするか全二重(送受信)モードに
するかを選択する転送モード切り替えビットである。送
信専用モードはSI/O自動転送RAM 14のデータをシリアル
I/O 1に転送し、全二重モードはSI/O自動転送RAM 14の
データをシリアルI/O 1と交換する。従って、送信専用
モードではSI/O自動転送RAM 14の内容は保存されるが、
全二重モードではSI/O自動転送RAM 14の内容は保存され
ない。ビット3は内部クロック選択の際、同期クロック
をクロック出力端子 SCLK11 から出力するかクロック出
力端子 SCLK12 から出力するかを選択する同期クロック
出力端子選択ビットである。
[0009] Bit 1 is an automatic transfer start bit for setting the start and end of automatic transfer, and bit 2 is a transfer mode switching for selecting between a transmission-only mode and a full-duplex (transmission / reception) mode during automatic transfer. Is a bit. In the transmission-only mode, the data in the SI / O automatic transfer RAM 14 is serial
Transfer to I / O 1 and full duplex mode exchanges data in SI / O automatic transfer RAM 14 with serial I / O 1. Therefore, in the transmission only mode, the contents of the SI / O automatic transfer RAM 14 are preserved,
In the full-duplex mode, the contents of the SI / O automatic transfer RAM 14 are not saved. Bit 3 is the time of the internal clock selection, a synchronization clock output pin select bits for selecting whether to output the one clock output terminal S CLK12 outputs a synchronous clock from the clock output terminal S CLK11.

【0008】以上のようなビット構成の制御レジスタを
備えたシリアル入出力制御回路では、自動転送モード
(全二重)において転送クロックに内部クロックを選択
する場合、転送クロックのシリアル出力端子として S
CLK11 又は SCLK12 のいずれかを選択するためにシリア
ルI/O自動転送制御レジスタ7のビット3を設定する以
外に、シリアルI/O 1制御レジスタ61のビット3及びビ
ット6をいずれかに設定する必要がある。このとき選択
されない方の端子はハイインピーダンスとなる。
In the serial input / output control circuit having the above-described control register having the bit configuration, when the internal clock is selected as the transfer clock in the automatic transfer mode (full-duplex), the serial output terminal of the transfer clock is used as the serial output terminal.
In addition to setting bit 3 of the serial I / O automatic transfer control register 7 to select either CLK11 or SCLK12 , set bit 3 or bit 6 of the serial I / O 1 control register 61 to either There is a need. At this time, the terminal that is not selected has high impedance.

【0009】また、外部クロック選択時には内部クロッ
クが無効になるので、データを交換する全二重の自動転
送モードでシリアル出力端子 SOUT をアクティブにする
には、端子 113をCS信号の入力端子として選択し、シリ
アル出力端子 SOUT 及び内部クロックを外部から制御す
る。即ち、CS入力が“L”のときは、 SOUT がアクティ
ブになるとともに転送クロック(内部クロック)がイネ
ーブルになり、CS入力が“H”のときは、 SOUT はハイ
インピーダンスになって内部クロックは“H”になる。
When the external clock is selected, the internal clock is invalidated. Therefore, to activate the serial output terminal S OUT in the full-duplex automatic transfer mode for exchanging data, the terminal 113 must be connected to the CS signal input terminal. Select and externally control the serial output terminal S OUT and the internal clock. That is, when the CS input is “L”, S OUT becomes active and the transfer clock (internal clock) is enabled. When the CS input is “H”, S OUT becomes high impedance and the internal clock becomes Becomes "H".

【0010】[0010]

【発明が解決しようとする課題】以上のように、従来の
入出力制御回路では、全二重の自動転送モードで転送ク
ロックのシリアル出力端子を選択するのに制御レジスタ
61のビット3及びビット6の2ビットを要し、またシリ
アル出力端子 SOUT をアクティブにするのに、制御レジ
スタ61のビット3及びビット4の2ビットを必要とす
る。
As described above, in the conventional input / output control circuit, the control register is used to select the serial output terminal of the transfer clock in the full-duplex automatic transfer mode.
Two bits of bit 3 and bit 6 of 61 are required, and two bits of bit 3 and bit 4 of the control register 61 are required to activate the serial output terminal S OUT .

【0011】一般的に、制御レジスタに用いられるIC回
路は8ビットであるが、従来の制御レジスタでは限られ
たビット数に不経済なビット割り付けがなされている。
従って、端子の有効利用のために入力端子と出力端子と
の共用化を図るといったような新しい機能を付加するに
は制御レジスタの数を増やさなけらばならず、回路が大
型化するとともに高価になる。
Generally, an IC circuit used for a control register has 8 bits, but in a conventional control register, a limited number of bits are uneconomically assigned to bits.
Therefore, in order to add a new function such as sharing an input terminal and an output terminal for effective use of the terminal, the number of control registers must be increased, and the circuit becomes large and expensive. Become.

【0012】本発明はこのような問題点を解決するため
になされたものであって、制御レジスタのビット構成を
最適化することにより、制御レジスタの数を増すことな
く新しい機能の付加を可能にした入出力制御回路の提供
を目的とする。
The present invention has been made in order to solve such a problem, and it is possible to add a new function without increasing the number of control registers by optimizing the bit configuration of the control registers. And an input / output control circuit.

【0013】[0013]

【課題を解決するための手段】本発明に係る入出力制御
回路は、内部クロック選択時の同期クロック発振周波数
を設定する第1のビット、入出力回路の端子を入出力ポ
ートとして使用するか出力端子として使用するかを選択
する第2のビット、内部クロック出力端子及び出力端子
の出力形式を選択する第3のビット、データの転送方向
を選択する第4のビット、入出力ポート又は外部クロッ
ク入力端子として使用するか内部クロック出力端子とし
て使用するかを選択する第5のビット、及び出力端子を
アクティブにするかハイインピーダンスにするかを選択
する第6のビットを有する制御レジスタを備え、内部ク
ロック/外部クロック及び入出力ポート/シリアル入出
力端子の選択を同一の第5のビットに割り付け、また第
6のビットのみで出力端子をアクティブにするビット構
成として制御レジスタのビット構成を最適化し、出力端
子の出力形式を選択する機能を第3のビットに割り付け
るとともに、出力端子をアクティブにするかハイインピ
ーダンスにするかを選択する第6のビットによって出力
端子と入力端子との共用化を可能とすることを特徴とす
る。
According to the present invention, there is provided an input / output control circuit comprising: a first bit for setting a synchronous clock oscillation frequency when an internal clock is selected; A second bit for selecting whether to use as a terminal, a third bit for selecting an output format of an internal clock output terminal and an output terminal, a fourth bit for selecting a data transfer direction, an input / output port or an external clock input. A control register having a fifth bit for selecting whether to use it as a terminal or an internal clock output terminal, and a sixth bit for selecting whether to make the output terminal active or high impedance, / Selection of external clock and input / output port / serial input / output terminal is assigned to the same fifth bit, and only the sixth bit is used. Optimize the bit configuration of the control register as the bit configuration that activates the output terminal, assign the function to select the output format of the output terminal to the third bit, and select whether to activate the output terminal or set it to high impedance The output terminal and the input terminal can be shared by the sixth bit.

【0014】[0014]

【作用】本発明に係る入出力制御回路は、制御レジスタ
の第1のビットで内部クロック選択時の同期クロック発
振周波数を設定し、第2のビットで入出力回路の端子を
入出力ポートとして使用するか出力端子として使用する
かを選択し、第3のビットで内部クロック出力端子及び
出力端子の出力形式を例えば3ステートにするかオープ
ンドレインにするかを選択し、第4のビットでデータの
転送方向を選択し、第5のビットで入出力ポート又は外
部クロック入力端子として使用するか内部クロック出力
端子として使用するかを選択し、第6のビットで出力端
子をアクティブにするかハイインピーダンスにするかを
選択する。従って、第6のビットで出力端子をアクティ
ブにしてデータ出力可能とする一方、ハイインピーダン
スにして出力不可とし、この出力端子からデータを入力
する。
The input / output control circuit according to the present invention sets the synchronous clock oscillation frequency when the internal clock is selected by the first bit of the control register, and uses the terminal of the input / output circuit as the input / output port with the second bit. Or the output terminal is used as the output terminal. The third bit selects whether the output format of the internal clock output terminal and the output terminal is set to, for example, three-state or open drain. The transfer direction is selected, the fifth bit selects whether to use as an input / output port or an external clock input terminal or the internal clock output terminal, and the sixth bit activates the output terminal or sets it to high impedance. Choose what to do. Therefore, while the output terminal is activated by the sixth bit to enable data output, the output is made high impedance to disable output, and data is input from this output terminal.

【0015】[0015]

【実施例】以下、本発明をその実施例を示す図に基づい
て説明する。図11は8ビットのクロック同期型シリアル
I/O を2本内蔵した本発明に係るシリアルI/O 制御回路
の構成を示すブロック図である。図中1は通常の転送機
能と自動転送機能とを内蔵しており、2つを切り替えて
使用するシリアルI/O 、2は通常の転送機能のみのシリ
アルI/O である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings showing the embodiments. Figure 11 shows an 8-bit clock synchronous serial
FIG. 2 is a block diagram showing a configuration of a serial I / O control circuit according to the present invention in which two I / Os are incorporated. In the figure, reference numeral 1 denotes a serial I / O which has a normal transfer function and an automatic transfer function and is used by switching between the two. Reference numeral 2 denotes a serial I / O having only the normal transfer function.

【0016】シリアルI/O 1,2の入出力端子110, 11
1, 112, 113,214, 215,216 は入出力ポートと共用に
なっており、入出力ポートとして使用するかシリアル入
出力端子として使用するかは、後述するシリアルI/O 1
制御レジスタ81及びシリアルI/O 2制御レジスタ82のビ
ット値により選択される。
Input / output terminals 110, 11 of serial I / Os 1, 2
1, 112, 113, 214, 215, and 216 are shared with input / output ports, and it is determined whether to use them as input / output ports or serial input / output terminals by using serial I / O
It is selected by the bit values of the control register 81 and the serial I / O2 control register 82.

【0017】シリアルI/O 1には、自動転送モード用の
32バイトのSI/O自動転送RAM 14、SI/O自動転送データポ
インタ15、シリアルI/O 自動転送コントローラ16及び5
ビットのカウンタで構成される自動転送間隔レジスタ17
が接続されている。
The serial I / O 1 has an automatic transfer mode
32-byte SI / O automatic transfer RAM 14, SI / O automatic transfer data pointer 15, serial I / O automatic transfer controllers 16 and 5
Automatic transfer interval register 17 consisting of a bit counter
Is connected.

【0018】図12はシリアルI/O 1制御レジスタ81及び
シリアルI/O 2制御レジスタ82のそれぞれのビット構成
を示す図である。図12(a) に示すシリアルI/O 1制御レ
ジスタ81のビット構成を例に説明すると、ビット0,
1,2は内部クロック選択時の同期クロック発振周波数
を選択する内部同期クロック選択ビット、ビット3は入
出力ポート(P1 )として使用するかシリアル出力端子
SOUT として使用するかを選択する SOUT 端子選択ビッ
ト、ビット4は内部クロック出力端子 SCLK 及びシリア
ル出力端子 SOUT の出力形式がCMOS3ステートかNチャ
ネルオープンドレインかを選択するPch 出力禁止ビッ
ト、ビット5はデータ転送を最下位ビット(ビット0)
から行うか( LSBファースト)又は最上位ビット(ビッ
ト7)から行うか( MSBファースト)を選択する転送方
向選択ビット、ビット6は入出力ポート又は SCLK 入力
端子として使用するか SCLK 出力端子として使用するか
を選択する SCLK 端子選択ビット、ビット7は SOUT
子をアクティブにするかハイインピーダンスにするかを
選択する SOUT 端子制御ビットである。
FIG. 12 is a diagram showing the bit configuration of each of the serial I / O 1 control register 81 and the serial I / O 2 control register 82. Taking the bit configuration of the serial I / O 1 control register 81 shown in FIG.
1 and 2 are internal synchronous clock selection bits for selecting a synchronous clock oscillation frequency when an internal clock is selected, and bit 3 is used as an input / output port (P 1 ) or a serial output terminal.
S OUT pin select bit, bit 4 is Pch output disable bit output format of the internal clock output terminal S CLK and a serial output terminal S OUT to select whether CMOS3 states or N-channel open-drain select whether to use as S OUT, Bit 5 is the least significant bit (bit 0) for data transfer
Or carried from (LSB first) or forward direction select bit for selecting the most significant bit or done from (bit 7) (MSB first), as do S CLK output bit 6 is used as an input port or S CLK input terminal An S CLK terminal selection bit for selecting whether to use the S OUT terminal, bit 7 is an S OUT terminal control bit for selecting whether to activate or high impedance the S OUT terminal.

【0019】図13はシリアルI/O 自動転送制御レジスタ
9のビット構成を示す図であって、ビット0はシリアル
I/O 1を通常モードで使用するか自動転送モードで使用
するかを選択する自動転送制御ビット、ビット1は自動
転送の開始及び終了を設定する自動転送スタートビッ
ト、ビット2は自動転送の際、送信専用モードにするか
全二重モードにするかを選択する転送モード切り替えビ
ット、ビット3は内部クロック選択の際、同期クロック
をクロック出力端子 SCLK11 から出力するかクロック出
力端子 SCLK12 から出力するかを選択する同期クロック
出力端子選択ビット、ビット4はCS端子入力を有効にす
るか無効にするかを選択するCS端子選択ビットである。
FIG. 13 is a diagram showing a bit configuration of the serial I / O automatic transfer control register 9;
An automatic transfer control bit for selecting whether to use I / O 1 in normal mode or automatic transfer mode, bit 1 is an automatic transfer start bit for setting the start and end of automatic transfer, and bit 2 is for automatic transfer. , A transfer mode switching bit for selecting between the transmission only mode and the full-duplex mode, and bit 3 outputs a synchronous clock from the clock output terminal S CLK11 or S CLK12 when the internal clock is selected. Bit 4 is a CS terminal selection bit for selecting whether to enable or disable the CS terminal input.

【0020】以上のような構成の本発明に係るシリアル
I/O 制御回路におけるシリアルI/O1の通常モード時の
動作について説明する。なお、図4及び5は通常モード
での送信時及び受信時におけるシリアルI/O シフトレジ
スタ13の動作タイミングを示す図であり、図6は通常モ
ード時におけるシリアルI/O の動作タイミングを示すタ
イミングチャートである。
The serial according to the present invention having the above configuration
The operation of the serial I / O 1 in the normal mode in the I / O control circuit will be described. 4 and 5 are diagrams showing the operation timing of the serial I / O shift register 13 during transmission and reception in the normal mode, and FIG. 6 is a timing diagram showing the operation timing of the serial I / O in the normal mode. It is a chart.

【0021】シリアルI/O シフトレジスタ13に書き込み
を行うと、書き込みサイクル中にシリアルI/O カウンタ
12が“7”にセットされ、転送クロックが強制的に
“H”になる。書き込みサイクル終了後、送信時には転
送クロックが“H”から“L”に変化するごとに SOUT
端子からデータが出力されると同時にシリアルI/O シフ
トレジスタ13の内容が1ビットシフトされる。また、受
信時には転送クロックが“L”から“H”に変化するご
とに SIN端子からデータが取り込まれると同時にシリア
ルI/O シフトレジスタ13の内容が1ビットシフトされ
る。
When data is written to the serial I / O shift register 13, the serial I / O counter
12 is set to "7", and the transfer clock is forced to "H". After the write cycle, every time the transfer clock changes from “H” to “L” during transmission, S OUT
At the same time data is output from the terminal, the contents of the serial I / O shift register 13 are shifted by one bit. During reception, every time the transfer clock changes from "L" to "H", data is fetched from the SIN terminal and the contents of the serial I / O shift register 13 are shifted by one bit.

【0022】クロック源として内部クロックを選択した
場合、転送クロック(内部クロック)を8回カウントす
るとシリアルI/O カウンタ12は“0”となり、転送クロ
ックは“H”の状態で停止し、シリアルI/O 1割り込み
要求ビットがセットされる。データ転送終了後 SOUT
子がハイインピーダンス状態になる。
When the internal clock is selected as the clock source, when the transfer clock (internal clock) is counted eight times, the serial I / O counter 12 becomes "0", the transfer clock stops at "H", and the serial I / O counter 12 stops. / O 1 interrupt request bit is set. After data transfer is completed, the SOUT pin goes into a high impedance state.

【0023】一方、クロック源として外部クロックを選
択した場合、転送クロックを8回カウントするとシリア
ルI/O 1割り込み要求ビットはセットされるが、転送ク
ロックが入力されている間はシリアルI/O シフトレジス
タ13の内容はシフトされ続ける。またデータ転送終了後
も SOUT 端子はハイインピーダンス状態にならない。シ
リアルI/O 2の通常モード時の動作はシリアルI/O 1の
動作と同様である。
On the other hand, when the external clock is selected as the clock source, the serial I / O1 interrupt request bit is set when the transfer clock is counted eight times, but the serial I / O shift is performed while the transfer clock is being input. The contents of register 13 continue to shift. The SOUT pin does not go into the high-impedance state even after the end of data transfer. The operation of the serial I / O 2 in the normal mode is the same as the operation of the serial I / O 1.

【0024】次に、シリアルI/O 1の自動転送モード
(全二重)について説明する。図7は自動転送時(内部
クロック選択)の動作タイミングを示すタイミングチャ
ートである。自動転送間隔レジスタ17に値nを書き込む
と、自動転送時の転送間隔Ti= (n+2)×Tc〔Tc=1ビッ
ト分の転送クロックの長さ〕が発生する。ただし、この
転送間隔の設定はクロック源として内部クロックが選択
されているときのみ有効である。
Next, the automatic transfer mode (full duplex) of the serial I / O 1 will be described. FIG. 7 is a timing chart showing the operation timing during automatic transfer (internal clock selection). When the value n is written in the automatic transfer interval register 17, a transfer interval Ti = (n + 2) × Tc [Tc = 1 transfer clock length for one bit] at the time of automatic transfer occurs. However, the setting of the transfer interval is effective only when the internal clock is selected as the clock source.

【0025】なお、SI/O自動転送RAM 14は“0100〜011
F”番地に割り付けられており、5ビットのレジスタか
らなるSI/O自動転送データポインタ15が示す値に“010
0”を加えた値がSI/O自動転送RAM 14の実アドレスを示
す。
The SI / O automatic transfer RAM 14 stores "0100 to 011
"F", and the value indicated by the SI / O automatic transfer data pointer 15 composed of a 5-bit register is set to "010".
The value obtained by adding “0” indicates the real address of the SI / O automatic transfer RAM 14.

【0026】自動転送データをシリアルI/O 自動転送RA
M 14に格納する場合、最終転送データが先頭の“0100”
番地に格納されるように、先頭転送データの格納アドレ
スを“0100+(転送データバイト数−1)”番地にす
る。従って、SI/O自動転送データポインタ15に(転送デ
ータバイト数−1)の値を設定する。シリアルI/O 1制
御レジスタ81のビット0,1,2に転送クロック速度を
設定し、自動転送間隔レジスタ17に自動転送間隔を設定
すると自動転送のタイミングが決定する。
Automatic transfer data Serial I / O Automatic transfer RA
When storing in M14, the last transfer data is the first “0100”
The storage address of the first transfer data is set to the address “0100+ (the number of transfer data bytes−1)” so as to be stored at the address. Therefore, the value of (the number of transfer data bytes-1) is set in the SI / O automatic transfer data pointer 15. When the transfer clock speed is set in bits 0, 1, and 2 of the serial I / O1 control register 81 and the automatic transfer interval is set in the automatic transfer interval register 17, the timing of automatic transfer is determined.

【0027】シリアルI/O 自動転送制御レジスタ9のビ
ット0に“1”を書き込むと自動転送モードになり、ビ
ット1に“1”を書き込むと自動転送を開始する。シリ
アルI/O 自動転送制御レジスタ9のビット1は自動転送
中は常に“1”になっており、“0”を書き込むことに
より自動転送を終了させることができる。
Writing "1" to bit 0 of the serial I / O automatic transfer control register 9 switches to the automatic transfer mode, and writing "1" to bit 1 starts automatic transfer. Bit 1 of the serial I / O automatic transfer control register 9 is always "1" during automatic transfer, and the automatic transfer can be terminated by writing "0".

【0028】自動転送が開始すると、まず、SI/O自動転
送データポインタ15により指定されたアドレスのSI/O自
動転送RAM 14のデータがシリアルI/O シフトレジスタ13
に転送される。このときシリアルI/O カウンタ12が
“7”にセットされ、転送クロックが強制的に“H”に
なる。SI/O自動転送RAM 14からシリアルI/O シフトレジ
スタ13への1ビットのデータ転送サイクルが終了して転
送クロックが“H”から“L”に変化する度に SOUT
子からデータが出力される。 SIN端子からは転送クロッ
クが“L”から“H”に変化する度にデータが取り込ま
れると同時にシリアルI/O シフトレジスタ13の内容が1
ビットシフトされる。図8は自動転送モード(全二重)
におけるシリアルI/O シフトレジスタ13の動作タイミン
グを示す図である。
When the automatic transfer starts, first, the data in the SI / O automatic transfer RAM 14 at the address designated by the SI / O automatic transfer data pointer 15 is transferred to the serial I / O shift register 13.
Is forwarded to At this time, the serial I / O counter 12 is set to "7", and the transfer clock is forced to "H". Every time the 1-bit data transfer cycle from the SI / O automatic transfer RAM 14 to the serial I / O shift register 13 is completed and the transfer clock changes from “H” to “L”, data is output from the S OUT terminal. You. Each time the transfer clock changes from "L" to "H" from the SIN terminal, data is fetched and the content of the serial I / O shift register 13 is set to 1 at the same time.
Bit shifted. Figure 8 shows the automatic transfer mode (full duplex)
5 is a diagram showing the operation timing of the serial I / O shift register 13 in FIG.

【0029】転送クロックを8回カウントするとシリア
ルI/O カウンタ12は“0”になり、転送クロックは
“H”の状態で停止し、シリアルI/O シフトレジスタ13
の内容がSI/O自動転送データポインタ15の示すアドレス
のSI/O自動転送RAM 14に転送される。次にSI/O自動転送
データポインタ15の内容が(−1)され、SI/O自動転送
データポインタ15の示すアドレスのSI/O自動転送RAM 14
の内容がシリアルI/O シフトレジスタ13に転送される。
自動転送間隔レジスタ17で設定された転送間隔Tiの経過
後、転送クロックが出力され、シリアル転送を再開する
(内部クロック選択時)。外部クロック選択時には自動
転送間隔レジスタ17の設定が無効となるので外部で転送
クロックを制御する必要がある。
When the transfer clock is counted eight times, the serial I / O counter 12 becomes "0", the transfer clock stops at "H", and the serial I / O shift register 13
Is transferred to the SI / O automatic transfer RAM 14 at the address indicated by the SI / O automatic transfer data pointer 15. Next, the contents of the SI / O automatic transfer data pointer 15 are decremented by (-1), and the SI / O automatic transfer RAM 14 at the address indicated by the SI / O automatic transfer data pointer 15 is read.
Is transferred to the serial I / O shift register 13.
After the transfer interval Ti set by the automatic transfer interval register 17 has elapsed, the transfer clock is output, and the serial transfer is restarted (when the internal clock is selected). When the external clock is selected, the setting of the automatic transfer interval register 17 becomes invalid, so that it is necessary to control the transfer clock externally.

【0030】SI/O自動転送データポインタ15の内容が
“0”になるとシリアル転送は終了する。シリアルI/O
シフトレジスタ13のデータがSI/O自動転送RAM 14に転送
された後に、シリアルI/O 自動転送割り込み要求ビット
がセットされ、シリアルI/O 自動転送制御レジスタ9の
ビット1がクリアされて自動転送が終了する。
When the content of the SI / O automatic transfer data pointer 15 becomes "0", the serial transfer ends. Serial I / O
After the data in the shift register 13 has been transferred to the SI / O automatic transfer RAM 14, the serial I / O automatic transfer interrupt request bit is set, and bit 1 of the serial I / O automatic transfer control register 9 is cleared to perform automatic transfer. Ends.

【0031】なお、送信専用モード時の動作は、シリア
ルI/O シフトレジスタ13からSI/O自動転送RAM 14へのデ
ータ転送が行われないこと以外は全二重モードの場合と
同様である。
The operation in the transmission-only mode is the same as that in the full-duplex mode except that data is not transferred from the serial I / O shift register 13 to the SI / O automatic transfer RAM 14.

【0032】図9は自動転送モードにおいてクロック出
力端子 SCLK11 と SCLK12 とを切り替えて使用する場合
のタイミングチャートである。内部クロック選択時、シ
リアルI/O 自動転送制御レジスタ9のビット3を“1”
に設定すると、同期クロックのシリアル出力端子 S
CLK12 が選択される。このときP2/S CLK11 端子 112は
ハイインピーダンスとなる。端子112 及び113 を S
CLK11 及び SCLK12 のクロック出力端子として選択する
には、シリアルI/O 1制御レジスタ81のビット6のみを
設定すればよい。
FIG. 9 is a timing chart when the clock output terminals S CLK11 and S CLK12 are switched and used in the automatic transfer mode. When the internal clock is selected, bit 3 of the serial I / O automatic transfer control register 9 is set to "1".
When set to, the synchronous clock serial output terminal S
CLK12 is selected. At this time, the P 2 / S CLK11 terminal 112 becomes high impedance. Connect terminals 112 and 113 to S
To select the clock output terminals of CLK11 and SCLK12 , only bit 6 of the serial I / O1 control register 81 needs to be set.

【0033】外部クロック選択時には、内部クロック及
び自動転送間隔レジスタ17における転送間隔の設定は無
効になるが、シリアルI/O 1制御レジスタ81のビット7
をアクティブにするとともに、シリアルI/O 自動転送制
御レジスタ9のビット4を“1”に設定してCS信号入力
を有効にする。CS入力が“L”のときは転送クロック
(内部クロック)がイネーブルになり、CS入力が“H”
のときは内部クロックは“H”になる。
When the external clock is selected, the setting of the internal clock and the transfer interval in the automatic transfer interval register 17 becomes invalid, but bit 7 of the serial I / O1 control register 81
Is activated, and bit 4 of the serial I / O automatic transfer control register 9 is set to “1” to enable the CS signal input. When the CS input is “L”, the transfer clock (internal clock) is enabled, and the CS input is “H”.
In this case, the internal clock becomes "H".

【0034】図10は外部クロック選択時の自動転送モー
ドのタイミングチャートである。CS入力を使用しない場
合、あるいはCSが“L”の場合は自動転送終了後も転送
クロックが入力されている間はシリアルI/O シフトレジ
スタ13のデータはシフトされ続けるので外部クロックを
制御する必要がある。
FIG. 10 is a timing chart of the automatic transfer mode when an external clock is selected. When the CS input is not used, or when CS is “L”, the external clock must be controlled because the data in the serial I / O shift register 13 continues to be shifted while the transfer clock is input even after the end of automatic transfer. There is.

【0035】以上のように、本発明に係るシリアルI/O
制御回路のシリアルI/O 制御レジスタでは、従来ではビ
ット3とビット6との両方を設定しなくてはならなかっ
た内部クロックの出力端子 SCLK11 又は SCLK12 の選択
が、ビット6のみの設定でよい。さらに内部クロック/
外部クロック及び入出力ポート/入出力端子の選択が同
一ビット(ビット6)に割り付けられ、最適化が図られ
ている。
As described above, the serial I / O according to the present invention
In the serial I / O control register of the control circuit, the output terminal S CLK11 or S CLK12 of the internal clock, which had to set both bit 3 and bit 6 in the past, can be selected by setting only bit 6. Good. Internal clock /
The selection of the external clock and the input / output port / input / output terminal is assigned to the same bit (bit 6), and optimization is achieved.

【0036】また、シリアルI/O 制御レジスタのビット
割り付けを最適化することによりシリアル出力端子 S
CLK 及び SOUT 端子の出力形式をCMOS又はNチャネルオ
ープンドレインに選択する機能(ビット4)が付加され
ている。
Also, by optimizing the bit assignment of the serial I / O control register, the serial output terminal S
A function (bit 4) for selecting the output format of the CLK and S OUT terminals to be CMOS or N-channel open drain is added.

【0037】さらに、 SOUT 端子のアクティブ/ハイイ
ンピーダンスがビット3のみによって設定できるので、
有効なビット割り付けであるとともに、ビット3によっ
て1つの端子を入力端子とするか出力端子とするかが選
択できて入出力端子の共用化が図れる。
Further, since the active / high impedance of the S OUT terminal can be set only by bit 3,
In addition to the effective bit allocation, it is possible to select whether one terminal is used as an input terminal or an output terminal by bit 3, and the input / output terminals can be shared.

【0038】図14及び15はシリアルI/O 1及び2を内蔵
した本発明に係るシングルチップマイクロコントローラ
の各ポートの制御信号発生回路の一例を示す回路図であ
る。
FIGS. 14 and 15 are circuit diagrams showing an example of a control signal generating circuit for each port of the single-chip microcontroller according to the present invention having the serial I / Os 1 and 2 built therein.

【0039】また、図16はシリアルI/O 2の端子214 を
入出力端子共用とした回路の各ポートの制御信号発生回
路の一例を示す回路図である。
FIG. 16 is a circuit diagram showing an example of a control signal generation circuit for each port of a circuit in which the terminal 214 of the serial I / O 2 is used as an input / output terminal.

【0040】なお、図中、SM10, SM11, SM12, SM13, SM
14, SM15, SM16及びSM17はそれぞれシリアルI/O 1制御
回路81のビット0, 1, 2, 3, 4, 5, 6 及び7 の信号、ま
た、SM20, SM21, SM22, SM23,SM24, SM25, SM26及びSM
27はそれぞれシリアルI/O 2制御回路82のビット0, 1,
2, 3, 4, 5, 6 及び7 の信号、さらに、SIO1AM0, SAM0,
SAM1, SAM2, SAM3 及びSAM4はシリアルI/O 自動転送制
御レジスタ9のビット0, 1, 2, 3及び4 の信号を示す。
In the figures, SM10, SM11, SM12, SM13, SM
14, SM15, SM16 and SM17 are the signals of bits 0, 1, 2, 3, 4, 5, 6 and 7 of the serial I / O 1 control circuit 81, respectively, and SM20, SM21, SM22, SM23, SM24, SM25 , SM26 and SM
27 are bits 0, 1, and 1 of the serial I / O 2 control circuit 82, respectively.
2, 3, 4, 5, 6 and 7 signals, plus SIO1AM0, SAM0,
SAM1, SAM2, SAM3 and SAM4 indicate the signals of bits 0, 1, 2, 3 and 4 of the serial I / O automatic transfer control register 9.

【0041】[0041]

【発明の効果】以上のように、本発明の入出力制御回路
は制御レジスタのビット割り付けを最適化することによ
り、制御レジスタの数を増すことなく出力端子の出力形
式の選択機能及び出力端子のアクティブ/ハイインピー
ダンスの設定機能が付加されるとともに、出力端子のア
クティブ/ハイインピーダンスの設定により入力端子と
出力端子との共用化を可能にするという優れた効果を奏
する。
As described above, the input / output control circuit of the present invention optimizes the bit allocation of the control register, thereby enabling the selection of the output format of the output terminal and the output terminal selection function without increasing the number of control registers. This provides an excellent effect that an active / high impedance setting function is added and that the input terminal and the output terminal can be shared by setting the active / high impedance of the output terminal.

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

【図1】従来のシリアルI/O 制御回路に内蔵された2本
のシリアルI/O の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of two serial I / Os built in a conventional serial I / O control circuit.

【図2】従来のシリアルI/O 制御回路に内蔵されたシリ
アルI/O 制御レジスタのビット構成を示す図である。
FIG. 2 is a diagram showing a bit configuration of a serial I / O control register incorporated in a conventional serial I / O control circuit.

【図3】従来のシリアルI/O 制御回路に内蔵されたシリ
アルI/O 自動転送制御レジスタのビット構成を示す図で
ある。
FIG. 3 is a diagram showing a bit configuration of a serial I / O automatic transfer control register built in a conventional serial I / O control circuit.

【図4】通常モード(送信)におけるシリアルI/O シフ
トレジスタの動作タイミングを示す図である。
FIG. 4 is a diagram showing operation timing of a serial I / O shift register in a normal mode (transmission).

【図5】通常モード(受信)におけるシリアルI/O シフ
トレジスタの動作タイミングを示す図である。
FIG. 5 is a diagram showing operation timing of a serial I / O shift register in a normal mode (reception).

【図6】通常モードにおけるシリアルI/O の動作タイミ
ングを示すタイミングチャートである。
FIG. 6 is a timing chart showing the operation timing of serial I / O in a normal mode.

【図7】自動転送モード(内部クロック選択)における
シリアルI/O の動作タイミングを示すタイミングチャー
トである。
FIG. 7 is a timing chart showing the operation timing of serial I / O in the automatic transfer mode (internal clock selection).

【図8】自動転送モード(全二重)におけるシリアルI/
O レジスタの動作タイミングを示す図である。
FIG. 8: Serial I / O in automatic transfer mode (full duplex)
FIG. 6 is a diagram illustrating operation timing of an O register.

【図9】クロック出力端子を切り替えて使用する場合に
おけるシリアルI/Oの動作タイミングを示すタイミング
チャートである。
FIG. 9 is a timing chart showing the operation timing of the serial I / O when the clock output terminal is switched and used.

【図10】自動転送モード(外部クロック選択)におけ
るシリアルI/O の動作タイミングを示すタイミングチャ
ートである。
FIG. 10 is a timing chart showing the operation timing of serial I / O in the automatic transfer mode (external clock selection).

【図11】本発明に係るシリアルI/O 制御回路に内蔵さ
れた2本のシリアルI/O の構成を示すブロック図であ
る。
FIG. 11 is a block diagram showing a configuration of two serial I / Os built in a serial I / O control circuit according to the present invention.

【図12】本発明に係るシリアルI/O 制御回路に内蔵さ
れたシリアルI/O 制御レジスタのビット構成を示す図で
ある。
FIG. 12 is a diagram showing a bit configuration of a serial I / O control register incorporated in the serial I / O control circuit according to the present invention.

【図13】本発明に係るシリアルI/O 制御回路に内蔵さ
れたシリアルI/O 自動転送制御レジスタのビット構成を
示す図である。
FIG. 13 is a diagram showing a bit configuration of a serial I / O automatic transfer control register built in a serial I / O control circuit according to the present invention.

【図14】本発明に係るシングルチップマイクロコント
ローラにおけるシリアルI/O 1の端子の制御信号発生回
路の構成を示す回路図である。
FIG. 14 is a circuit diagram showing a configuration of a control signal generation circuit for a terminal of a serial I / O 1 in a single-chip microcontroller according to the present invention.

【図15】本発明に係るシングルチップマイクロコント
ローラにおけるシリアルI/O 2の端子の制御信号発生回
路の構成を示す回路図である。
FIG. 15 is a circuit diagram showing a configuration of a control signal generation circuit for a terminal of a serial I / O 2 in a single-chip microcontroller according to the present invention.

【図16】本発明に係るシングルチップマイクロコント
ローラにおける入力端子/出力端子共用化における端子
の制御信号発生回路の構成を示す回路図である。
FIG. 16 is a circuit diagram showing a configuration of a terminal control signal generation circuit in input / output terminal sharing in the single-chip microcontroller according to the present invention.

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

1,2 シリアルI/O 12 シリアルI/O カウンタ 13 シリアルI/O シフトレジスタ 81 シリアルI/O 1制御レジスタ 82 シリアルI/O 2制御レジスタ 9 シリアルI/O 自動転送制御レジスタ 1, 2 serial I / O 12 serial I / O counter 13 serial I / O shift register 81 serial I / O 1 control register 82 serial I / O 2 control register 9 serial I / O automatic transfer control register

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 内部クロック又は外部クロックに同期し
て双方向バスを介してデータを転送し、データの転送方
向が可逆である入出力回路の入出力状態を制御レジスタ
の各ビットの値によって設定する入出力制御回路におい
て、内部クロック選択時の同期クロック発振周波数を設
定する第1のビット、入出力回路の端子を入出力ポート
として使用するか出力端子として使用するかを選択する
第2のビット、内部クロック出力端子及び出力端子の出
力形式を選択する第3のビット、データの転送方向を選
択する第4のビット、入出力ポート又は外部クロック入
力端子として使用するか内部クロック出力端子として使
用するかを選択する第5のビット、及び出力端子をアク
ティブにするかハイインピーダンスにするかを選択する
第6のビットを有する制御レジスタを備えたことを特徴
とする入出力制御回路。
An input / output state of an input / output circuit in which data is transferred via a bidirectional bus in synchronization with an internal clock or an external clock and the data transfer direction is reversible is set by a value of each bit of a control register. A first bit for setting a synchronous clock oscillation frequency when an internal clock is selected, and a second bit for selecting whether to use a terminal of the input / output circuit as an input / output port or an output terminal A third bit for selecting the output format of the internal clock output terminal and the output terminal, a fourth bit for selecting the data transfer direction, used as an input / output port or an external clock input terminal, or used as an internal clock output terminal. And a sixth bit for selecting whether to make the output terminal active or high impedance. An input / output control circuit comprising a control register.
【請求項2】 請求項1記載の入出力制御回路を備えた
シングルチップマイクロコントローラ。
2. A single-chip microcontroller comprising the input / output control circuit according to claim 1.
JP30467791A 1991-11-20 1991-11-20 I / O control circuit Expired - Fee Related JP2619167B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30467791A JP2619167B2 (en) 1991-11-20 1991-11-20 I / O control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30467791A JP2619167B2 (en) 1991-11-20 1991-11-20 I / O control circuit

Publications (2)

Publication Number Publication Date
JPH05143509A JPH05143509A (en) 1993-06-11
JP2619167B2 true JP2619167B2 (en) 1997-06-11

Family

ID=17935899

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30467791A Expired - Fee Related JP2619167B2 (en) 1991-11-20 1991-11-20 I / O control circuit

Country Status (1)

Country Link
JP (1) JP2619167B2 (en)

Also Published As

Publication number Publication date
JPH05143509A (en) 1993-06-11

Similar Documents

Publication Publication Date Title
CA1143071A (en) Computer input/output arrangement
US5416909A (en) Input/output controller circuit using a single transceiver to serve multiple input/output ports and method therefor
JP2545482B2 (en) Interface device transfer parameter setting method
WO1996010230A1 (en) Data transfer device and video game apparatus using the device
US20100064083A1 (en) Communications device without passive pullup components
JP2778222B2 (en) Semiconductor integrated circuit device
US20030167368A1 (en) Transmission control circuit, reception control circuit, communications control circuit, and communications control unit
US5321400A (en) Serial data interface circuit dealing with a plurality of receiving modes
CN110008162B (en) Buffer interface circuit, and method and application for transmitting data based on buffer interface circuit
US5572676A (en) Network I/O device having fifo for synchronous and asynchronous operation
JP2619167B2 (en) I / O control circuit
CN115934614A (en) UART communication interface with FIFO buffer function based on APB bus
US5717874A (en) Apparatus for data transfer between image memory and external I/O device wherein inner registers set the image valid area, direction and moder of transfer
WO2024017337A1 (en) Fifo storage control circuit and method, chip, and electronic device
JP3161370B2 (en) Port shared circuit
JPH10207834A (en) Serial input/output circuit
JP2570986B2 (en) Data transfer control device and method
US6078973A (en) System controller interfacing a main memory and a modem and transferring data directly between dedicated region of the memory and the modem I/O circuitry
JP2634609B2 (en) Data transfer device
JPH01103757A (en) Device for transferring data
JP4012298B2 (en) interface
JPH04273358A (en) One-chip microcomputer containing dmac
JPH11242651A (en) Interface
JPH04160460A (en) Serial data transmitter receiver
JPH05252039A (en) Multi-channel d/a converter of 3-line serial data transfer system

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 11

Free format text: PAYMENT UNTIL: 20080311

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20090311

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 12

Free format text: PAYMENT UNTIL: 20090311

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100311

Year of fee payment: 13

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 14

Free format text: PAYMENT UNTIL: 20110311

FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 14

Free format text: PAYMENT UNTIL: 20110311

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110311

Year of fee payment: 14

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees