JP2013008133A - Clock control circuit for microcomputer - Google Patents
Clock control circuit for microcomputer Download PDFInfo
- Publication number
- JP2013008133A JP2013008133A JP2011139381A JP2011139381A JP2013008133A JP 2013008133 A JP2013008133 A JP 2013008133A JP 2011139381 A JP2011139381 A JP 2011139381A JP 2011139381 A JP2011139381 A JP 2011139381A JP 2013008133 A JP2013008133 A JP 2013008133A
- Authority
- JP
- Japan
- Prior art keywords
- clock
- processor
- circuit
- frequency
- microcomputer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Abstract
Description
本発明は、プロセッサクロックを切替可能なマイコンのクロック制御回路に関する。 The present invention relates to a clock control circuit for a microcomputer capable of switching a processor clock.
流量、温度、圧力等を検出するフィールド機器は、現場や状況によって求められる精度等が異なっており、種々の製品が生産されている。種々の製品のそれぞれにおいて固有の設計を行っていてはコストが嵩むため、現在、製品間での共通化が促進されている。例えば、製品間でのマイコン(microcomputer)の共通利用が行われている。 Field devices that detect flow rate, temperature, pressure, and the like differ in accuracy required depending on the site and situation, and various products are produced. Since it is costly to carry out a unique design in each of various products, commonality among products is currently being promoted. For example, a microcomputer is commonly used among products.
フィールド機器は、プラントを監視するための計装機器でありランニングコストの低減のために、極めて省電力化されている。具体的には、内部の電力線と信号線とが一緒のような状態になっており、供給電力が限られている。したがって、実装されたマイコン等は少ない電力で動作する必要がある。 Field equipment is instrumentation equipment for monitoring a plant, and power consumption is extremely reduced in order to reduce running costs. Specifically, the internal power line and the signal line are in the same state, and the supply power is limited. Therefore, the mounted microcomputer or the like needs to operate with less power.
しかし、近年の技術発達に伴いフィールド機器にも様々な機能が要求されており、徐々に高機能化されてきている。この高機能化に伴い、マイコンのシステムクロックを切り替える構成が提案されている。かかる構成では、マイコンの外部回路に予め電力を蓄電しておき、プロセッサ過負荷時にはこの蓄電電力を利用してシステムクロックを上げて高速動作する(以下「ターボ動作」と称する)。外部回路の蓄電電力が減少したり、プロセッサ負荷が軽減されたりした場合には、システムクロックを下げて低速動作する。これにより、少ない電力を有効に利用して動作可能となっている。 However, with the recent technological development, field devices are also required to have various functions and gradually become more sophisticated. Along with this higher functionality, a configuration for switching the system clock of a microcomputer has been proposed. In such a configuration, power is stored in advance in an external circuit of the microcomputer, and when the processor is overloaded, this stored power is used to raise the system clock and operate at high speed (hereinafter referred to as “turbo operation”). When the power stored in the external circuit decreases or the processor load is reduced, the system clock is lowered to operate at low speed. Thereby, it can operate | move using little electric power effectively.
特許文献1には、マイコンのシステムクロックを切り替えることで、これに同期する計時用タイマに基づいて動作する制御用ソフトウェアの制御周期やタイミングがずれてしまうことから、システムクロックの切替を制限する技術について記載されている。詳細には特許文献1では、低速動作から高速動作への切替については、通常、制御に支障を来たすことがないため制限せず、高速動作から低速動作への切替についてはシステムクロックを停止するスリープ状態への移行時のみに制限するとしている。 Patent Document 1 discloses a technique for restricting switching of a system clock because a control cycle and timing of control software that operates based on a timer for time synchronization synchronized with the system clock of the microcomputer is shifted by switching the system clock of the microcomputer. Is described. Specifically, in Patent Document 1, switching from low-speed operation to high-speed operation is not limited because it usually does not interfere with control, and switching from high-speed operation to low-speed operation is a sleep that stops the system clock. It is said that it is restricted only at the time of transition to the state.
特許文献1の技術は、計時用タイマに基づいて動作する制御用ソフトウェアの制御周期やタイミングのずれを防ぐ技術である。したがって、システムクロックの切替に伴い、マイコンに実装されたハードウェアにて生じる不具合については一切触れられていない。なお、特許文献1の技術では、高速動作から低速動作への切替についてはシステムクロックを停止するスリープ状態への移行時のみとし、これ以外の状況下ではシステムクロックの周波数を下げないとしているが、供給電力が限られているフィールド機器においてこのような制御をすることは電力不足を誘発する原因となる。 The technique of Patent Document 1 is a technique for preventing a shift in control cycle and timing of control software that operates based on a timer for timekeeping. Therefore, no mention is made of any problems that occur in the hardware mounted on the microcomputer as the system clock is switched. In the technique of Patent Document 1, the switching from the high speed operation to the low speed operation is performed only at the time of transition to the sleep state in which the system clock is stopped. Under other circumstances, the frequency of the system clock is not decreased. Such control in a field device with limited power supply causes a power shortage.
システムクロックを切り替えることでプロセッサクロック、周辺クロック、通信クロック等の周波数を上げる場合、周辺回路の動作周波数が許容範囲を外れてしまったり、外部との通信速度がインターフェースにより規定されている通信I/F回路の通信動作が切断されてしまったりして、実行中の動作を正常に継続させることができなくなるおそれがある。このような場合、低速動作から高速動作への切替において(周波数を上げることによって)も、実行中の動作を正常に継続させることができなくなるおそれがある。 When the frequency of the processor clock, peripheral clock, communication clock, etc. is increased by switching the system clock, the operating frequency of the peripheral circuit falls outside the allowable range, or the communication I / O whose communication speed with the outside is specified by the interface There is a possibility that the communication operation of the F circuit may be disconnected, and the operation being executed cannot be continued normally. In such a case, even during switching from the low speed operation to the high speed operation (by increasing the frequency), there is a possibility that the operation being executed cannot be continued normally.
本発明は、このような課題に鑑みてなされたものであり、プロセッサクロックの切替によって不具合が生じることを防いで、実行中の動作を正常に継続させることが可能なマイコンのクロック制御回路を提供することを目的とする。 The present invention has been made in view of such a problem, and provides a clock control circuit for a microcomputer that can prevent a problem from being caused by switching of a processor clock and can continue an operation being executed normally. The purpose is to do.
上記課題を解決するために、本発明の代表的な構成は、プロセッサのプロセッサクロックを変更可能なマイコンのクロック制御回路において、入力クロックを分周または逓倍してプロセッサクロックを生成する分周器または逓倍器と、プロセッサクロックと他の回路のクロックとの同期タイミングを検出して、分周器または逓倍器に対し分周比または逓倍比の変更を指示する変更イネーブル信号を出力する変更イネーブル回路と、を備えることを特徴とする。 In order to solve the above-described problem, a typical configuration of the present invention includes a frequency divider that generates a processor clock by dividing or multiplying an input clock in a clock control circuit of a microcomputer that can change a processor clock of a processor. A change enable circuit that detects a synchronization timing of the multiplier and a clock of another circuit and outputs a change enable signal that instructs the divider or the multiplier to change the division ratio or the multiplication ratio; It is characterized by providing.
上記構成によれば、プロセッサクロックの周波数の切替はプロセッサクロックを生成する分周器の分周比(または逓倍器の逓倍比)の変更によって行われるが、この変更はプロセッサクロックと他の回路のクロックとの同期タイミングを検出して変更イネーブル信号が出力されることにより実施される。そのため、プロセッサクロックと他の回路のクロックとの同期関係を維持したまま、プロセッサクロックの周波数を上げることも、下げることも可能となる。したがって、プロセッサクロックの周波数の切替によって不具合が生じることを防いで、実行中の動作を正常に継続させることが可能となる。 According to the above configuration, the switching of the frequency of the processor clock is performed by changing the division ratio of the frequency divider that generates the processor clock (or the multiplication ratio of the multiplier). This change is performed between the processor clock and other circuits. This is implemented by detecting the synchronization timing with the clock and outputting the change enable signal. Therefore, it is possible to increase or decrease the frequency of the processor clock while maintaining the synchronous relationship between the processor clock and the clocks of other circuits. Therefore, it is possible to prevent a problem from occurring due to switching of the frequency of the processor clock and to continue the operation being executed normally.
上記課題を解決するために、本発明の他の代表的な構成は、プロセッサのプロセッサクロックを変更可能なマイコンのクロック制御回路において、入力クロックを分周または逓倍してプロセッサクロックを生成し、且つプロセッサクロックより前にクロック予告信号を出力する分周器と、入力クロックを分周または逓倍して他の回路のクロックを生成し、且つ他の回路のクロックより前にクロック予告信号を出力する分周器または逓倍器と、それぞれのクロック予告信号に基づいてプロセッサクロックと他の回路のクロックとの同期タイミングを検知し、それぞれの分周器または逓倍器に対し分周比または逓倍比の変更を指示する変更イネーブル信号を出力する変更イネーブル回路と、を備えることを特徴とする。 In order to solve the above problems, another typical configuration of the present invention is to generate a processor clock by dividing or multiplying an input clock in a microcomputer clock control circuit capable of changing a processor clock of a processor, and A divider that outputs a clock warning signal before the processor clock, a clock that generates a clock for another circuit by dividing or multiplying the input clock, and a clock warning signal that is output before the clock for the other circuit The synchronization timing of the processor clock and the clocks of other circuits is detected based on the clock notice signal of the frequency divider or multiplier, and the division ratio or multiplication ratio is changed for each frequency divider or multiplier. A change enable circuit for outputting a change enable signal to be instructed.
上記構成によれば、クロック予告信号により、プロセッサクロックと他の回路のクロックとの直後の同期タイミングが変更イネーブル回路にて予め検知され、変更イネーブル信号が出力される。これにより、プロセッサクロックの周波数が高く、同期タイミングを検出してから変更イネーブル信号を出力したのでは分周比の変更が間に合わない場合にも対応可能となる。 According to the above configuration, the change enable circuit detects in advance the synchronization timing immediately after the processor clock and the clock of another circuit based on the clock notice signal, and the change enable signal is output. As a result, it is possible to cope with the case where the frequency of the processor clock is high and the change of the division ratio is not in time when the change enable signal is output after detecting the synchronization timing.
上記課題を解決するために、本発明の他の代表的な構成は、プロセッサのプロセッサクロックを変更可能なマイコンのクロック制御回路において、入力クロックを分周または逓倍してプロセッサクロックを生成する分周器または逓倍器と、入力クロックを分周または逓倍して他の回路のクロックを生成し、且つ他の回路のクロックより前にクロック予告信号を出力する分周器または逓倍器と、クロック予告信号に基づいてプロセッサクロックのタイミングをずらし、他の回路のクロックとの同期関係を維持する同期化回路と、を備えることを特徴とする。 In order to solve the above-described problem, another typical configuration of the present invention is a frequency division for generating a processor clock by dividing or multiplying an input clock in a microcomputer clock control circuit capable of changing a processor clock of a processor. A frequency divider or a multiplier, a frequency divider or a multiplier for generating a clock of another circuit by dividing or multiplying an input clock, and outputting a clock warning signal before the clock of the other circuit, and a clock warning signal And a synchronization circuit that shifts the timing of the processor clock based on the above and maintains the synchronization relationship with the clocks of other circuits.
上記構成によれば、プロセッサクロックと他の回路のクロックとの同期関係を維持するように、同期化回路がクロック予告信号に基づいてプロセッサクロックのタイミングを調整する。そのため、プロセッサクロックの切替に際し、プロセッサクロックを生成する分周器の分周比(または逓倍器の逓倍比)の変更を他の回路のクロックとの同期タイミングまで待つことなく、即座に反映可能となる。 According to the above configuration, the synchronization circuit adjusts the timing of the processor clock based on the clock notice signal so that the synchronization relationship between the processor clock and the clocks of other circuits is maintained. Therefore, when changing the processor clock, it is possible to immediately reflect the change in the division ratio of the divider that generates the processor clock (or the multiplication ratio of the multiplier) without waiting until the timing of synchronization with the clock of another circuit. Become.
上記他の回路のクロックが、上記プロセッサに連携する周辺回路の周辺クロックまたは外部機器と通信を行う通信I/F回路の通信クロックであって、上記他の回路のクロックを生成する分周器または逓倍器の分周比または逓倍比が動作中に変更されないと好ましい。 The clock of the other circuit is a peripheral clock of a peripheral circuit cooperating with the processor or a communication clock of a communication I / F circuit that communicates with an external device, and a frequency divider that generates a clock of the other circuit or It is preferred that the divider ratio or multiplier ratio of the multiplier is not changed during operation.
上記構成によれば、周辺回路や通信I/F回路に一定のクロックが供給されるため、周辺回路の動作周波数が許容範囲を外れてしまったり、外部との通信速度が規定される通信I/F回路の通信動作が切断されてしまったりするのを回避できる。すなわち、実行中の周辺回路の処理動作、通信I/F回路の通信動作を正常に継続させることが可能となる。 According to the above configuration, since a constant clock is supplied to the peripheral circuit and the communication I / F circuit, the operation frequency of the peripheral circuit is out of the allowable range, or the communication I / O in which the communication speed with the outside is regulated. It is possible to avoid disconnecting the communication operation of the F circuit. That is, the processing operation of the peripheral circuit being executed and the communication operation of the communication I / F circuit can be normally continued.
本発明によれば、プロセッサクロックの切替によって不具合が生じることを防いで、実行中の動作を正常に継続させることが可能なマイコンのクロック制御回路を提供可能である。 According to the present invention, it is possible to provide a clock control circuit for a microcomputer that can prevent a problem caused by switching of processor clocks and can normally continue an operation being executed.
以下に添付図面を参照しながら、本発明の好適な実施形態について詳細に説明する。かかる実施形態に示す寸法、材料、その他具体的な数値などは、発明の理解を容易とするための例示に過ぎず、特に断る場合を除き、本発明を限定するものではない。なお、本明細書および図面において、実質的に同一の機能、構成を有する要素については、同一の符号を付することにより重複説明を省略し、また本発明に直接関係のない要素は図示を省略する。 Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. The dimensions, materials, and other specific numerical values shown in the embodiments are merely examples for facilitating understanding of the invention, and do not limit the present invention unless otherwise specified. In the present specification and drawings, elements having substantially the same function and configuration are denoted by the same reference numerals, and redundant description is omitted, and elements not directly related to the present invention are not illustrated. To do.
[第1実施形態]
図1は、本発明の第1実施形態にかかるマイコンのクロック制御回路(以下「クロック制御回路110」と称する)の概略構成を示すブロック図である。図1に示すように、第1実施形態では、マイコン100が、プロセッサ102、周辺回路104、通信I/F回路106、バス108、クロック制御回路110を含んで構成される。クロック制御回路110は、逓倍器112、分周器114、116、118、変更イネーブルレジスタ120、変更イネーブル回路122、クロック設定レジスタ124を備える。マイコン100は、例えばフィールド機器に利用される。
[First embodiment]
FIG. 1 is a block diagram showing a schematic configuration of a clock control circuit (hereinafter referred to as “
プロセッサ102、周辺回路104、通信I/F回路106、変更イネーブルレジスタ120、クロック設定レジスタ124は、バス108を介してそれぞれ接続される。プロセッサ102は、ソフトウェアを動作させるためのハードウェアであり主体的に演算処理を実施する。周辺回路104は、プロセッサ102に連携して所定の処理動作を実施するハードウェアであり、各種コントローラやROM、RAM等である。通信I/F回路106は、通信バス126を介して、外部機器と通信を行う。
The
逓倍器112は、外部クロック128を逓倍して、分周器114、116、118に入力される入力クロックとしてのPLLクロック130を生成する。分周器114は、PLLクロック130を分周して、プロセッサ102に供給するプロセッサクロック132を生成する。分周器116は、周辺回路104に供給する周辺クロック134(他の回路のクロック)を生成する。分周器118は、通信I/F回路106に供給する通信クロック136(他の回路のクロック)を生成する。PLLクロック130、プロセッサクロック132、周辺クロック134、通信クロック136は、変更イネーブル回路122に対しても供給される。
The
クロック設定レジスタ124には、逓倍器112の逓倍比およびそれぞれの分周器114、116、118の分周比が設定される。クロック設定レジスタ124は、設定された逓倍比を逓倍比設定信号142として、設定されたそれぞれの分周比を分周比設定信号144、146、148として、逓倍器112、それぞれの分周器114、116、118に出力する。
In the
クロック制御回路110では、クロック設定レジスタ124に新たな分周比が設定されても、即座に分周器114、116、118にその新たな分周比が反映されることはない。分周器114、116、118の分周比の変更は、所定の手順を経て実行される。所定の手順とは、下記1)から4)までの手順である。
In the
1)プロセッサ102がクロック設定レジスタ124に新たな分周比を設定するのに伴い、その新たな分周比の設定有効を示すデータを変更イネーブルレジスタ120に書込。2)変更イネーブルレジスタ120が変更イネーブル回路122に分周比変更要求信号138を出力。3)分周比変更要求信号138を検知した変更イネーブル回路122が、プロセッサクロック132、周辺クロック134、通信クロック136の有効エッジの同期タイミングを検出して、分周器114、116、118に分周比の変更を指示する変更イネーブル信号140を出力。4)分周器114、116、118が変更イネーブル信号140を検知して、クロック設定レジスタ124から出力される分周比設定信号144、146、148が指示する分周比に変更。
1) As the
以下、具体例を挙げて、クロック制御回路110の動作について説明する。図2は、クロック制御回路110のターボ動作切替時のタイミングチャートである。図3は、クロック制御回路110の低速動作切替時のタイミングチャートである。図2では、模式的に、プロセッサクロック132を生成する分周器114の分周比を4(4分周)、周辺クロック134を生成する分周器116の分周比を8(8分周)、通信クロック136を生成する分周器118の分周比を16(16分周)とし、ターボ動作への切替としてプロセッサクロック132を生成する分周器114の分周比を2(2分周)に変更する場合について図示する。図3では、ターボ動作からプロセッサクロック132の周波数を下げて再度元の状態に戻す(分周器114の分周比を4(4分周)にする)低速動作への切替について図示する。
Hereinafter, the operation of the
図2に示すように、システム動作開始後、プロセッサ102が過負荷状態となりターボ動作が必要な状態に陥ると、プロセッサ102はバス108経由でクロック設定レジスタ124に分周器114の新たな分周比として2(2分周)を設定する。クロック設定レジスタ124に設定された新たな分周比の2は、分周比設定信号144として分周器114に出力される。
As shown in FIG. 2, after the system operation starts, when the
プロセッサ102は、クロック設定レジスタ124から出力される分周比設定値144を有効にするために、設定有効を示すデータを変更イネーブルレジスタ120に書き込む。変更イネーブルレジスタ120は、その設定有効を示すデータの書込を受けて、分周比変更要求信号138を変更イネーブル回路122に出力し、分周比の変更要求が発生したことを変更イネーブル回路122に伝達する。
The
変更イネーブル回路122は分周比変更要求信号138を検知すると、PLLクロック130に同期してプロセッサクロック132、周辺クロック134、通信クロック136の全てが立ち上がるタイミング(同期タイミング)を検出する。そして、この同期タイミングの検出に伴い、分周器114、116、118に分周比の変更を指示する変更イネーブル信号140を出力する。ここでは、PLLクロック130の1サイクル分、変更イネーブル信号140を出力する。変更イネーブル信号140は変更イネーブルレジスタ120にも供給され、これが検知されることで分周比変更要求信号138が停止される。
When the change enable
分周器114、116、118では変更イネーブル信号140を検知すると、クロック設定レジスタ124から出力される分周比設定信号144、146、148が指示する分周比への変更を行う。これより、プロセッサクロック132を生成する分周器114の分周比が2に切り替えられ、ターボ動作によりプロセッサ102の処理能力が向上する。
When the
なお、プロセッサクロック132は演算処理を主体的に担うプロセッサ102に供給されるものであり、その最大周波数は周辺クロック134の周波数よりも高く設定される。また、プロセッサ102に連携する周辺回路104の周辺クロック134の周波数は、通信クロック136の周波数よりも高く設定される。ターボ動作時のプロセッサクロック132の周波数は、切替後においても他の回路のクロック(周辺クロック134、通信クロック136)との同期関係を維持できるように設定される。
Note that the
図3に示すように、ターボ動作への切替後、プロセッサ102がターボ動作が不要であることを検出すると、プロセッサクロック132の周波数を低下させるために、プロセッサ102がバス108経由でクロック設定レジスタ124に分周器114の分周比として再び4(4分周)を設定する。クロック設定レジスタ124に設定された分周比の4は、分周比設定信号144として分周器114に出力される。
As shown in FIG. 3, after switching to turbo operation, when the
プロセッサ102は、クロック設定レジスタ124から出力される分周比設定値144を有効にするために、設定有効を示すデータを変更イネーブルレジスタ120に書き込む。変更イネーブルレジスタ120は、その設定有効を示すデータの書込を受けて、分周比変更要求信号138を変更イネーブル回路122に出力し、分周比の変更要求が発生したことを変更イネーブル回路122に伝達する。
The
変更イネーブル回路122は分周比変更要求信号138を検知すると、PLLクロック130に同期してプロセッサクロック132、周辺クロック134、通信クロック136の全てが立ち上がるタイミング(同期タイミング)を検出する。そして、この同期タイミングの検出に伴い、分周器114、116、118に分周比の変更を指示する変更イネーブル信号140を出力する。
When the change enable
分周器114、116、118では変更イネーブル信号140を検知すると、クロック設定レジスタ124から出力される分周比設定信号144、146、148が指示する分周比への変更を行う。これより、プロセッサクロック132を生成する分周器114の分周比が再び4に切り替えられ、プロセッサクロック132の周波数が下げられる。プロセッサクロック132の周波数を下げることで、電力消費やマイコン100の発熱を抑えることができる。
When the
なお、ここではターボ動作から再び分周比を4に戻す場合について説明したが、これに限らずプロセッサクロックの周波数をさらに下げることも可能である。この場合においても、切替後も他の回路のクロック(周辺クロック134、通信クロック136)との同期関係を維持できるように、プロセッサクロック132の周波数を設定する。例えば、プロセッサクロック132の分周器114の分周比を8にしてよい。
Although the case where the frequency division ratio is returned to 4 again from the turbo operation has been described here, the present invention is not limited to this, and the frequency of the processor clock can be further reduced. Even in this case, the frequency of the
上述した構成によれば、周辺回路104の周辺クロック134、通信I/F回路106の通信クロック136の周波数を変更せずに、プロセッサクロック132の周波数を上げたり、下げたりすることが可能である。周辺回路104や通信I/F回路106は、その動作実行中(処理動作中、通信動作中)に周波数が変更されると、その動作を正常に継続させることができなくなるおそれがある。例えば、通信I/F回路106の通信速度が9600bpsと設定されその通信速度で通信動作を実行している状態にて通信クロック136を上げると、外部機器との同期関係が崩れその通信動作を正常に継続させることができなくなるおそれがある。
According to the configuration described above, the frequency of the
ここでは、他の回路(周辺回路104、通信I/F回路106)の周波数の切替を伴わず、プロセッサクロック132の周波数を切り替えるため、その実行中の動作を正常に継続させることができる。プロセッサクロック132の周波数の切替は、変更イネーブル回路122が周辺クロック134と通信クロック136との同期タイミングを検出することで実施されるため、プロセッサクロック132の切替後においても、プロセッサクロック132と、周辺クロック134と、通信クロック136との同期関係を維持することが可能である。したがって、プロセッサ102から他の回路(周辺回路104、通信I/F回路106)へのアクセス中にプロセッサクロック132の切替が発生しても、その動作を正常に継続させることが可能である。
Here, since the frequency of the
なお、クロック制御回路110では、分周器116、118の分周比の変更を要しないわけではない。分周器116、118の分周比の変更を可能とすることで、マイコン100の対応できる幅が広がるため、製品間での共通利用を促進することができる。
In the
(比較例)
図8は、本発明に対する比較例としてのマイコンのクロック制御回路(以下「クロック制御回路410」と称する)の概略構成を示すブロック図である。図8に示すように、本比較例では、マイコン400が、プロセッサ102、周辺回路104、通信I/F回路106、バス108、クロック制御回路410を含んで構成される。クロック制御回路410は、逓倍器112、分周器414、クロック設定レジスタ124を備える。
(Comparative example)
FIG. 8 is a block diagram showing a schematic configuration of a clock control circuit (hereinafter referred to as “
比較例のクロック制御回路410では、逓倍器112が外部クロック128を逓倍して、PLLクロック130を生成する。分周器414は、PLLクロックを分周して、システムクロック430aを生成する。システムクロック430aから、プロセッサクロック432、周辺クロック434、通信クロック436が生成され、それぞれ、プロセッサ102、周辺回路104、通信I/F回路106に供給される。なお、逓倍器112の逓倍比、分周器414の分周比は、クロック設定レジスタ124から発せられる逓倍比設定信号142、分周比設定信号444が指示する値に設定される。
In the
比較例のクロック制御回路410では、システム動作開始後、プロセッサ102が過負荷状態となりターボ動作が必要な状態に陥ると、プロセッサ102はバス108経由でクロック設定レジスタ124に逓倍器112の新たな逓倍比、分周器114の新たな分周比を設定する。クロック設定レジスタ124に設定された新たな逓倍比、新たな分周比は逓倍比設定信号142、分周比設定信号444として、逓倍器112、分周器414にそれぞれ出力され、反映される。これにより、システムクロック430aが高速に切り替えられ、プロセッサクロック432、周辺クロック434、通信クロック436の周波数が上げられる。
In the
なお、ターボ動作切替後、プロセッサ102がターボ動作が不要であることを検出すると、上記と同様の手順でシステムクロック430aが低速に切り替えられ、プロセッサクロック432、周辺クロック434、通信クロック436の周波数が下げられる。
If the
上述した比較例では、システムクロック430aの切替に伴い、周辺回路104や通信I/F回路106のクロック周波数も切り替えられる。そのため、周辺回路104や通信I/F回路106は、その実行中の動作を正常に継続させることができなくなるおそれがある。これに対し、第1実施形態にかかるクロック制御回路110によれば、プロセッサクロックの切替によって不具合が生じることを防いで、実行中の動作を正常に継続させることが可能である。
In the comparative example described above, the clock frequency of the
(応用例)
第1実施形態にかかるクロック制御回路110の応用例としては、他の回路(周辺回路104、通信I/F回路106)のアイドル状態が検出できていることを条件に、他の回路との同期タイミングを待たず、分周比変更要求信号138が出力されたタイミングで全分周器114、116、118同時に分周比を変更してもよい。これにより、各クロック間の同期関係を維持し、不具合を生じさせることなくプロセッサクロックを迅速に切り替えることが可能である。
(Application examples)
As an application example of the
[第2実施形態]
図4は、本発明の第2実施形態にかかるマイコンのクロック制御回路(以下「クロック制御回路210」と称する)の概略構成を示すブロック図である。図4に示すように、第2実施形態では、マイコン200におけるクロック制御回路210が、プロセッサクロック132を生成する分周器114、周辺クロック134を生成する分周器116、通信クロック136を生成する分周器118を備える。
[Second Embodiment]
FIG. 4 is a block diagram showing a schematic configuration of a clock control circuit (hereinafter referred to as “
分周器114はプロセッサクロック132より前にクロック予告信号254を出力し、分周器116は周辺クロック134より前にクロック予告信号256を出力し、分周器118は通信クロック136より前にクロック予告信号258を出力する。変更イネーブル回路222は、このクロック予告信号254、256、258に基づきプロセッサクロック132、周辺クロック134、通信クロック136の同期タイミングを検知し、それぞれの分周器114、116、118に対し変更イネーブル信号140を出力する。
The
図5は、クロック制御回路210のターボ動作切替時のタイミングチャートである。図5に示すように、第2実施形態では、変更イネーブル回路222がクロック予告信号254、256、258により、プロセッサクロック132、周辺クロック134、通信クロック136の直後の同期タイミングを予め検知することで、変更イネーブル信号140が第1実施形態よりも早期に出力される。そのため、プロセッサクロック132の周波数が高く、同期タイミングを検出してから変更イネーブル信号140を出力したのでは分周比の変更が間に合わない場合にも対応可能である。
FIG. 5 is a timing chart when the
なお、フィールド機器のように供給電力が限られている場合には、変更イネーブルレジスタ120が分周比変更要求信号138を出力している場合のみ、クロック予告信号254、256、258を出力するように構成するとよい。これにより、常時クロック予告信号254、256、258を出力する必要がないので、省電力化を図ることができる。
When the power supply is limited as in a field device, the clock notice signals 254, 256, and 258 are output only when the change enable
[第3実施形態]
図6は、本発明の第3実施形態にかかるマイコンのクロック制御回路(以下「クロック制御回路310」と称する)の概略構成を示すブロック図を示す図である。図6に示すように、第3実施形態ではマイコン300におけるクロック制御回路310が同期化回路322を備える点で上記第2実施形態と異なる。以下、この同期化回路322の働きについて説明する。なお、第2実施形態と実質的に同一の機能、構成を有する要素については、同一の符号を付することにより重複説明を省略する。
[Third embodiment]
FIG. 6 is a block diagram showing a schematic configuration of a clock control circuit (hereinafter referred to as “
図7は、クロック制御回路310のターボ動作切替時のタイミングチャートである。図7に示すように、第3実施形態では、クロック設定レジスタ124から分周比設定信号144として分周器114の新たな分周比が出力されると、その新たな分周比が即座に反映される。周辺クロック134、通信クロック136との同期タイミングを待たずして分周器114の分周比が反映されるため、すぐにプロセッサ102の処理能力を高めることができる。しかしながら、そのままではプロセッサクロック132と、周辺クロック134、通信クロック136との同期関係が維持されなくなるため、データの取りこぼしが生じてしまったり、正常な動作の継続が難しくなってしまったりするおそれがある。
FIG. 7 is a timing chart when the
そこで同期化回路322は、周辺クロック134、通信クロック136が同期するタイミングで、プロセッサクロック132も同期してクロックを出すように調整する。ただし、単に他の回路との同期タイミングにあわせてプロセッサクロック132を出力すると、直前の立ち上がり(パルス)との間隔が、その時点でのプロセッサクロック132の周期以下になるため、瞬間的に高い周波数でプロセッサ102を動作させることになる。この高い周波数がプロセッサ102の動作可能周波数の範囲を超えると、プロセッサ102がハングアップしたり、リセットがかかったり、誤動作したりするおそれがある。
Therefore, the
そこで同期化回路322は、他の回路(周辺クロック134、通信クロック136)のクロック予告信号256、258に基づいて、他の回路のクロックが同期するタイミングが到来することを検知したときには、その同期タイミングの直前のプロセッサクロック132の出力を間引いて、待ち構えて、同期タイミングでクロックを出すように処理をする。図7では、同期化回路322が同期タイミング直前のプロセッサクロック132の立ち上がり(パルス)を停止して、周辺クロック134、通信クロック136との同期タイミングに合わせている。
Therefore, when the
これにより、プロセッサ102の動作周波数が異常に高くなってしまうことを防止しつつ、同期タイミングでプロセッサクロック132を出力することができる。したがって、プロセッサ102を安全に動作継続させることができる。なお、上記の動作を実現するためには、他の回路のクロック予告信号256、258を、プロセッサクロック132の1クロック分より前に出力する必要がある。
As a result, the
すなわち第3実施形態の構成によれば、プロセッサクロック132の分周比を変更する要求を即座に反映して高い処理能力を得ると共に、プロセッサ102の動作を正常に継続させつつ他の回路との同期を取ることができる。
That is, according to the configuration of the third embodiment, a request to change the division ratio of the
以上、添付図面を参照しながら本発明の好適な実施形態について説明したが、本発明はかかる例に限定されないことは言うまでもない。当業者であれば、特許請求の範囲に記載された範疇内において、各種の変更例または修正例に想到し得ることは明らかであり、それらについても当然に本発明の技術的範囲に属するものと了解される。 As mentioned above, although preferred embodiment of this invention was described referring an accompanying drawing, it cannot be overemphasized that this invention is not limited to this example. It will be apparent to those skilled in the art that various changes and modifications can be made within the scope of the claims, and these are naturally within the technical scope of the present invention. Understood.
例えば、本実施形態ではプロセッサクロック132を生成する分周器114、116、118の分周比を変更する構成について説明したが、分周器に代えて逓倍器の逓倍比を変更する構成としてもよいし、分周器と逓倍器を組み合わせて任意の倍率のクロックを生成する構成としてもよい。
For example, in the present embodiment, the configuration in which the frequency division ratios of the
本発明は、プロセッサクロックを切替可能なマイコンのクロック制御回路に利用することができる。 The present invention can be used for a clock control circuit of a microcomputer that can switch a processor clock.
100、200、300…マイコン、102…プロセッサ、104…周辺回路、106…通信I/F回路、108…バス、110、210、310…クロック制御回路、112…逓倍器、114、116、118…分周器、120…変更イネーブルレジスタ、122、222…変更イネーブル回路、124…クロック設定レジスタ、126…通信バス、128…外部クロック、130…PLLクロック(入力クロック)、132…プロセッサクロック、134…周辺クロック、136…通信クロック、138…分周比変更要求信号、140…変更イネーブル信号、142…逓倍比設定信号、144、146、148…分周比設定信号、254、256、258…クロック予告信号、322…同期化回路
DESCRIPTION OF
Claims (4)
入力クロックを分周または逓倍して、前記プロセッサクロックを生成する分周器または逓倍器と、
前記プロセッサクロックと他の回路のクロックとの同期タイミングを検出して、前記分周器または逓倍器に対し分周比または逓倍比の変更を指示する変更イネーブル信号を出力する変更イネーブル回路と、
を備えることを特徴とするマイコンのクロック制御回路。 In the microcomputer clock control circuit that can change the processor clock of the processor,
A frequency divider or multiplier for dividing or multiplying an input clock to generate the processor clock; and
A change enable circuit that detects a synchronization timing of the processor clock and a clock of another circuit and outputs a change enable signal that instructs the frequency divider or multiplier to change the division ratio or the multiplication ratio;
A microcomputer clock control circuit comprising:
入力クロックを分周または逓倍して前記プロセッサクロックを生成し、且つ該プロセッサクロックより前にクロック予告信号を出力する分周器または逓倍器と、
入力クロックを分周または逓倍して他の回路のクロックを生成し、且つ該他の回路のクロックより前にクロック予告信号を出力する分周器または逓倍器と、
それぞれの前記クロック予告信号に基づいて前記プロセッサクロックと前記他の回路のクロックとの同期タイミングを検知し、それぞれの前記分周器または逓倍器に対し分周比または逓倍比の変更を指示する変更イネーブル信号を出力する変更イネーブル回路と、
を備えることを特徴とするマイコンのクロック制御回路。 In the microcomputer clock control circuit that can change the processor clock of the processor,
A frequency divider or a multiplier for dividing or multiplying an input clock to generate the processor clock and outputting a clock warning signal before the processor clock;
A frequency divider or a multiplier for dividing or multiplying an input clock to generate a clock for another circuit and outputting a clock warning signal before the clock for the other circuit;
A change that detects the synchronization timing of the processor clock and the clock of the other circuit based on the clock notice signal and instructs the frequency divider or multiplier to change the division ratio or the multiplication ratio. A change enable circuit for outputting an enable signal;
A microcomputer clock control circuit comprising:
入力クロックを分周または逓倍して前記プロセッサクロックを生成する分周器または逓倍器と、
入力クロックを分周または逓倍して他の回路のクロックを生成し、且つ該他の回路のクロックより前にクロック予告信号を出力する分周器または逓倍器と、
前記クロック予告信号に基づいて前記プロセッサクロックのタイミングをずらし、前記他の回路のクロックとの同期関係を維持する同期化回路と、
を備えることを特徴とするマイコンのクロック制御回路。 In the microcomputer clock control circuit that can change the processor clock of the processor,
A divider or multiplier for dividing or multiplying an input clock to generate the processor clock;
A frequency divider or a multiplier for dividing or multiplying an input clock to generate a clock for another circuit and outputting a clock warning signal before the clock for the other circuit;
A synchronization circuit that shifts the timing of the processor clock based on the clock notice signal and maintains a synchronous relationship with the clock of the other circuit;
A microcomputer clock control circuit comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011139381A JP2013008133A (en) | 2011-06-23 | 2011-06-23 | Clock control circuit for microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011139381A JP2013008133A (en) | 2011-06-23 | 2011-06-23 | Clock control circuit for microcomputer |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013008133A true JP2013008133A (en) | 2013-01-10 |
Family
ID=47675448
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011139381A Withdrawn JP2013008133A (en) | 2011-06-23 | 2011-06-23 | Clock control circuit for microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013008133A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016062355A (en) * | 2014-09-18 | 2016-04-25 | キヤノン株式会社 | Semiconductor integrated circuit, device having the same, method of controlling clocks in semiconductor integrated circuit, and program |
-
2011
- 2011-06-23 JP JP2011139381A patent/JP2013008133A/en not_active Withdrawn
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016062355A (en) * | 2014-09-18 | 2016-04-25 | キヤノン株式会社 | Semiconductor integrated circuit, device having the same, method of controlling clocks in semiconductor integrated circuit, and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6600345B1 (en) | Glitch free clock select switch | |
KR100379766B1 (en) | Pll system clock generator with instantaneous clock frequency shifting | |
US5790609A (en) | Apparatus for cleanly switching between various clock sources in a data processing system | |
EP0840195B1 (en) | An apparatus and method for sequencing clocks in a data processing system | |
JPH04113718A (en) | Hitless clock switching device | |
US6819150B1 (en) | Method and apparatus for quick clock swapping using much slower asynchronous clock for power savings | |
US10296065B2 (en) | Clock management using full handshaking | |
WO2001033342A1 (en) | Digital signal processing circuit and method | |
CN117075683A (en) | Clock gating component, multiplexer component and frequency dividing component | |
JP4136822B2 (en) | Semiconductor integrated circuit device, clock control method, and data transfer control method | |
JP2014090344A (en) | Clock signal initialization circuit and method | |
CN102751982B (en) | Clock selection circuit suitable for backboard spending treatment of communication equipment | |
JP2013008133A (en) | Clock control circuit for microcomputer | |
JPWO2012081196A1 (en) | Signal selection circuit and signal selection method | |
JP2019028651A (en) | Synchronous reset circuit and control method thereof | |
JPH11308102A (en) | Phase locked loop | |
US10712767B2 (en) | Clock generator and clock generation method | |
JP2006065471A (en) | Semiconductor integrated circuit, and its power saving control method and power saving control program | |
JP2008041106A (en) | Semiconductor integrated circuit device, clock control method and data transfer control method | |
JP2005115944A (en) | Synchronization system and synchronization method of multiple variable-frequency clock generators | |
JP3148445B2 (en) | Multiplexer circuit | |
US9477256B2 (en) | Electronic circuit with a sleep mode and a bypass connection for conveying a slow clock signal | |
CN207867388U (en) | A kind of clock circuit for detecting for microcontroller chip | |
JP2011223179A (en) | Clock generation circuit and control method of the same | |
JP6410538B2 (en) | Semiconductor integrated circuit, device including semiconductor integrated circuit, clock control method in semiconductor integrated circuit, and program. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20140902 |