JP2001195356A - Communication control circuit - Google Patents

Communication control circuit

Info

Publication number
JP2001195356A
JP2001195356A JP2000004854A JP2000004854A JP2001195356A JP 2001195356 A JP2001195356 A JP 2001195356A JP 2000004854 A JP2000004854 A JP 2000004854A JP 2000004854 A JP2000004854 A JP 2000004854A JP 2001195356 A JP2001195356 A JP 2001195356A
Authority
JP
Japan
Prior art keywords
clock
pulse
communication control
clock line
data
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
JP2000004854A
Other languages
Japanese (ja)
Inventor
Atsushi Nakahara
淳 中原
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.)
Renesas Design Corp
Mitsubishi Electric Corp
Original Assignee
Renesas Design Corp
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 Renesas Design Corp, Mitsubishi Electric Corp filed Critical Renesas Design Corp
Priority to JP2000004854A priority Critical patent/JP2001195356A/en
Publication of JP2001195356A publication Critical patent/JP2001195356A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Systems (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To solve the problems that the loads of a CPU become heavy and data transmission and reception can not be efficiently executed since the CPU controls clock line changeover based on interruption request signals generated by clock changeover. SOLUTION: A pulse edge detection circuit 1 detects the level of a first clock SCK1 on a first clock line 11 and generates a one-shot pulse P when the level is changed. A changeover register 2 changes a setting value when the one-shot pulse P is inputted. A selector 3 switches connection to the first clock line corresponding to the setting value of the changeover register 2 without the intervention of the CPU. A communication control timing generation circuit 4 controls the data transmission and reception in synchronism with the first clock SCK1 obtained through the switched first clock line 11.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、クロックライン
を介して送信され供給される複数の通信クロックのレベ
ル変化を検出した場合、自動的にクロックを切換え、切
換えたクロックに同期してデータ送受信の制御を行なう
通信制御回路に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention automatically switches clocks when detecting a change in the level of a plurality of communication clocks transmitted and supplied via a clock line, and transmits and receives data in synchronization with the switched clocks. The present invention relates to a communication control circuit for performing control.

【0002】[0002]

【従来の技術】クロックラインを介して送信されてきた
複数の通信クロックを入力し、入力した通信クロック
(以下、クロックという。)に同期してデータ送受信の
制御を行う従来の通信制御回路では、クロックを切換え
る場合、割込み要求信号を発生させ、CPU(図示せ
ず)が所定の命令を実行し、クロックラインを選択しク
ロックを切換えていた。従って、クロックの切換要求に
基づいて発生された割込み要求の優先度と比較して、よ
り高い優先度の割込み要求が多重に発生した場合、命令
を実行するCPUの負荷が重くなり、クロックの切換要
求に基づいた割込み要求処理は遅延され、クロック切換
えが迅速に実行できず、クロックに同期したシリアルデ
ータの送受信が実行できない場合があった。
2. Description of the Related Art In a conventional communication control circuit, a plurality of communication clocks transmitted through a clock line are input, and data transmission and reception are controlled in synchronization with the input communication clock (hereinafter referred to as a clock). When switching the clock, an interrupt request signal is generated, a CPU (not shown) executes a predetermined instruction, selects a clock line, and switches the clock. Therefore, when multiple interrupt requests with higher priority are generated in comparison with the priority of the interrupt request generated based on the clock switching request, the load of the CPU executing the instruction becomes heavy, and the clock switching is performed. The interrupt request processing based on the request is delayed, so that the clock switching cannot be executed promptly, and the transmission and reception of serial data synchronized with the clock may not be executed.

【0003】図6は従来の通信制御回路を示すブロック
図であり、図において、61は第1クロックSCK1の
レベル変化を検出して1ショットパルスを生成するパル
スエッジ検出回路、62は切換えレジスタ、63はセレ
クタ、64は通信制御タイミング発生回路、65は8ビ
ットのデータシフトレジスタ、66はアドレス制御回
路、67は内部アドレスバス、68は内部データバス、
70はRAM等のメモリ、71は第1クロックライン、
72は第2クロックライン、73はデータライン、74
はパルスエッジ検出フラグである。また、69は第1ク
ロックSCK1、第2クロックSCK2を、第1クロッ
クライン71、第2クロックライン72を介して通信制
御回路400へ供給するマスタデバイスである。
FIG. 6 is a block diagram showing a conventional communication control circuit. In FIG. 6, reference numeral 61 denotes a pulse edge detection circuit for detecting a level change of the first clock SCK1 to generate a one-shot pulse, 62 a switching register, 63 is a selector, 64 is a communication control timing generation circuit, 65 is an 8-bit data shift register, 66 is an address control circuit, 67 is an internal address bus, 68 is an internal data bus,
70 is a memory such as a RAM, 71 is a first clock line,
72 is a second clock line, 73 is a data line, 74
Is a pulse edge detection flag. A master device 69 supplies the first clock SCK1 and the second clock SCK2 to the communication control circuit 400 via the first clock line 71 and the second clock line 72.

【0004】従来の通信制御回路400は、パルスエッ
ジ検出回路61、切換えレジスタ62、セレクタ63、
通信制御タイミング発生回路64、データシフトレジス
タ65、アドレス制御回路66、内部アドレスバス6
7、内部データバス68、パルスエッジ検出フラグ7
4、およびメモリ70から構成されている。
A conventional communication control circuit 400 includes a pulse edge detection circuit 61, a switching register 62, a selector 63,
Communication control timing generation circuit 64, data shift register 65, address control circuit 66, internal address bus 6
7, internal data bus 68, pulse edge detection flag 7
4 and a memory 70.

【0005】次に、動作について説明する。図7は、図
6に示した従来の通信制御回路400のクロック切換え
動作を示すタイミングチャートである。従来の通信制御
回路400は、第1クロックSCK1および第2クロッ
クSCK2を送信するための2本のクロックライン、即
ち、第1クロックライン71および第2クロックライン
72と、データの送受信を行うデータライン73を介し
て、マスタデバイス69と接続されている。尚、以下の
説明では、クロックラインの本数は2本、シリアル送受
信するデータ長は8ビットの場合について説明する。
Next, the operation will be described. FIG. 7 is a timing chart showing the clock switching operation of the conventional communication control circuit 400 shown in FIG. The conventional communication control circuit 400 includes two clock lines for transmitting a first clock SCK1 and a second clock SCK2, that is, a first clock line 71 and a second clock line 72, and a data line for transmitting and receiving data. It is connected to the master device 69 via 73. In the following description, the case where the number of clock lines is two and the data length of serial transmission / reception is 8 bits will be described.

【0006】通信制御回路400の切換えレジスタ62
内には、初期値として、第2クロックライン72のアド
レスを示すアドレス情報、具体的には、第2クロックラ
イン72を示すLレベル値が設定される。
The switching register 62 of the communication control circuit 400
In the field, address information indicating the address of the second clock line 72, specifically, an L level value indicating the second clock line 72 is set as an initial value.

【0007】通信制御タイミング発生回路64は、内部
に制御レジスタ(図示せず)を備えており、通信に必要
な各種制御信号を制御するための制御データが格納され
ている。マスタデバイス69へ、データライン73を介
してデータをシリアルに送信する場合、CPU(図示せ
ず)が命令を実行し、アドレス制御回路66が内部アド
レスバス67上のアドレスデータをもとにデータシフト
レジスタ65を指定し、内部データバス68を介して、
データがデータシフトレジスタ65内に書き込まれる。
切換えレジスタ62内には、第2クロックライン72を
選択するLレベル値が設定されているので、セレクタ6
3は、第2クロックライン72と通信制御タイミング発
生回路64とを接続している。
The communication control timing generation circuit 64 includes a control register (not shown) therein, and stores control data for controlling various control signals required for communication. When serially transmitting data to the master device 69 via the data line 73, a CPU (not shown) executes an instruction and the address control circuit 66 performs data shift based on address data on the internal address bus 67. By specifying the register 65, via the internal data bus 68,
Data is written into the data shift register 65.
Since an L level value for selecting the second clock line 72 is set in the switching register 62, the selector 6
Reference numeral 3 connects the second clock line 72 to the communication control timing generation circuit 64.

【0008】そして、図7のタイミングチャートに示す
ように、第2クロックライン72を介して第2クロック
SCK2のパルスが通信制御タイミング発生回路64へ
供給され、第2クロックSCK2のパルスの立上がりエ
ッジに同期して、8ビットのシリアルデータDA7(M
SB),DA6,...,DA1,DA0(LSB)
が、データライン73を介してマスタデバイス69へシ
リアルに送信される(タイミングT71〜T72)。こ
の場合、送信されるデータは、MSBファーストであ
る。
Then, as shown in the timing chart of FIG. 7, a pulse of the second clock SCK2 is supplied to the communication control timing generation circuit 64 via the second clock line 72, and the pulse is supplied to the rising edge of the pulse of the second clock SCK2. Synchronously, 8-bit serial data DA7 (M
SB), DA6,. . . , DA1, DA0 (LSB)
Is serially transmitted to the master device 69 via the data line 73 (timing T71 to T72). In this case, the transmitted data is MSB first.

【0009】次に、Hレベルを保持していた第1クロッ
クSCK1がLレベルへ立下がると(タイミングT7
3)、第1クロックライン71に接続されているパルス
エッジ検出回路61は、第1クロックSCK1の立下が
りエッジ(タイミングT73)を検出し、この第1クロ
ックSCK1の立下がりエッジに同期して1ショットパ
ルスを生成し出力する。
Next, when the first clock SCK1 holding the H level falls to the L level (at timing T7).
3) The pulse edge detection circuit 61 connected to the first clock line 71 detects the falling edge of the first clock SCK1 (timing T73), and outputs 1 in synchronization with the falling edge of the first clock SCK1. Generates and outputs shot pulses.

【0010】パルスエッジ検出回路61から1ショット
パルスが出力されると(タイミングT73)、パルスエ
ッジ検出フラグ74内には検出フラグがセットされる。
同時に、1ショットパルスは、割込み要求信号としてC
PU(図示せず)へ出力される。
When a one-shot pulse is output from the pulse edge detection circuit 61 (timing T73), a detection flag is set in the pulse edge detection flag 74.
At the same time, one shot pulse is used as an interrupt request signal
Output to PU (not shown).

【0011】CPUは、パルスエッジ検出回路61から
出力された割込み要求信号を入力すると割込みプログラ
ムルーチンを実行する。これにより、パルスエッジ検出
フラグ74はチェックされ、パルスエッジ検出回路61
から1ショットパルスが出力されたことが確認される
と、セレクタ63が第1クロックライン71を選択する
ように、切換えレジスタ62内にHレベル値が書き込ま
れる。セレクタ63は、切換えレジスタ62内に設定さ
れているHレベル値に従って第1クロックライン71を
選択し、第1クロックライン71と通信制御タイミング
発生回路64とを接続する。これにより、第1クロック
SCK1のパルスが、通信制御タイミング発生回路64
へ供給可能な状態となる。
When the CPU receives the interrupt request signal output from the pulse edge detection circuit 61, it executes an interrupt program routine. As a result, the pulse edge detection flag 74 is checked, and the pulse edge detection circuit 61
When it is confirmed that a one-shot pulse has been output from, an H level value is written into the switching register 62 so that the selector 63 selects the first clock line 71. The selector 63 selects the first clock line 71 according to the H level value set in the switching register 62, and connects the first clock line 71 to the communication control timing generation circuit 64. Thereby, the pulse of the first clock SCK1 is output to the communication control timing generation circuit 64.
It can be supplied to

【0012】次に、内部アドレスバス67を介して得ら
れたアドレスをもとに、アドレス制御回路66はデータ
シフトレジスタ65を指定する。その後、内部データバ
ス68を介して、データシフトレジスタ65内に送信す
るためのデータが格納され、第1クロックSCK1のパ
ルスがマスタデバイス69から第1クロックライン71
を介して通信制御タイミング発生回路64へ供給され始
める。そして、第1クロックSCK1のパルスの立上が
りエッジ(タイミングT75)に同期して、データシフ
トレジスタ65内に格納されている送信データは、デー
タライン73を介してマスタデバイス69へシリアルに
送信される(タイミングT75〜T76)。
Next, based on the address obtained via the internal address bus 67, the address control circuit 66 specifies the data shift register 65. Thereafter, data to be transmitted is stored in the data shift register 65 via the internal data bus 68, and the pulse of the first clock SCK1 is transmitted from the master device 69 to the first clock line 71.
To the communication control timing generation circuit 64 via Then, in synchronization with the rising edge of the pulse of the first clock SCK1 (timing T75), the transmission data stored in the data shift register 65 is serially transmitted to the master device 69 via the data line 73 ( Timings T75 to T76).

【0013】[0013]

【発明が解決しようとする課題】従来の通信制御回路
は、以上のように構成されていたので、切換えられたク
ロックに同期してデータの送受信を制御する場合、クロ
ック切換要求に伴って生成される割込み要求信号に基づ
いて、CPUがデータの送受信に関する命令を実行しデ
ータを送受信していた。従って、クロック切換要求に基
づいて生成された割込み要求信号の優先度と比較して、
より高い優先度の割込みが発生した場合、あるいは、ク
ロック切換要求が多発して割込み要求信号が高頻度で発
生した場合、CPUの命令を実行する負荷が重くなり割
込み要求信号の処理に遅延が生じ、クロック切換えが迅
速に実行できず、データの送受信を効率良く実行できな
いといった課題があった。
Since the conventional communication control circuit is configured as described above, when data transmission / reception is controlled in synchronization with the switched clock, it is generated in response to a clock switching request. The CPU executes an instruction related to data transmission / reception based on the interrupt request signal to transmit / receive data. Therefore, compared with the priority of the interrupt request signal generated based on the clock switching request,
If an interrupt with a higher priority occurs, or if an interrupt request signal occurs frequently due to frequent clock switching requests, the load of executing the CPU instruction becomes heavy, and the processing of the interrupt request signal is delayed. In addition, there has been a problem that clock switching cannot be performed quickly and data transmission and reception cannot be performed efficiently.

【0014】この発明は上記のような課題を解決するた
めになされたもので、複数の通信クロックを供給する複
数のクロックラインの状態をセンスして、CPUの介在
無しに、クロックを自動的に切換え、切換えたクロック
に同期して、データの送受信を効率良く制御可能な通信
制御回路を得る事を目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and senses the state of a plurality of clock lines for supplying a plurality of communication clocks, so that the clocks can be automatically transmitted without CPU intervention. It is an object of the present invention to provide a communication control circuit capable of efficiently controlling data transmission and reception in synchronization with the switched clock.

【0015】[0015]

【課題を解決するための手段】この発明に係る通信制御
回路は、パルスエッジ検出回路、接続手段、制御手段を
備えている。パルスエッジ検出回路は、第nクロックを
供給する第nクロックライン以外の複数のクロックを供
給する複数のクロックラインに接続され、前記複数のク
ロックのレベルを検出し、レベル変化を生じたクロック
に対応した1ショットパルスを生成し出力する。接続手
段は、初期状態では前記第nクロックラインと接続して
おり、前記1ショットパルスを入力した場合、前記レベ
ル変化を生じたクロックに対応した前記クロックライン
に接続を切換える。そして、制御手段は、初期状態では
前記第nクロックのパルスに同期してデータの送受信を
制御し、前記1ショットパルスを入力した場合、前記接
続手段で接続された前記クロックラインを介して供給さ
れる前記クロックのパルスに同期して、データの送受信
の制御を行うことで、CPUの介在無しに自動的にクロ
ックを切換え、切換えたクロックに同期して、データを
送受信するものである。
A communication control circuit according to the present invention includes a pulse edge detection circuit, connection means, and control means. The pulse edge detection circuit is connected to a plurality of clock lines that supply a plurality of clocks other than the n-th clock line that supplies the n-th clock, detects a level of the plurality of clocks, and responds to a clock that has caused a level change. The generated one-shot pulse is generated and output. The connection means is connected to the n-th clock line in an initial state, and switches the connection to the clock line corresponding to the clock having the level change when the one-shot pulse is input. The control means controls the transmission and reception of data in synchronization with the pulse of the n-th clock in the initial state, and is supplied via the clock line connected by the connection means when the one-shot pulse is input. By controlling the data transmission and reception in synchronization with the clock pulse, the clock is automatically switched without the intervention of the CPU, and the data is transmitted and received in synchronization with the switched clock.

【0016】この発明に係る通信制御回路は、第nクロ
ックラインを介して常に供給されている第nクロックの
パルスをカウントし、カウント数が所定値に達したらオ
ーバフロー信号を生成し出力し、パルスエッジ検出回路
から出力された1ショットパルスを入力すると前記カウ
ント数を初期値に設定するカウント手段をさらに備えて
いる。そして、接続手段は、前記第nクロックライン以
外のクロックラインを接続している状態で、前記カウン
ト手段から出力された前記オーバフロー信号を入力した
場合、接続を前記第nクロックラインに切換え、前記第
nクロックを前記制御手段へ供給することを特徴とする
ものである。
The communication control circuit according to the present invention counts the pulse of the n-th clock which is always supplied via the n-th clock line, and generates and outputs an overflow signal when the counted number reaches a predetermined value. There is further provided a counting means for setting the count number to an initial value when the one-shot pulse output from the edge detection circuit is input. Then, when the overflow signal output from the counting means is input in a state where the clock lines other than the n-th clock line are connected, the connecting means switches the connection to the n-th clock line, and It is characterized in that n clocks are supplied to the control means.

【0017】この発明に係る通信制御回路は、パルスエ
ッジ検出回路がレジスタを備え、第nクロック以外の複
数のクロックのレベル変化に対応した値を格納し、レジ
スタ内に格納された値をデコードするデコーダをさらに
備え、接続手段は、前記デコーダから出力されるデコー
ド結果に従って、クロックラインの接続を切換えること
を特徴とするものである。
In the communication control circuit according to the present invention, the pulse edge detection circuit includes a register, stores a value corresponding to a level change of a plurality of clocks other than the n-th clock, and decodes the value stored in the register. The information processing apparatus further includes a decoder, and the connection means switches connection of the clock line according to a decoding result output from the decoder.

【0018】[0018]

【発明の実施の形態】以下、この発明の実施の一形態を
説明する。 実施の形態1.図1はこの発明の実施の形態1による通
信制御回路を示すブロック図であり、図において、1は
第1クロックライン11を介して供給される第1クロッ
クSCK1のレベルの変化を検出し、レベル変化を検出
した場合に1ショットパルスを生成し出力するパルスエ
ッジ検出回路、2はパルスエッジ検出回路1から出力さ
れた1ショットパルスに従って、クロックラインを選択
し切換えるための設定値を格納する切換えレジスタ(接
続手段)、3は切換えレジスタ2内に設定された設定値
に従って、第1クロックライン11および第2クロック
ライン12のいずれかを選択するセレクタ(接続手段)
である。尚、切換えレジスタ2内には、初期値として、
セレクタ3が第2クロックライン12を選択するための
設定値が格納されている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below. Embodiment 1 FIG. FIG. 1 is a block diagram showing a communication control circuit according to Embodiment 1 of the present invention. In FIG. 1, reference numeral 1 denotes a level change of a first clock SCK1 supplied via a first clock line 11, A pulse edge detection circuit that generates and outputs a one-shot pulse when a change is detected, and a switching register that stores a set value for selecting and switching a clock line according to the one-shot pulse output from the pulse edge detection circuit 1 (Connecting means) 3 is a selector (connecting means) for selecting one of the first clock line 11 and the second clock line 12 according to the set value set in the switching register 2.
It is. In the switching register 2, as an initial value,
A set value for the selector 3 to select the second clock line 12 is stored.

【0019】4はデータライン13を介して、通信制御
回路100とマスタデバイス9との間で、第1クロック
SCK1あるいは第2クロックSCK2に同期して、デ
ータをシリアルに送受信するためのタイミング制御を行
う通信制御タイミング発生回路(制御手段)である。こ
の通信制御タイミング発生回路4は、内部に制御レジス
タ(図示せず)を備えており、通信に必要な各種制御信
号を制御するための制御データが格納される。
Reference numeral 4 denotes timing control for serially transmitting and receiving data between the communication control circuit 100 and the master device 9 via the data line 13 in synchronization with the first clock SCK1 or the second clock SCK2. This is a communication control timing generation circuit (control means). The communication control timing generation circuit 4 includes a control register (not shown) therein, and stores control data for controlling various control signals required for communication.

【0020】5は8ビットのデータを格納するデータシ
フトレジスタ、6はアドレス制御回路、7は内部アドレ
スバス、8は内部データバス、10はRAM等のメモ
リ、11はマスタデバイス9から第1クロックSCK1
を通信制御回路100へ供給するための第1クロックラ
イン、12はマスタデバイス9から第2クロックSCK
2を通信制御回路100へ供給するための第2クロック
ライン、13はデータSDATAをシリアルに送受信す
るためのデータラインである。
5 is a data shift register for storing 8-bit data, 6 is an address control circuit, 7 is an internal address bus, 8 is an internal data bus, 10 is a memory such as a RAM, and 11 is a first clock from the master device 9. SCK1
Is supplied to the communication control circuit 100 from the master device 9.
2 is a second clock line for supplying 2 to the communication control circuit 100, and 13 is a data line for serially transmitting and receiving data SDATA.

【0021】実施の形態1に係わる通信制御回路100
は、パルスエッジ検出回路1、切換えレジスタ2、セレ
クタ3、通信制御タイミング発生回路4、データシフト
レジスタ5、アドレス制御回路6、内部アドレスバス
7、内部データバス8、およびメモリ10から構成され
ている。
Communication control circuit 100 according to the first embodiment
Is composed of a pulse edge detection circuit 1, a switching register 2, a selector 3, a communication control timing generation circuit 4, a data shift register 5, an address control circuit 6, an internal address bus 7, an internal data bus 8, and a memory 10. .

【0022】次に、動作について説明する。図2は、図
1に示した実施の形態1による通信制御回路100のク
ロック切換え動作を示すタイミングチャートである。
尚、以下の説明では、切換え対象となるクロックは、第
1クロックSCK1および第2クロックSCK2であ
り、通信制御回路100とマスタデバイス9との間で送
受信されるデータは8ビットのシリアルデータの場合を
代表して説明するが、この発明はこれに限定されるもの
では無く、切換え対象のクロックは、複数のクロックラ
インを介してそれぞれ供給される複数のクロックの場合
でもよく、また、8ビット以外のビット長を有するデー
タを送受信する場合でもよい。
Next, the operation will be described. FIG. 2 is a timing chart showing a clock switching operation of communication control circuit 100 according to the first embodiment shown in FIG.
In the following description, the clocks to be switched are the first clock SCK1 and the second clock SCK2, and the data transmitted and received between the communication control circuit 100 and the master device 9 is 8-bit serial data. However, the present invention is not limited to this, and the clock to be switched may be a plurality of clocks respectively supplied through a plurality of clock lines. May be transmitted and received.

【0023】先ず、初期状態では、第2クロックライン
12を介して、マスタデバイス9から通信制御回路10
0へ、第2クロックSCK2のパルスが連続して供給さ
れている。また、Hレベルに固定された第1クロックS
CK1が、第1クロックライン11を介して通信制御回
路100へ供給されている(タイミングT21〜T2
2)。
First, in the initial state, the communication control circuit 10 is transmitted from the master device 9 via the second clock line 12.
To 0, the pulse of the second clock SCK2 is continuously supplied. Also, the first clock S fixed at the H level
CK1 is supplied to the communication control circuit 100 via the first clock line 11 (timings T21 to T2).
2).

【0024】次に、アドレス制御回路6は、内部アドレ
スバス7を介して得られたアドレスに従って、データシ
フトレジスタ5を選択し、これにより、RAM等のメモ
リ10内に格納されている8ビットのデータSDATA
は、ダイレクトメモリアクセス機能を用いて読み出さ
れ、データシフトレジスタ5内に格納される。このデー
タSDATAは、図2のタイミングチャートに示すよう
に、MSBがDA7でありLSBがDA0である。そし
て、通信制御タイミング発生回路4は、第2クロックラ
イン12を介して供給される第2クロックSCK2のパ
ルスの立上がりエッジに同期して、データライン13を
介してデータシフトレジスタ5内のデータをマスタデバ
イス9へシリアルに送信する(タイミングT21〜T2
2)。
Next, the address control circuit 6 selects the data shift register 5 in accordance with the address obtained via the internal address bus 7, and thereby the 8-bit data shift register 5 stored in the memory 10 such as a RAM. Data SDATA
Are read out using the direct memory access function and stored in the data shift register 5. As shown in the timing chart of FIG. 2, the data SDATA has the MSB of DA7 and the LSB of DA0. Then, the communication control timing generation circuit 4 synchronizes the data in the data shift register 5 via the data line 13 with the master in synchronization with the rising edge of the pulse of the second clock SCK2 supplied via the second clock line 12. Serially transmitted to the device 9 (timing T21 to T2
2).

【0025】次に、第2クロックSCK2から第1クロ
ックSCK1へのクロックの切換えを行う場合、マスタ
デバイス9は、第1クロックSCK1をHレベルからL
レベルに切換える(タイミングT23)。これにより、
パルスエッジ検出回路1は、第1クロックSCK1のH
レベルからLレベルへの立ち下がりエッジを検出し(タ
イミングT23)、1ショットパルスPを生成し、切換
えレジスタ2および通信制御タイミング発生回路4へ同
時に出力する。
Next, when switching the clock from the second clock SCK2 to the first clock SCK1, the master device 9 changes the first clock SCK1 from H level to L level.
The level is switched (timing T23). This allows
The pulse edge detection circuit 1 detects the H level of the first clock SCK1.
A falling edge from the level to the L level is detected (timing T23), a one-shot pulse P is generated, and output to the switching register 2 and the communication control timing generation circuit 4 simultaneously.

【0026】次に、切換えレジスタ2内の設定値は、パ
ルスエッジ検出回路1から出力された1ショットパルス
Pを入力すると、Lレベル値からHレベル値に書き換え
られ、これによりセレクタ3内の接続が切換わり、第1
クロックライン11と通信制御タイミング発生回路4と
が接続される。また、1ショットパルスPは通信制御タ
イミング発生回路4へも同時に出力されているので、通
信制御タイミング発生回路4は、第2クロックSCK2
に同期したデータ送受信の制御を停止する。
Next, when the one-shot pulse P output from the pulse edge detection circuit 1 is input, the set value in the switching register 2 is rewritten from the L level value to the H level value. Is switched to the first
The clock line 11 and the communication control timing generation circuit 4 are connected. In addition, since the one-shot pulse P is also output to the communication control timing generation circuit 4 at the same time, the communication control timing generation circuit 4 outputs the second clock SCK2
Stops control of data transmission and reception synchronized with.

【0027】そして、この1ショットパルスPの発生に
より、通信制御タイミング発生回路4は、第1クロック
SCK1のパルスに同期したデータ送受信を実行するた
め、RAM等のメモリ10からダイレクトメモリアクセ
ス機能を用いて、送受信するためのデータSDATAを
読み出し、データシフトレジスタ5内へ格納する。
The generation of the one-shot pulse P causes the communication control timing generation circuit 4 to use a direct memory access function from a memory 10 such as a RAM in order to execute data transmission and reception in synchronization with the pulse of the first clock SCK1. Then, the data SDATA for transmission / reception is read and stored in the data shift register 5.

【0028】データシフトレジスタ5内に格納されたデ
ータSDATAは、マスタデバイス9から連続して出力
される第1クロックSCK1のパルスの立上がりエッジ
に同期して、データライン13を介して、マスタデバイ
ス6へシリアルに送信される(タイミングT24〜T2
5)。図2に示すタイミングチャートでは、通信制御回
路100からマスタデバイス9へ送信されるデータSD
ATA(DB7,DB6,...,DB0)は、MSB
ファーストの場合を示している。
The data SDATA stored in the data shift register 5 is transmitted via the data line 13 to the master device 6 in synchronization with the rising edge of the pulse of the first clock SCK1 continuously output from the master device 9. Is transmitted serially (at timings T24 to T2).
5). In the timing chart shown in FIG. 2, the data SD transmitted from the communication control circuit 100 to the master device 9
ATA (DB7, DB6, ..., DB0) is the MSB
The case of the first is shown.

【0029】尚、パルスエッジ検出回路1は、タイミン
グT24からT25に示した第1クロックSCK1のパ
ルスを入力しても1ショットパルスPを生成せず、所定
時間継続したレベルの変化を検出して1ショットパルス
Pを生成するものである。また、例えば、第1クロック
SCK1のレベルがLレベルからHレベルへ変化する場
合に、1ショットパルスPを生成するように構成しても
良い。
The pulse edge detection circuit 1 does not generate the one-shot pulse P even if the pulse of the first clock SCK1 shown at the timing T24 to T25 is input, and detects a level change that has continued for a predetermined time. A one-shot pulse P is generated. Further, for example, when the level of the first clock SCK1 changes from the L level to the H level, a one-shot pulse P may be generated.

【0030】以上説明したように、実施の形態1によれ
ば、パルスエッジ検出回路で検出した第1クロックSC
K1の立下がりエッジをもとに、1ショットパルスPを
生成し、生成した1ショットパルスPをもとにして、切
換えレジスタの設定値を書換え、切換えレジスタ内の設
定値に基づいて、セレクタが第1クロックラインと第2
クロックラインとのいずれかを選択し、選択したクロッ
クラインを介して順次供給されるクロックのパルスに同
期して、通信制御タイミング発生回路が、マスタデバイ
スとの間のデータ送受信を制御するように構成したの
で、割込み要求信号を発生し、割込み要求信号に基づい
て動作するCPUの介在無しに、通信制御回路内で自動
的にクロックを切換え、切換えたクロックのパルスに同
期して、データの送受信を効率良く実行することができ
るという効果がある。
As described above, according to the first embodiment, the first clock SC detected by the pulse edge detection circuit
A one-shot pulse P is generated based on the falling edge of K1, a set value of the switching register is rewritten based on the generated one-shot pulse P, and a selector is set based on the set value in the switching register. First clock line and second clock line
The communication control timing generation circuit controls the data transmission to and from the master device in synchronization with a clock pulse sequentially selected via the selected clock line. Therefore, an interrupt request signal is generated, the clock is automatically switched in the communication control circuit without the intervention of the CPU operating based on the interrupt request signal, and data transmission / reception is performed in synchronization with the switched clock pulse. There is an effect that execution can be performed efficiently.

【0031】実施の形態2.図3はこの発明の実施の形
態2による通信制御回路を示すブロック図であり、図に
おいて、1は第1クロックライン11上の第1クロック
SCK1の信号レベルの変化を検出し、検出した場合に
1ショットパルスを出力するパルスエッジ検出回路、1
4は第2クロックSCK2のパルスをカウントして、カ
ウント数が所定値に達したら制御信号を出力し、また、
パルスエッジ検出回路1から1ショットパルスが出力さ
れると、カウント数が初期値に設定されるカウンタ(カ
ウント手段)、15はカウンタ14から出力された制御
信号を入力するとオーバフロー信号ovを生成し出力す
るオーバフロー発生回路(カウント手段)である。
Embodiment 2 FIG. 3 is a block diagram showing a communication control circuit according to a second embodiment of the present invention. In the figure, reference numeral 1 denotes a signal level change of the first clock SCK1 on the first clock line 11, and A pulse edge detection circuit that outputs a one-shot pulse,
4 counts the pulses of the second clock SCK2, outputs a control signal when the counted number reaches a predetermined value, and
When a one-shot pulse is output from the pulse edge detection circuit 1, a counter (counting means) whose count number is set to an initial value, generates and outputs an overflow signal ov when a control signal output from the counter 14 is input. Overflow generating circuit (counting means).

【0032】21はオーバフロー発生回路15から出力
されたオーバフロー信号ovを入力すると、現在の設定
値を初期値に戻す切換えレジスタ(接続手段)である。
3は切換えレジスタ21内に設定された設定値に従っ
て、第1クロックライン11および第2クロックライン
12のいずれかを選択し接続するセレクタ(接続手段)
である。尚、初期状態では、切換えレジスタ21内に、
セレクタ3が第2クロックライン12を選択するための
設定値が初期値として設定されている。41はデータラ
イン13を介して、マスタデバイス9と通信制御回路2
00との間で、データをシリアルに送受信するためのタ
イミング制御を行う通信制御タイミング発生回路(制御
手段)である。
Reference numeral 21 denotes a switching register (connection means) for returning the current set value to an initial value when the overflow signal ov output from the overflow generating circuit 15 is input.
Reference numeral 3 denotes a selector (connection means) for selecting and connecting one of the first clock line 11 and the second clock line 12 according to the set value set in the switching register 21.
It is. In the initial state, the switching register 21 contains
A set value for the selector 3 to select the second clock line 12 is set as an initial value. Reference numeral 41 denotes the master device 9 and the communication control circuit 2 via the data line 13.
A communication control timing generation circuit (control means) for performing timing control for serially transmitting and receiving data to and from 00.

【0033】5は8ビットのデータを格納するデータシ
フトレジスタ、6はアドレス制御回路、7は内部アドレ
スバス、8は内部データバス、10はRAM等のメモ
リ、11はマスタデバイス9から第1クロックSCK1
を通信制御回路200へ供給するための第1クロックラ
イン、12はマスタデバイス9から第2クロックSCK
2を通信制御回路200へ供給するための第2クロック
ライン、13はデータSDATAをシリアルに送受信す
るために使用するデータラインである。
5 is a data shift register for storing 8-bit data, 6 is an address control circuit, 7 is an internal address bus, 8 is an internal data bus, 10 is a memory such as a RAM, and 11 is a first clock from the master device 9. SCK1
Is supplied to the communication control circuit 200 from the master device 9 and the second clock SCK
2 is a second clock line for supplying 2 to the communication control circuit 200, and 13 is a data line used for serially transmitting and receiving data SDATA.

【0034】図3に示す実施の形態2に係わる通信制御
回路200は、パルスエッジ検出回路1、カウンタ1
4、オーバフロー発生回路15、セレクタ3、切換えレ
ジスタ21、通信制御タイミング発生回路41、データ
シフトレジスタ5、アドレス制御回路6、内部アドレス
バス7、内部データバス8、およびメモリ10から構成
されている。
The communication control circuit 200 according to the second embodiment shown in FIG.
4, an overflow generating circuit 15, a selector 3, a switching register 21, a communication control timing generating circuit 41, a data shift register 5, an address control circuit 6, an internal address bus 7, an internal data bus 8, and a memory 10.

【0035】次に、動作について説明する。図4は、図
3に示した実施の形態2による通信制御回路200のク
ロック切換え動作を示すタイミングチャートである。
尚、以下の説明では、切換え対象となるクロックは、第
1クロックSCK1および第2クロックSCK2の2つ
であり、通信制御回路200とマスタデバイス9との間
で送受信されるデータは8ビット長である。
Next, the operation will be described. FIG. 4 is a timing chart showing a clock switching operation of communication control circuit 200 according to the second embodiment shown in FIG.
In the following description, two clocks to be switched are the first clock SCK1 and the second clock SCK2, and the data transmitted and received between the communication control circuit 200 and the master device 9 has an 8-bit length. is there.

【0036】先ず、初期状態では、切替えレジスタ21
内には、初期値としてLレベル値が設定されているの
で、セレクタ3により第2クロックライン12と通信制
御タイミング発生回路41とが接続されている。よっ
て、マスタデバイス9から通信制御タイミング発生回路
41へ、第2クロックライン12を介して第2クロック
SCK2のパルスが連続して供給されている。また、H
レベルに固定された第1クロックSCK1が、第1クロ
ックライン11を介してパルスエッジ検出回路1へ供給
されている。
First, in the initial state, the switching register 21
Since the L level value is set as an initial value in, the selector 3 connects the second clock line 12 and the communication control timing generation circuit 41. Therefore, the pulse of the second clock SCK2 is continuously supplied from the master device 9 to the communication control timing generation circuit 41 via the second clock line 12. Also, H
The first clock SCK1 fixed at the level is supplied to the pulse edge detection circuit 1 via the first clock line 11.

【0037】次に、アドレス制御回路6は、内部アドレ
スバス7を介して得られたアドレスをもとにデータシフ
トレジスタ5を選択する。そして、通信制御タイミング
発生回路41は、ダイレクトメモリアクセス機能を用い
て送信するための8ビットのデータSDATAをメモリ
10内から読み出し、データシフトレジスタ5内に格納
する。メモリ10から読み出した8ビットのデータSD
ATAは、図4のタイミングチャートに示すように、M
SBがDA7でありLSBがDA0である。そして、通
信制御タイミング発生回路41は、第2クロックSCK
2のパルスの立上がりに同期しながら、データライン1
3を介してマスタデバイス9へ、データシフトレジスタ
5内のデータSDATAをシリアルに送信する。
Next, the address control circuit 6 selects the data shift register 5 based on the address obtained via the internal address bus 7. Then, the communication control timing generation circuit 41 reads 8-bit data SDATA to be transmitted using the direct memory access function from the memory 10 and stores the data SDATA in the data shift register 5. 8-bit data SD read from the memory 10
As shown in the timing chart of FIG.
SB is DA7 and LSB is DA0. Then, the communication control timing generation circuit 41 outputs the second clock SCK.
Data line 1 is synchronized with the rising of pulse 2
The data SDATA in the data shift register 5 is serially transmitted to the master device 9 via the data transfer register 3.

【0038】次に、第2クロックSCK2から第1クロ
ックSCK1へのクロックの切換えを行う場合、マスタ
デバイス9は、第1クロックSCK1のレベルをHレベ
ルからLレベルに切換える。これにより、パルスエッジ
検出回路1は、第1クロックSCK1の立ち下がりエッ
ジを検出し(タイミングT41)、1ショットパルスP
を生成し、カウンタ14、切替えレジスタ21、および
通信制御タイミング発生回路41へ同時に出力する。
Next, when switching the clock from the second clock SCK2 to the first clock SCK1, the master device 9 switches the level of the first clock SCK1 from H level to L level. Thereby, the pulse edge detection circuit 1 detects the falling edge of the first clock SCK1 (timing T41), and the one-shot pulse P
And outputs it to the counter 14, the switching register 21, and the communication control timing generation circuit 41 at the same time.

【0039】切換えレジスタ21は、パルスエッジ検出
回路1から出力された1ショットパルスPを入力する
と、実施の形態1の通信制御回路100の場合と同様
に、切換えレジスタ21内の設定値を書換え、セレクタ
3へ制御信号を出力する。セレクタ3は、制御信号を入
力すると、第2クロックライン12から、第1クロック
ライン11へ自動的に接続を切換える。これにより、第
1クロックライン11と通信制御タイミング発生回路4
1とが接続され、マスタデバイス9との間で、第1クロ
ックSCK1のパルスに同期したシリアルデータSDA
TAの送受信が実行可能な状態となる。
Upon receiving the one-shot pulse P output from the pulse edge detection circuit 1, the switching register 21 rewrites the set value in the switching register 21, as in the case of the communication control circuit 100 of the first embodiment. A control signal is output to the selector 3. Upon input of the control signal, the selector 3 automatically switches the connection from the second clock line 12 to the first clock line 11. Thereby, the first clock line 11 and the communication control timing generation circuit 4
1 is connected to the master device 9 and the serial data SDA synchronized with the pulse of the first clock SCK1.
It becomes a state in which transmission and reception of TAs can be performed.

【0040】第1クロックSCK1のパルスに同期した
シリアルデータSDATAの送受信動作は、実施の形態
1の場合と同じなので、ここではその説明を省略する。
従って、通信制御回路200内で、第2クロックSCK
2から自動的に第1クロックSCK1に切換えてデータ
を送信する動作は、図4に示すタイミングチャートのタ
イミングT41〜T42の間で実行可能であるが、この
実施の形態2の説明では、第2クロックSCK2から第
1クロックSCK1に切換わった後に、第1クロックS
CK1のパルスが所定時間入力されない場合、自動的に
第2クロックSCK2へ切換わる動作を説明するため、
図4に示すタイミングT41〜T42の間では、第1ク
ロックSCK1のパルスやシリアル送信するデータSD
ATAを図示していない。
The transmission / reception operation of the serial data SDATA synchronized with the pulse of the first clock SCK1 is the same as that of the first embodiment, and the description is omitted here.
Therefore, in the communication control circuit 200, the second clock SCK
The operation of automatically switching from the second clock to the first clock SCK1 and transmitting data can be executed between timings T41 and T42 in the timing chart shown in FIG. 4, but in the description of the second embodiment, the second After switching from the clock SCK2 to the first clock SCK1, the first clock SCK1
To explain the operation of automatically switching to the second clock SCK2 when the pulse of CK1 is not input for a predetermined time,
Between the timings T41 to T42 shown in FIG. 4, the pulse of the first clock SCK1 or the data SD to be serially transmitted is transmitted.
The ATA is not shown.

【0041】カウンタ14へは、第1クロックSCK1
の立ち下がりエッジに伴なってパルスエッジ検出回路1
で生成され出力された1ショットパルスPを入力される
ので、カウント数が自動的に初期値に設定される(タイ
ミングT41)。その後、タイミングT41からタイミ
ングT42の間で、第2クロックSCK2のパルスの立
ち上がりエッジに同期して第2クロックSCK2をカウ
ントする(MM16,MM16-1,MM16-2,....,0
16,0116,0016)。図4のタイミングチャートに
示すように、タイミングT41の後では、パルスエッジ
検出回路1から1ショットパルスPがカウンタ14へ出
力されていないので、カウント数は初期化されない。従
って、カウント数は所定値に達し(タイミングT4
2)、カウンタ14は制御信号を生成しオーバフロー発
生回路15へ出力する。オーバフロー発生回路15は、
カウンタ14からの制御信号を入力すると、オーバフロ
ー信号ovを生成し、切換えレジスタ21へ出力する。
The first clock SCK1 is supplied to the counter 14.
Edge detection circuit 1 with falling edge of
Since the one-shot pulse P generated and output in is input, the count number is automatically set to the initial value (timing T41). Then, between the timing T41 of the timing T42, in synchronization with a rising edge of a pulse of the second clock SCK2 counts the second clock SCK2 (MM 16, MM 16-1, MM 16-2, ...., 0
2 16 , 01 16 , 00 16 ). As shown in the timing chart of FIG. 4, after the timing T41, since the one-shot pulse P is not output from the pulse edge detection circuit 1 to the counter 14, the count number is not initialized. Therefore, the count reaches a predetermined value (at timing T4).
2) The counter 14 generates a control signal and outputs it to the overflow generation circuit 15. The overflow generation circuit 15
When a control signal from the counter 14 is input, an overflow signal ov is generated and output to the switching register 21.

【0042】切換えレジスタ21は、オーバフロー信号
ovを入力すると初期値に設定値が戻される。即ち、オ
ーバフロー信号ovを入力すると、切換えレジスタ21
内の設定値がHレベル値からLレベル値へ設定され、こ
れにより、セレクタ3は第2クロックライン12を選択
して切換わり、マスタデバイス9は、第2クロックライ
ン12を介して、第2クロックSCK2を通信制御タイ
ミング発生回路41へ供給する。そして、通信制御タイ
ミング発生回路41は、第2クロックSCK2に基づい
たデータ送受信の実行可能な状態になる。
The switching register 21 returns the set value to the initial value when the overflow signal ov is input. That is, when the overflow signal ov is input, the switching register 21
Is set from the H level value to the L level value, whereby the selector 3 selects and switches the second clock line 12, and the master device 9 transmits the second clock line 12 via the second clock line 12. The clock SCK2 is supplied to the communication control timing generation circuit 41. Then, the communication control timing generation circuit 41 enters a state in which data transmission / reception based on the second clock SCK2 can be executed.

【0043】そして、通信制御タイミング発生回路41
が、RAM等のメモリ10からダイレクトメモリアクセ
ス機能を用いて、送信するためのデータSDATAを読
み出し、データシフトレジスタ5内へ格納する。そし
て、データシフトレジスタ5内に格納されたデータSD
ATAは、マスタデバイス9から連続して供給される第
2クロックSCK2のパルスの立上がりエッジに同期し
て、データライン13を介して、マスタデバイス9へシ
リアルに送信される(タイミングT43〜T44)。
尚、図4に示すタイミングチャートでは、通信制御回路
200からデータライン13を介してマスタデバイス9
へ送信されるシリアルデータSDATA(DB7,DB
6,...,DB0)は、MSBファーストの場合の例
を示している。
The communication control timing generation circuit 41
Reads data SDATA to be transmitted from a memory 10 such as a RAM using a direct memory access function, and stores the data SDATA in the data shift register 5. Then, the data SD stored in the data shift register 5
The ATA is serially transmitted to the master device 9 via the data line 13 in synchronization with the rising edge of the pulse of the second clock SCK2 continuously supplied from the master device 9 (timings T43 to T44).
In the timing chart shown in FIG. 4, the master device 9 is transmitted from the communication control circuit 200 via the data line 13.
Serial data SDATA (DB7, DB
6 ,. . . , DB0) show an example in the case of MSB first.

【0044】図5は、図3に示した通信制御回路200
の他の構成を示すブロック図であり、図において、51
は複数のクロックを入力し、例えば、第nクロックSC
Kn以外のクロックの立ち下がりエッジのレベル変化を
検出して、検出したクロックに対応した値をレジスタ内
に格納するパルスエッジ検出回路である。54はパルス
エッジ検出回路51内のレジスタに格納された値をデコ
ードし、デコード結果を出力するデコーダ、52はデコ
ーダ54から出力されたデコード結果に従って、クロッ
クラインを選択し切換えるための設定値を格納する切換
えレジスタ(接続手段)、53は切換えレジスタ52内
に設定された設定値に従って、複数のクロックラインの
いずれかを選択し、接続を切換えるセレクタ(接続手
段)、59はマスタデバイスである。
FIG. 5 shows the communication control circuit 200 shown in FIG.
FIG. 21 is a block diagram showing another configuration of the present invention.
Inputs a plurality of clocks, for example, an n-th clock SC
The pulse edge detection circuit detects a level change of a falling edge of a clock other than Kn and stores a value corresponding to the detected clock in a register. A decoder 54 decodes a value stored in a register in the pulse edge detection circuit 51 and outputs a decoding result. A decoder 52 stores a set value for selecting and switching a clock line in accordance with the decoding result output from the decoder 54. A switching register (connection means) 53 for selecting one of a plurality of clock lines according to the set value set in the switching register 52 and switching the connection (connection means), and 59 is a master device.

【0045】尚、図5に示す通信制御回路300の他の
構成要素は、図3に示した通信制御回路200のものと
同じなので、ここではそれらの説明を省略する。また、
図5に示す通信制御回路300において、第nクロック
ラインを介して入力される第nクロックSCKnは、図
3に示した通信制御回路200における第2クロックS
CK2に相当するものであり、他のクロックSCK(n
−1),...,SCK1と異なり、マスタデバイス5
9から通信制御回路300内のカウンタ14へ、常時連
続してパルスが供給されるクロックである。
The other components of the communication control circuit 300 shown in FIG. 5 are the same as those of the communication control circuit 200 shown in FIG. 3, so that the description thereof is omitted here. Also,
In the communication control circuit 300 shown in FIG. 5, the n-th clock SCKn input via the n-th clock line is the second clock SCK in the communication control circuit 200 shown in FIG.
CK2, and the other clock SCK (n
-1),. . . , SCK1, unlike the master device 5
9 is a clock in which pulses are always continuously supplied to the counter 14 in the communication control circuit 300.

【0046】また、デコーダ54から切替えレジスタ5
2へ出力されるデコード結果は、カウンタ14へも同時
に出力される。これにより、パルスエッジ検出回路51
が第nクロックSCKn以外のクロックのレベル変化を
検出した場合、図3に示した通信制御回路200の場合
と同様に、カウント数は初期化され初期値へ戻される。
また、図3に示した通信制御回路200の場合と同様
に、第nクロックSCKn以外のクロックのレベル変化
が所定時間無い場合で、第nクロックSCKnのパルス
をカウントして得られるカウント数が所定数に達する
と、カウンタ14から制御信号がオーバフロー発生回路
15へ出力される。
The switching register 5
The decoding result output to 2 is also output to the counter 14 at the same time. Thereby, the pulse edge detection circuit 51
Detects a change in the level of a clock other than the n-th clock SCKn, the count number is initialized and returned to the initial value, as in the case of the communication control circuit 200 shown in FIG.
Similarly to the case of the communication control circuit 200 shown in FIG. 3, when there is no change in the level of a clock other than the n-th clock SCKn for a predetermined time, the count number obtained by counting the pulses of the n-th clock SCKn is equal to a predetermined number. When the number is reached, a control signal is output from the counter 14 to the overflow generation circuit 15.

【0047】このオーバフロー発生回路15は、カウン
タ14から制御信号を入力すると、オーバフロー信号o
vを生成し、生成されたオーバフロー信号ovは、切換
えレジスタ52へ出力され、切換えレジスタ52の設定
値は初期値に設定される。これにより、セレクタ53
は、自動的に接続を第nクロックラインに切換えるの
で、第nクロックラインを介して供給される第nクロッ
クSCKnのパルスに同期して、通信制御タイミング発
生回路41は、マスタデバイス59との間のデータの送
受信を制御できる状態になる。このデータ送受信の動作
は、図1に示した通信制御回路100や図3に示した通
信制御回路200の場合と同じなので、説明を省略す
る。
The overflow generating circuit 15 receives a control signal from the counter 14 and outputs an overflow signal o.
v, and the generated overflow signal ov is output to the switching register 52, and the set value of the switching register 52 is set to the initial value. Thereby, the selector 53
Automatically switches the connection to the nth clock line, so that the communication control timing generation circuit 41 synchronizes with the master device 59 in synchronization with the pulse of the nth clock SCKn supplied via the nth clock line. It becomes possible to control the transmission and reception of the data. The operation of this data transmission / reception is the same as that of the communication control circuit 100 shown in FIG. 1 or the communication control circuit 200 shown in FIG.

【0048】以上説明したように、実施の形態2によれ
ば、パルスエッジ検出回路で検出した第1クロックSC
K1の立下がりエッジをもとに1ショットパルスPが生
成され、カウンタがカウント値を初期化し、1ショット
パルスPの入力がない状態でカウント数が所定値に達し
た場合、つまり、第1クロックSCK1が所定時間未使
用状態となった場合に、オーバフロー発生回路がオーバ
フロー信号ovを生成して切換えレジスタへ出力し、切
換えレジスタの設定値はオーバフロー信号ovを入力す
ると初期値へ戻り、セレクタの接続を自動的に第2クロ
ックラインへ接続するように構成したので、割込み要求
信号に基づいて動作するCPUの介在無しに、通信制御
回路内で自動的にクロックを選択し切換え、切換えたク
ロックに同期して、データを効率良く送受信することが
できるという効果がある。また、3以上の複数のクロッ
クラインを介して得られるクロックを切換える場合で
も、パルスエッジ検出回路内のレジスタに各クロックラ
インの状態を示す値を格納し、これをデコーダがデコー
ドし、デコード結果をもとにして切替えレジスタ内に設
定値を設定するように構成したので、CPUの介在無し
に、通信制御回路内で自動的にクロックを選択し切換え
ることができる。
As described above, according to the second embodiment, the first clock SC detected by the pulse edge detection circuit
When the one-shot pulse P is generated based on the falling edge of K1, the counter initializes the count value, and the count reaches a predetermined value without the input of the one-shot pulse P, that is, the first clock When the SCK1 is in the unused state for a predetermined time, the overflow generation circuit generates an overflow signal ov and outputs it to the switching register. Is automatically connected to the second clock line, so that the clock is automatically selected and switched in the communication control circuit without the intervention of the CPU operating based on the interrupt request signal, and the clock is synchronized with the switched clock. Thus, there is an effect that data can be transmitted and received efficiently. Also, when switching clocks obtained through three or more clock lines, a value indicating the state of each clock line is stored in a register in the pulse edge detection circuit, and this is decoded by a decoder, and the decoding result is obtained. Since the setting value is set in the switching register based on the above, the clock can be automatically selected and switched in the communication control circuit without the intervention of the CPU.

【0049】[0049]

【発明の効果】以上のように、この発明によれば、パル
スエッジ検出回路で検出したクロックの立下がりエッジ
をもとに、1ショットパルスを生成し、生成した1ショ
ットパルスをもとにして、接続手段である切換えレジス
タの設定値を書換え、切換えレジスタ内の設定値に基づ
いて、接続手段としてのセレクタがクロックラインを選
択し、選択したクロックラインを介して供給されるクロ
ックパルスに同期して、制御手段としての通信制御タイ
ミング発生回路が、外部装置であるマスタデバイスとの
間でデータを送受信するように構成したので、クロック
を切換える場合、割込み要求信号を発生してCPUへ送
信する必要もなく、割込み要求信号の発生に基づいて動
作するCPUの介在無しに、通信制御回路内で自動的に
クロックを切換え、切換えたクロックのパルスに同期し
て、外部装置との間のデータ送受信を効率良く実行する
ことができるという効果がある。
As described above, according to the present invention, one shot pulse is generated based on the falling edge of the clock detected by the pulse edge detection circuit, and the one shot pulse is generated based on the generated one shot pulse. The setting value of the switching register as the connecting means is rewritten, and the selector as the connecting means selects the clock line based on the setting value in the switching register, and synchronizes with the clock pulse supplied through the selected clock line. Since the communication control timing generation circuit as control means is configured to transmit and receive data to and from a master device as an external device, it is necessary to generate an interrupt request signal and transmit it to the CPU when switching clocks. No clock is automatically switched within the communication control circuit without the intervention of a CPU that operates based on the generation of an interrupt request signal In synchronization with the switching clock pulses, there is an effect that it is possible to perform efficiently the data transmission and reception between the external device.

【0050】この発明によれば、パルスエッジ検出回路
で検出したクロックの立下がりエッジをもとに1ショッ
トパルスを生成し、生成した1ショットパルスをもとに
して、カウント手段としてのカウンタがカウント値を初
期化し、1ショットパルスの入力がなくカウント数が所
定値に達した場合、つまり、クロックが所定期間未使用
状態となった場合に、カウント手段としてのオーバフロ
ー発生回路がオーバフロー信号を生成して切換手段とし
ての切換えレジスタへ出力し、切換えレジスタがオーバ
フロー信号を入力すると、接続手段としてのセレクタ
は、自動的に所定のクロックラインを接続するように構
成したので、割込み要求信号に基づいて動作するCPU
の介在無しに、通信制御回路内で自動的にクロックを選
択し切換え、切換えたクロックに同期して、データを効
率良く送受信することができるという効果がある。ま
た、複数のクロックラインを介して得られるクロックを
切換える場合でも、パルスエッジ検出回路内のレジスタ
に各クロックラインの状態を示す検出値を格納し、これ
をデコーダがデコードし、デコード結果をもとに切替え
レジスタ内に設定値を設定し、設定値をもとにセレクタ
がクロックラインを選択して切換えるように構成したの
で、CPUの介在無しに、通信制御回路内で自動的にク
ロックを選択し切換えることができる。
According to the present invention, a one-shot pulse is generated based on the falling edge of the clock detected by the pulse edge detection circuit, and the counter as counting means counts based on the generated one-shot pulse. When the count value reaches a predetermined value without input of a one-shot pulse, that is, when the clock is in an unused state for a predetermined period, an overflow generation circuit as a counting means generates an overflow signal. Output to a switching register as switching means, and when the switching register inputs an overflow signal, the selector as connecting means is configured to automatically connect a predetermined clock line, so that it operates based on an interrupt request signal. CPU
In this case, the clock can be automatically selected and switched in the communication control circuit without any intervention, and data can be transmitted and received efficiently in synchronization with the switched clock. Even when switching clocks obtained through a plurality of clock lines, a detection value indicating the state of each clock line is stored in a register in the pulse edge detection circuit, and this is decoded by a decoder, and based on the decoding result. Since the setting value is set in the switching register and the selector selects and switches the clock line based on the setting value, the clock is automatically selected in the communication control circuit without the intervention of the CPU. Can be switched.

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

【図1】 この発明の実施の形態1による通信制御回路
を示すブロック図である。
FIG. 1 is a block diagram showing a communication control circuit according to a first embodiment of the present invention.

【図2】 図1に示した通信制御回路のクロック切換え
動作を示すタイミングチャートである。
FIG. 2 is a timing chart showing a clock switching operation of the communication control circuit shown in FIG.

【図3】 この発明の実施の形態2による通信制御回路
を示すブロック図である。
FIG. 3 is a block diagram showing a communication control circuit according to a second embodiment of the present invention.

【図4】 図3に示した通信制御回路のクロック切換え
動作を示すタイミングチャートである。
FIG. 4 is a timing chart showing a clock switching operation of the communication control circuit shown in FIG. 3;

【図5】 図3に示した通信制御回路の他の構成を示す
ブロック図である。
FIG. 5 is a block diagram showing another configuration of the communication control circuit shown in FIG. 3;

【図6】 従来の通信制御回路を示すブロック図であ
る。
FIG. 6 is a block diagram showing a conventional communication control circuit.

【図7】 図6に示した従来の通信制御回路のクロック
切換え動作を示すタイミングチャートである。
7 is a timing chart showing a clock switching operation of the conventional communication control circuit shown in FIG.

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

1,51 パルスエッジ検出回路、2,21,52 切
換えレジスタ(接続手段)、3,53 セレクタ(接続
手段)、4,41 通信制御タイミング発生回路、5
データシフトレジスタ、6 アドレス制御回路、7 内
部アドレスバス、8 内部データバス、9,59 マス
タデバイス、10 メモリ、11 第1クロックライ
ン、12 第2クロックライン、13 データライン、
14 カウンタ(カウント手段)、15 オーバフロー
発生回路(カウント手段)、54デコーダ、100,2
00,300 通信制御回路。
1,51 pulse edge detection circuit, 2,21,52 switching register (connection means), 3,53 selector (connection means), 4,41 communication control timing generation circuit, 5
Data shift register, 6 address control circuit, 7 internal address bus, 8 internal data bus, 9, 59 master device, 10 memory, 11 first clock line, 12 second clock line, 13 data line,
14 counter (counting means), 15 overflow generating circuit (counting means), 54 decoder, 100, 2
00,300 Communication control circuit.

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5B077 FF11 GG05 GG32 MM02 5K047 AA02 GG03 GG24 MM12 MM56 ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5B077 FF11 GG05 GG32 MM02 5K047 AA02 GG03 GG24 MM12 MM56

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 第nクロックを供給する第nクロックラ
イン以外の複数のクロックを供給する複数のクロックラ
インに接続され、前記複数のクロックのレベルを検出
し、レベル変化を生じたクロックに対応した1ショット
パルスを生成し出力するパルスエッジ検出回路と、 初期状態では前記第nクロックラインと接続しており、
前記1ショットパルスを入力した場合、前記レベル変化
を生じたクロックに対応した前記クロックラインに接続
を切換える接続手段と、 初期状態では前記第nクロックのパルスに同期してデー
タの送受信を制御し、前記1ショットパルスを入力した
場合、前記接続手段で接続された前記クロックラインを
介して供給される前記クロックのパルスに同期して、デ
ータの送受信の制御を行う制御手段とを備えた通信制御
回路。
1. A circuit connected to a plurality of clock lines for supplying a plurality of clocks other than an n-th clock line for supplying an n-th clock, detecting levels of the plurality of clocks, and corresponding to a clock having a level change. A pulse edge detection circuit that generates and outputs a one-shot pulse, and is connected to the n-th clock line in an initial state;
Connection means for switching connection to the clock line corresponding to the clock having the level change when the one-shot pulse is input, and controlling transmission / reception of data in synchronization with the pulse of the n-th clock in an initial state; A communication control circuit for controlling data transmission and reception in synchronization with the clock pulse supplied via the clock line connected by the connection means when the one-shot pulse is input; .
【請求項2】 第nクロックラインを介して常に供給さ
れている第nクロックのパルスをカウントし、カウント
数が所定値に達したらオーバフロー信号を生成し出力
し、パルスエッジ検出回路から出力された1ショットパ
ルスを入力すると前記カウント数を初期値に設定するカ
ウント手段をさらに備え、 接続手段は、前記第nクロックライン以外のクロックラ
インを接続している状態で、前記カウント手段から出力
された前記オーバフロー信号を入力した場合、接続を前
記第nクロックラインに切換え、前記第nクロックを前
記制御手段へ供給することを特徴とする請求項1記載の
通信制御回路。
2. An n-th clock pulse, which is always supplied via an n-th clock line, is counted. When the count reaches a predetermined value, an overflow signal is generated and output, and the overflow signal is output from the pulse edge detection circuit. The apparatus further includes a count unit that sets the count number to an initial value when a one-shot pulse is input, and the connection unit outputs the count value output from the count unit in a state where a clock line other than the n-th clock line is connected. 2. The communication control circuit according to claim 1, wherein when an overflow signal is input, connection is switched to said n-th clock line, and said n-th clock is supplied to said control means.
【請求項3】 パルスエッジ検出回路はレジスタを備
え、第nクロック以外の複数のクロックのレベル変化に
対応した値を格納し、 前記レジスタ内に格納された値をデコードするデコーダ
をさらに備え、 接続手段は、前記デコーダから出力されるデコード結果
に従って、クロックラインの接続を切換えることを特徴
とする請求項1または請求項2記載の通信制御回路。
3. The pulse edge detection circuit includes a register, further includes a decoder that stores a value corresponding to a level change of a plurality of clocks other than the n-th clock, and decodes the value stored in the register. 3. The communication control circuit according to claim 1, wherein the means switches connection of the clock line according to a decoding result output from the decoder.
JP2000004854A 2000-01-13 2000-01-13 Communication control circuit Pending JP2001195356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000004854A JP2001195356A (en) 2000-01-13 2000-01-13 Communication control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000004854A JP2001195356A (en) 2000-01-13 2000-01-13 Communication control circuit

Publications (1)

Publication Number Publication Date
JP2001195356A true JP2001195356A (en) 2001-07-19

Family

ID=18533590

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000004854A Pending JP2001195356A (en) 2000-01-13 2000-01-13 Communication control circuit

Country Status (1)

Country Link
JP (1) JP2001195356A (en)

Similar Documents

Publication Publication Date Title
EP0135879B1 (en) Interface circuit and method for connecting a memory controller with a synchronous or an asynchronous bus system
JPH0784863A (en) Information processor and semiconductor storage device suitable to the same
US7757054B2 (en) Memory control system and memory data fetching method
US6791953B2 (en) Interface apparatus
JP2001117858A (en) Data processor
CN110008162B (en) Buffer interface circuit, and method and application for transmitting data based on buffer interface circuit
US7945718B2 (en) Microcontroller waveform generation
US6643749B2 (en) Interface for multi-processor
US8799699B2 (en) Data processing system
JP2001195356A (en) Communication control circuit
JP2006164070A (en) Data buffer circuit, interface circuit, and their control methods
KR100266963B1 (en) Method and apparatus for reducing latency rime on an interface by overlapping transmitted packets
KR100263670B1 (en) A dma controller
KR0169789B1 (en) Method and circuit for transmitting data of blocks
JPH02140852A (en) Dma transfer controller
JPH08161258A (en) Data processor
JP2005157929A (en) Semiconductor device
KR0154486B1 (en) The circuit for interfacing between the device and the peripheral-processor using high-speed parallel synchronous bus structure
CN115729863A (en) Data transmission method, device, electronic equipment and medium
JPH11250008A (en) Serial i/o circuit
JP2719227B2 (en) Processing equipment
JP2006164119A (en) Data processing unit
JPH0962562A (en) Processing circuit for memory
JPH05128279A (en) One-chip microcomputer
JPS61105150A (en) Information transfer circuit