JP2004265021A - Controller and electronic apparatus provided with the same - Google Patents

Controller and electronic apparatus provided with the same Download PDF

Info

Publication number
JP2004265021A
JP2004265021A JP2003053336A JP2003053336A JP2004265021A JP 2004265021 A JP2004265021 A JP 2004265021A JP 2003053336 A JP2003053336 A JP 2003053336A JP 2003053336 A JP2003053336 A JP 2003053336A JP 2004265021 A JP2004265021 A JP 2004265021A
Authority
JP
Japan
Prior art keywords
processing
delay
cpu
control device
predetermined
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2003053336A
Other languages
Japanese (ja)
Inventor
Ikuo Shimazaki
育男 嶋▲崎▼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP2003053336A priority Critical patent/JP2004265021A/en
Priority to US10/773,238 priority patent/US20040190904A1/en
Publication of JP2004265021A publication Critical patent/JP2004265021A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Power Sources (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To obtain a controller which can meet even the replacement of a CPU or a substrate having the CPU mounted thereon by a simple constitution and achieves power saving. <P>SOLUTION: Since it is necessary for a CPU to acquire a processing result after the end of processing in a processing part in order to obtain an accurate processing result from the processing part, a counter part 22 is provided which measures a processing time required for the fixed number of times of delay processing in the CPU 2. A processing speed ratio calculation part 23 is provided which compares the processing time measured by the counter part 22 with a prescribed reference time. A delay value change part 12 is provided which changes the number of times of delay processing (delay value) to be performed by the CPU 2, on the basis of a result obtained by the processing speed ratio calculation part 23. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、電子機器等に備えられる制御装置に関する。より詳しくは、制御装置内の演算処理装置における演算の遅延処理の制御に関する。
【0002】
【従来の技術】
通常、様々な電子機器は、機器の内部に制御装置を備えている。そして、この制御装置により、様々な処理が実行されている。また、この制御装置には、一般に、中央演算装置(以下、CPUと称する)が備えられている。
【0003】
ここで、上記処理の一例として、電子機器のバッテリ残量を図る処理について、図7および図8を基に説明する。図7は、バッテリ残量を検知するバッテリ残量検知回路を示した回路図である。また、図8は、バッテリ残量を検知する際のフローチャートである。
【0004】
バッテリ残量検知回路は、図7に示すとおり、第1レジスタ51、バッテリ回路52、基準電圧発生回路53、比較器54、および、第2レジスタ55を備えている。上記第1レジスタ51は、CPUからの命令を受け、バッテリ回路52にバッテリ電圧の検出を行なうように指令を出すものである。上記バッテリ回路52は、電子機器のバッテリ電圧を測定する回路である。
【0005】
また、上記基準電圧発生回路53は、所定の電圧を発生する回路である。上記比較器54は、上記バッテリ回路52で検出されたバッテリ電圧と、上記基準電圧発生回路53で発生させた所定の電圧とを比較するものである。そして、この比較器54は、比較結果を第2レジスタ55に送信する。さらに、第2レジスタ55に格納された比較結果は、上記CPUが第2レジスタ55にアクセスすることにより読み出される。
【0006】
ここで、上記CPUが第1レジスタ51に命令を出した後、第2レジスタ55から比較結果を読み出すことが可能となるまでには、上記バッテリ残量検知回路での処理に時間を要するため、所定の時間を必要とする。つまり、上記CPUが第1レジスタ51に指令を出した時間と、CPUが第2レジスタ55から上記比較結果を得ることができる時間との間には、時間差が生じる。この時間差のことを、以下では、ディレイ時間(遅延時間)と称する。
【0007】
次に、上記バッテリ残量検知時のフローについて、図8に基づいて説明する。
【0008】
まず、CPUが上記第1レジスタ51に対して、残量検知の指示を出す(S11)。具体的には、例えば、第1レジスタ51に「1」という信号を送る。そして、S11の後は、バッテリ残量検知処理が開始される(S12)。
【0009】
上記S12でバッテリ残量検知処理が開始された後は、CPUは、第2レジスタ55に上記比較結果が格納されるまでディレイ処理を繰返す(S13)。ここで、ディレイ処理とは、例えばCPUにダミーのプログラム(以下、ディレイ処理プログラムと称する)を実行させ、CPUによる所定の演算処理を遅らせる処理を指す。言い換えれば、第2レジスタ55に格納された比較結果に対する、CPUのアクセスのタイミングを遅らせる処理である。
【0010】
このように、ディレイ処理を行なう理由は、CPUが第1レジスタ51に指令を出した後、即座に第2レジスタ55にアクセスすると、アクセスした時点では、まだ比較結果が第2レジスタ55に格納されていないため、正確なバッテリ残量が検知できないからである。また、1回のディレイ処理に要する時間は、上記ダミープログラム等に応じて決まる時間である。
【0011】
したがって、CPUが正確な比較結果を第2レジスタ55から得るためには、少なくとも、上記バッテリ検知時のディレイ時間にわたり、上記ディレイ処理を繰返して行なう必要がある。
【0012】
そこで、上記S13の後は、上記ディレイ処理が所定の回数(N回)だけ実行されたか否かを判断する(S14)。なお、この所定の回数(N回)は、予め、処理内容に応じて決められた既定値である。つまり、バッテリ残量検知処理では、少なくともN回ディレイ処理を行なえば、第2レジスタ55で正確な比較結果が得られるものと事前に判断し、その結果設定された値である。また、上記所定の回数(N回)をディレイ値と称する。
【0013】
もし、S14において、上記ディレイ処理がN回実行されていなければ、S13に戻り、ディレイ処理を繰返す。一方、上記ディレイ処理がN回実行されていれば、CPUは、第2レジスタ55から比較結果を読み出した後、演算処理を行なう。これにより、一連の処理が終了する。
【0014】
以上のように、バッテリ残量検知を行なう際には、所定の回数(N回)ディレイ処理を行った後、CPUによる第2レジスタ55からの比較結果の読み出しが行なわれている。
【0015】
上記においては、バッテリ残量検知の処理について説明したが、いわゆるスリープモード等の省エネモードから通常モードへの復帰処理についても同様である。以下、図9に基づいて、上記復帰処理について説明する。なお、図9は、省エネモードから通常モードへの復帰処理を説明するフローチャートである。
【0016】
上記のような省エネモード時には、例えば、メモリ電源等がオフ状態とされている(S21)。そして、S21の後、通常モードへ復帰指示の有無が判断される(S22)。通常モードの復帰指示は、例えば、電子機器に備えられた何れかのボタンを押すこと等により行なわれる。
【0017】
S22において、通常モードへの復帰指示が有る場合には、メモリ電源がオンとなり、メモリの初期化が開始される(S23)。一方、通常モードへの復帰指示が無い場合には、再度S22に戻り、復帰指示を待つ。上記S23の後は、CPUがディレイ処理を行なう(S24)。このディレイ処理は、上述したバッテリ残量検知におけるディレイ処理と同じ処理である。
【0018】
上記S24の後は、上記ディレイ処理が所定の回数(M回)だけ実行されたか否かを判断する(S25)。なお、この所定の回数(M回)は、予め、処理内容に応じて決められた既定値である。つまり、メモリの初期化処理では、少なくともM回ディレイ処理を行なえば、メモリの初期化が完了するものと事前に判断し、その結果設定された値である。また、上記所定の回数(M回)についても、ディレイ値と称する。
【0019】
もし、S25において、上記ディレイ処理がM回実行されていなければ、S24に戻り、ディレイ処理を繰返す。一方、上記ディレイ処理がM回実行されていれば、CPUはメモリへのアクセスを開始し、通常モードでの動作が行なわれる(S26)。
【0020】
以上のように、省エネモードから通常モードへの切り換えを行なう際には、所定の回数(M回)ディレイ処理を行ない、CPUによるメモリへのアクセスが行なわれる。
【0021】
ここで、上記のようなバッテリ残量検出処理や、省エネモードからの復帰処理等の様々な処理を行なう電子機器において、CPUやこのCPUが装着される基板等を、例えば、より処理速度の早いものに取り換えた場合、以下のような問題が生じる。
【0022】
つまり、上記図8や図9で示した処理では、CPUがディレイ処理をN回またはM回行ない、所定の時間だけ所望とする処理を遅らせているが、例えばCPUを高速のCPUにグレードアップさせた場合、上記ディレイ処理をN回またはM回行なっても、正確なバッテリ残量についての比較結果の取得や、メモリの初期化が完了した状態でのメモリへのアクセスが出来ないという問題が生じる。
【0023】
これは、高速なCPUを用いて上記ディレイ処理を行っているため、N回またはM回のディレイ処理を行っても、上記所定のディレイ時間が経過する前に、CPUの比較結果の取得等が開始してしまうためである。
【0024】
また、CPUのクロック数が、例えば2倍となっても処理速度は2倍とならないため、単純に、ディレイ値を2倍としても正確な結果は得られない。
【0025】
このため、従来では、CPU等の交換に伴い、ディレイ処理プログラムを変更するために、このプログラムが格納されたROM自体を新規なROMに交換して対応していた。
【0026】
一方、近年では、上記ROM等の交換をしなくても済むような制御装置が開発されている。例えば、特開平1−152554号公報には、ハードウェアを新たに設け、プログラムの変更なしにCPUのアクセスタイミングの調整を行える制御装置が開示されている。この制御装置によれば、CPUが上記第2レジスタ55から比較結果を取得する際におけるアクセスのタイミングや、メモリにアクセスするタイミング等を調整することができる。
【0027】
【特許文献1】
特開平1−152554号公報(公開日:平成1年6月15日)
【0028】
【発明が解決しようとする課題】
しかしながら、上記公報記載の制御装置では、上述したような、複数の異なるディレイ処理を行う必要がある場合、それぞれの処理に対して、ディレイ処理回路を設ける必要が有る。つまり、上記バッテリ残量検知処理や、省エネモードからの復帰処理というディレイ時間の異なる処理がある場合、これらの処理に対応した別個のディレイ処理回路を設けなければならない。
【0029】
したがって、制御装置の大型化や、制御装置のコストアップにつながってしまうという問題が生じる。
【0030】
また、上記公報記載の制御装置では、上記ディレイ処理回路をリアルタイムに動作させる必要がある。つまり、様々な処理に際して、CPUのアクセスタイミングを、常時ディレイ処理回路で計算する必要がある。このため、電力を消費することとなり、上記制御装置では、省エネルギーの達成は難しい。
【0031】
本発明は上記の問題点に鑑みなされたものであって、その目的は、CPU等を交換した場合であっても、簡易な構成で上記交換に対応でき、かつ、省エネルギーを達成できる制御装置、および、この制御装置を備えた電子機器を提供することにある。
【0032】
【課題を解決するための手段】
本発明の制御装置は、上記の課題を解決するため、デジタルデータを演算処理する演算手段を備え、前記演算手段が所定の遅延処理を所定の回数行なって、一定の時間、前記演算手段による所定の演算処理を遅延させる制御装置において、前記演算手段による一定回数の遅延処理に要する処理時間を測定する測定手段と、前記測定手段で測定した処理時間と、前記所定の基準時間とを比較する比較手段と、前記比較手段で得られた結果を基に、前記演算手段が行なう遅延処理の処理回数を変更する変更手段とを備えていることを特徴としている。
【0033】
上記の構成の制御装置や、この制御装置を備えた機器(以下、制御装置等と称する)では、これら制御装置等で行なわれる処理(以下、所定の処理と称する)に関し、演算手段が所定の処理開始の指令を出した後、制御装置等の各部が上記所定の処理を実行する。そして、上記所定の処理が終了した後に、演算手段は、処理結果を取得し、所定の演算処理を行っている。
【0034】
つまり、上記制御装置等では、上記所定の処理が終了するまでには所定の時間を要するため、演算手段は、処理開始の指令から所定の時間経過した後に、初めて処理結果を取得して所定の演算処理を行なう構成となっている。
【0035】
そして、所定の時間経過後に処理結果を取得するために、上記制御装置では、演算手段が処理開始の指令を出した後、演算手段が所定の遅延処理を所定の回数実行している。
【0036】
ここで、例えば制御装置等における処理の高速化を図るため、演算手段やこの演算手段を搭載した基板(以下、演算手段等と称する)を、新たな演算手段等に交換した場合、同一の所定の処理に関して同じ回数だけ遅延処理を行なうと以下の問題が生じる。つまり、演算手段等の処理速度が向上するため、制御装置等で行なわれる処理が終了する前に、演算手段が処理結果を取得してしまう。このため、正確な処理結果が得られなくなる。
【0037】
しかしながら、本発明の構成では、まず、測定手段により、一定回数の遅延処理に要する処理時間が測定される。これにより、演算手段等を交換した場合における、一定回数の遅延処理に要する処理時間が測定できる。
【0038】
また、比較手段により、上記測定手段で測定された処理時間と、所定の基準時間、例えば、演算手段等を交換する前における、前記演算手段等が前記所定回数の遅延処理に要する処理時間とが比較できる。これにより、演算手段等を交換する前後における処理速度が比較できる。
【0039】
そして、変更手段により、前記比較手段で得られた結果を基に、前記所定の遅延処理の回数を変更できる。これにより、演算手段等の処理速度が速くなった分、遅延処理の処理回数を増やすことができる。したがって、演算手段が、演算手段等の交換前と同じ時間経過後(つまり、所定の時間経過後)に、処理結果を取得することができる。それゆえ、上記制御装置では、演算手段が正確な処理結果を取得可能となる。
【0040】
また、上記制御装置等で行なわれる所定の処理が、異なる複数の処理である場合であっても、上記制御装置では、演算手段等を交換した場合、上記異なる複数の処理に関し、それぞれに遅延処理の処理回数の変更が行なえる。このため、上記制御装置では、例えば、異なる複数の処理に応じて、それぞれに遅延回路が設けられている構成の装置と比較すると、装置の構成を小さくできる。
【0041】
また、上述したように、遅延処理の処理回数を変更すれば済むため、演算手段の交換の都度、遅延処理のプログラムが記憶されたROM等を交換するといった作業を行なう必要もない。
【0042】
また、後述するように、前記演算手段等が交換された場合に、前記処理時間を測定するような構成にすれば、電力消費を抑制することもできる。
【0043】
しがって、演算手段等を交換した場合であっても、簡易な構成で上記演算手段等の交換に対応でき、かつ、省エネルギーを達成できる制御装置を提供することが可能となる。
【0044】
また、本発明の制御装置は、上記の制御装置において、前記比較手段での比較は、前記測定手段で測定した処理時間と、所定の基準時間との比率を求めることで行なわれることを特徴としている。
【0045】
上記の構成によれば、比較手段では、前記測定手段で測定した処理時間と、所定の基準時間との比率が求められる。これにより、演算手段等を交換した場合において、交換後の演算手段が一定回数の遅延処理に要する処理時間と、基準時間との比率がわかる。
【0046】
したがって、演算手段等を交換する前後における処理速度が比較できる。これにより、演算手段等の交換後における遅延処理の処理回数を決定することができる。
【0047】
また、本発明の制御装置は、上記の制御装置において、前記測定手段は、前記演算手段が新たな演算手段に交換された場合に、処理時間を測定することを特徴としている。
【0048】
上記の構成によれば、前記測定手段は、前記演算手段が新たな演算手段に交換された場合に、処理時間を測定する。
【0049】
したがって、演算手段が交換された場合にのみ測定を行なえばよいため、電力消費を抑制することができる。
【0050】
また、本発明の制御装置は、上記の制御装置において、前記所定の基準時間は、前記演算手段が前記一定回数の遅延処理に要する処理時間であることを特徴としている。
【0051】
上記の構成によれば、演算手段等が交換された場合、比較手段は、交換後に測定手段で測定された処理時間と、交換前の演算手段が一定回数の遅延処理に要した処理時間とを比較することになる。
【0052】
したがって、交換前の遅延処理の回数を基準として、交換後の遅延処理の回数を決定することができる。
【0053】
また、本発明の制御装置は、上記の制御装置において、前記演算手段が行なう所定の遅延処理の回数は、演算手段が行なう所定の演算処理毎に設定されていることを特徴としている。
【0054】
上記の構成によれば、前記演算手段が行なう所定の遅延処理の回数は、演算手段が行なう所定の演算処理毎に設定される。
【0055】
したがって、遅延させる時間が互いに異なる演算処理が行なわれる場合でも、演算手段等の交換後、それぞれの演算処理に応じて遅延処理の回数を変更することができる。
【0056】
また、本発明の制御装置は、上記の制御装置において、前記一定回数は、一回であることを特徴としている。
【0057】
上記の構成によれば、測定手段は、一回の遅延処理に要する処理時間を測定する。
【0058】
したがって、測定手段において測定に要する時間を短縮することが可能となる。
【0059】
本発明の電子機器は、上記の課題を解決するため、上記制御装置を備えていることを特徴としている。
【0060】
上記の構成によれば、演算手段等を交換した場合であっても、簡易な構成で上記演算手段等の交換に対応でき、かつ、省エネルギーを達成できる制御装置を備えた電子機器を提供することが可能となる。
【0061】
【発明の実施の形態】
本発明の実施の一形態について、図1ないし図6に基づいて説明すれば、以下のとおりである。
【0062】
図2は、本実施の形態に係る制御装置の概略構成を示したブロック図である。制御装置1は、CPU(演算手段)2、システムコントローラ3、フラッシュROM4、メモリ5、省エネルギー回路6、電源7、バッテリ残量検知回路8、EEPROM(electrically erasable/programmable read only memory)9、基準クロック発生部10、処理速度比較部11、および、ディレイ値変更部(変更手段)12を備えている。
【0063】
この制御装置1は、様々な電子機器に搭載される装置であって、電子機器の動作を制御するものである。
【0064】
上記CPU2は、デジタルデータを演算処理するものである。より詳しくは、制御装置で行なわれる様々な処理の演算を行なう中央演算処理部である。上記システムコントローラ3は、制御装置1のシステムを制御するための制御器である。フラッシュROM4は、バッテリ残量検出処理のプログラムや、省エネモードから通常モードへの復帰処理のプログラム等が記憶された記憶装置である。なお、上記バッテリ残量検出処理や、省エネモードから通常モードへの復帰処理は、一部の処理を除き、従来の技術における図8および図9で説明した処理と基本的に同じ処理である。また、従来の処理との相違点については、後述する。さらに、このフラッシュROM4に格納されているプログラム等についても、後述する。
【0065】
上記省エネルギー回路6は、いわゆるスリープモードのような省エネモードと、通常モードとを切り換える回路である。例えば、この制御装置1に対して何らかの信号が一定時間入力されない場合、制御装置1を備えた電子機器を、通常の待機状態よりも電力消費を抑えた待機状態に導く回路である。この省エネルギー回路6により、従来の技術で述べた、省エネモードから通常モードへの復帰処理がなされる。
【0066】
また、上記省エネルギー回路6は、通常モードから省エネルギーモードに切換る際に上記メモリ5の電源をオフとし、省エネルギーモードから通常モードに切換る際に上記メモリ5の電源をオンとする。さらに、上記省エネルギー回路6は、上記省エネルギーモードから通常モードへの切り換えの際に、上記フラッシュROM4に格納された復帰処理用のプログラム(以下、省エネ復帰処理プログラムと称する)を実行する。
【0067】
上記電源7は、制御装置1内における、CPU2、システムコントローラ3、省エネルギー回路6、バッテリ残量検知回路8、基準クロック発生部10、処理速度比較部11、および、ディレイ値変更部に電源を供給する。
【0068】
上記バッテリ残量検知回路8は、従来の技術における図7で示した回路と同一の回路である。このバッテリ残量検知回路8は、バッテリ残量検出の際に、上記フラッシュROM4に格納された残量検知用のプログラム(以下、バッテリ残量検知プログラムと称する)を実行する。
【0069】
上記基準クロック発生部10は、一定のクロック数を有する基準クロックを発生させ、上記処理速度比較部11に対して、この基準クロックを送信する。
【0070】
上記処理速度比較部11は、CPU2が交換された際に、これらCPU2等に対応した上記ディレイ値(つまり、N回、M回等で表される上記所定の回数)を求めるために、CPU2を交換する前と後との速度を比較するものである。この処理速度比較部11の詳細については、後述する。
【0071】
また、上記ディレイ値変更部12は、上記処理速度比較部11で得られた結果を基に、フラッシュROM4に格納されたディレイ処理プログラムのディレイ値を変更するものである。なお、上記ディレイ処理プログラムについては、後述する。
【0072】
次に、上記フラッシュROM4に格納されているプログラムについて説明する。図3は、上記フラッシュROM4に格納されているプログラムを示した説明図である。
【0073】
このフラッシュROM4には、少なくとも、基本プログラム、バッテリ残量検知プログラム、省エネ復帰プログラム、第1ディレイ処理プログラム、第2ディレイ処理プログラム、および、プログラム更新用プログラムが格納されている。
【0074】
上記基本プログラムは、電子機器が、通常処理を行う際に用いられるプログラムである。具体例を挙げると、電子機器であるコピー機が、コピー動作を行うための処理内容が記述されたプログラムである。
【0075】
また、上記バッテリ残量検知プログラムは、バッテリ残量検知回路8を用いてバッテリの残量検知を行なうためのプログラムである。さらに、上記省エネ復帰プログラムは、省エネモードから通常モードに復帰する際に用いられるプログラムである。
【0076】
また、上記第1ディレイ処理プログラムと第2ディレイ処理プログラムとは、それぞれ、CPUの所定の演算処理を一定時間遅延させるために用いられるダミーのプログラムである。ここで、説明の便宜上、上記第1ディレイ処理プログラムは、バッテリ残量検知処理および省エネ復帰処理において用いられるプログラムとする。また、上記第1ディレイ処理プログラムおよび第2ディレイ処理プログラムには、それぞれに、ディレイ値が設定されている。さらに、CPU2が、上記第1ディレイ処理プログラム、または、第2ディレイ処理プログラムを実行する処理を、所定の遅延処理と称する。
【0077】
また、プログラム更新用プログラムは、上記第1および第2ディレイ処理プログラム中に記述されているディレイ値を変更するためのプログラムである。つまり、例えばバッテリ残量検知時においては、CPU2が行なうディレイ処理(遅延処理)の回数(N回)(ディレイ値)を変更するためのプログラムである。また、後述するディレイ値変更部12により、実行されるプログラムである。
【0078】
次に、上記処理速度比較部11で行なわれる処理について、図1に基づいて説明する。なお、図1は、主として、上記処理速度比較部11の概略構成を示したブロック図である。
【0079】
上記処理速度比較部11は、コントロールレジスタ部21、カウンタ部(測定手段)22、および、処理速度比率演算部(比較手段)23とを備えている。上記コントロールレジスタ部21は、まず、CPU2からの指令を受ける。このCPU2からの指令の内容としては、この処理速度比較部11における処理の開始(スタート)、処理の中止(ストップ)、および、コントロールレジスタ部21に格納された比較結果の削除(クリア)等である。
【0080】
また、上記制御装置1では、CPU2を新たなものに交換した場合に、処理速度比較部11における処理が開始される。
【0081】
上記コントロールレジスタ部21には、初期設定の段階では、予め所定の基準カウンタ値が記憶されている。この基準カウンタ値は、CPU2が交換される前の段階では、既に搭載されているCPU2がディレイ処理プログラムを一回実行した場合のカウンタ値である。なお、上述したディレイ値は、上記カウンタ値と上記ディレイ時間(遅延時間)とから決定されている。
【0082】
また、CPU2が実行するディレイ処理プログラムは、処理内容に応じて選択され、例えばバッテリ残量検知処理では、上記第1ディレイ処理プログラムが選択される。
【0083】
ここで、上記CPU2を新たなものに交換した場合、上記カウンタ部22においては、新たなCPU2が上記ディレイ処理プログラムを一回実行した場合のカウンタ値(以下、新カウンタ値と称する)が求められる。このカウンタ値を求める際には、上記基準クロック発生部10で発生させた所定の基準クロックを利用する。なお、上記基準カウンタ値を設定する際にも、この基準クロックと同一のクロック数でカウンタ値を求めているものとする。
【0084】
次に、上記処理速度比率演算部23において、上記カウンタ部22で求められた新カウンタ値と、上記基準カウンタ値とが比較される。具体的には、上記基準カウンタ値に対する新カウンタ値の比率が求められる。より詳しくは、交換前のCPU2の処理速度を、交換後のCPU2の処理速度で除した値(以下、処理速度比率と称する)が求められる。そして、上記処理速度比率のデータは、コントロールレジスタ部21に記憶される。
【0085】
次に、上記ディレイ値変更部12において、上記処理速度比率と上記フラッシュROM4内のプログラム更新プログラムとを用いて、ディレイ処理プログラム内のディレイ値の変更が行なわれる。具体的には、既に設定されているディレイ値を上記処理速度比率で除した値を新たなディレイ値として設定する。
【0086】
以上の処理によって、CPU2等を交換した後のディレイ値の設定が完了する。
【0087】
次に、上述した一連のディレイ値変更処理を、図4を用いて具体的に説明すると、以下のとおりである。なお、ここでは、バッテリ残量検知処理と、省エネ復帰処理とを例に挙げて説明する。つまり、第1ディレイ処理プログラムを用いる場合について説明する。
【0088】
図4(a)は、CPU交換前における、バッテリ残量検知プログラムおよび省エネ復帰プログラムの各ディレイ値を示した説明図である。また、図4(b)は、CPU交換後における、バッテリ残量検知プログラムおよび省エネ復帰プログラムの各ディレイ値を示した説明図である。
【0089】
また、図4(a)に示すとおり、CPU2の交換前のディレイ値を、バッテリ残量検知処理では100と、省エネ復帰処理では200としておく。さらに、上記基準カウンタ値を1000とする。また、交換前のCPU2をCPU(A)として表した場合、このCPU(A)のクロック数を400MHzとする。
【0090】
ここで、CPU2が、変更された場合、変更後のCPU2をCPU(B)として表す。また、このCPU(B)のクロック数を800MHzとする。
【0091】
そして、CPU2をCPU(A)からCPU(B)に交換(アップグレード)した際、上記カウンタ部22で計測されたカウンタ値が400であったとする。なお、上記カウンタ値が小さくなっているのは、CPU2の処理速度が上昇しているためである。
【0092】
そして、上記処理速度比率演算部23にて、400を1000で除した0.4という値が処理速度比率として得られる。この後、ディレイ値変更部12は、図4(b)に示すとおり、上記バッテリ残量検知処理に関しては、上記ディレイ値100を処理速度比率0.4で除した値である250を、新たなディレイ値として設定する。一方、上記省エネ復帰処理に関しては、同図に示すとおり、上記ディレイ値200を処理速度比率0.4で除した値である500を、新たなディレイ値として設定する。
【0093】
以上の処理によって、CPU2を交換した後のディレイ値の設定が完了する。
【0094】
このように、上記制御装置1では、CPU2をグレードアップした場合でも、ディレイ値を大きくすることにより、ディレイ時間をグレードアップ前と同じ時間とすることが可能となる。
【0095】
一方、バッテリ残量検知処理および省エネ復帰処理以外の処理(以下、他の処理と称する)を行なう際に、例えば、上記第1ディレイ処理プログラムとは異なるディレイ処理プログラムを実行する方が好ましい場合もある。この場合は、フラッシュROM4内に、上記異なるディレイ処理プログラム、例えば図3に示す第2ディレイ処理プログラムを、別途記憶させておき、この第2ディレイ処理プログラムを実行させればよい。なお、以下では、上記他の処理を行うプログラムを他のプログラムと称する。
【0096】
ここで、上記第2ディレイ処理プログラムを利用した場合における、一連のディレイ値変更処理を、図5を用いて具体的に説明すると、以下のとおりである。
【0097】
図5(a)は、CPU交換前における、上記他のプログラムのディレイ値を示した説明図である。また、図5(b)は、CPU交換後における、上記他のプログラムのディレイ値を示した説明図である。
【0098】
また、図5(a)に示すとおり、CPU2の交換前のディレイ値を、上記他の処理では500としておく。さらに、上記基準カウンタ値を3000とする。
【0099】
そして、CPU2をCPU(A)からCPU(B)に交換した際、上記カウンタ部22で計測されたカウンタ値が1500であったとする。
【0100】
そして、上記処理速度比率演算部23にて、1500を3000で除した0.5という値が処理速度比率として得られる。この後、ディレイ値変更部12は、図5(b)に示すとおり、上記他の処理に関して、上記ディレイ値500を処理速度比率0.5で除した値である1000を、新たなディレイ値(L回)として設定する。
【0101】
図6は、本実施の形態に係る制御装置におけるディレイ値変更処理のフローチャートである。ここで、上記の一連のディレイ値変更の処理フローについて、図6を基に説明する。
【0102】
まず、電源オンと同時に、ハードウェアの初期化を行なう(S1)。そして、S1の後は、CPU2が交換されたか否かが判断される(S2)。もし、CPU2が交換されていれば、上記処理速度比較部11において、ディレイ処理プログラムの処理速度を、CPU2の交換前と交換後とで比較する(S3)。一方、CPU2が交換されていなければ、ディレイ値の変更を行なわずに、変更処理を終了する。
【0103】
上記S3の後は、上記ディレイ値変更部12により、ディレイ処理プログラム内のディレイ値の変更が行なわれる(S4)。これにより、ディレイ値変更処理が終了する。
【0104】
以上のように、本実施の形態に係る制御装置1は、ディレイ値を処理内容に応じて有する構成である。それゆえ、ディレイ値の異なる複数のディレイ処理を行なう必要がある場合でも、従来のように、それぞれの処理に対してディレイ処理回路を設けるといった必要性がなくなる。
【0105】
また、上記制御装置1では、CPU2が交換された場合にのみ上記ディレイ値の変更を行なう構成であるため、従来のようにディレイ処理回路をリアルタイムに動作させる構成と比較すると、電力消費を大幅に抑えることができる。それゆえ、上記制御装置1では、省エネルギーを達成できる。
【0106】
しがって、CPU等を交換した場合であっても、簡易な構成で上記交換に対応でき、かつ、省エネルギーを達成できる。
【0107】
また、CPU2が交換された後は、交換後のCPU2で測定されたカウンタ値を、新たに基準カウンタ値としておく。つまり、上記カウンタ部22で得られたカウンタ値を、上記コントロールレジスタ部21に記憶された基準カウンタ値とする。これにより、さらにCPUを交換した場合には、前回変更した後のディレイ値を利用して、新たなディレイ値を設定することができる。
【0108】
また、上記の説明においては、基準カウンタ値を、交換前のCPUの処理速度を基に設定された相対的な値としたが、必ずしも、これに限定されない。例えば、上記基準カウンタ値を、値が一定となる絶対的な値としてもよい。ただし、この場合には、上記基準カウンタ値に対応して設定された初期設定のディレイ値を保存しておく必要がある。これは、CPUが交換された場合に、上記初期設定のディレイ値を基にして、新たなディレイ値を計算する必要があるためである。
【0109】
なお、上記の説明においては、CPU2を交換した場合に、ディレイ値の変更を行なう構成であったが、これに限定されるものではない。例えば、CPU2が搭載される基板が変更された場合でも、同様のディレイ値変更を行なうことが必要である。これは、上記基板を交換することによっても、ディレイ処理プログラムの処理時間が変わるためである。
【0110】
また、上記の説明では、ディレイ処理プログラムを一回実行して、カウンタ部22でカウンタ値を求めているが、必ずしもこれに限定されるものではない。例えば,ディレイ処理プログラムを複数回実行して、カウンタ値を求めてもよい。ただし、この場合には、基準カウント値も、上記複数回に相当する値とする必要がある。
【0111】
また、上記の説明においては、省エネルギー回路6とバッテリ残量検知回路8とを用いて説明したが、これらは一例であって、制御装置1内には、その他様々な処理回路を含んでいてもよい。さらに、制御装置1内に限らず、この制御装置を備える機器等に、上記省エネルギー回路6、バッテリ残量検知回路8、その他様々な処理回路を有する構成であってもよい。
【0112】
また、上記の制御装置1で行なわれるCPU2の遅延処理の制御方法は、デジタルデータを演算処理する演算手段を備え、前記演算手段が所定の遅延処理を所定の回数行なって、一定の時間、前記演算手段による所定の演算処理を遅延させる遅延処理の制御方法において、前記演算手段による一定回数の遅延処理に要する処理時間を測定する第1のステップと、前記測定ステップで測定した処理時間と、所定の基準時間とを比較する第2のステップと、前記第2のステップで得られた結果を基に、前記演算手段が行なう遅延処理の処理回数を変更する第3のステップとを備えている遅延処理の制御方法といえる。
【0113】
【発明の効果】
本発明の制御装置は、以上のように、前記演算手段による一定回数の遅延処理に要する処理時間を測定する測定手段と、前記測定手段で測定した処理時間と、前記所定の基準時間とを比較する比較手段と、前記比較手段で得られた結果を基に、前記演算手段が行なう遅延処理の処理回数を変更する変更手段とを備えているものである。
【0114】
それゆえ、演算手段等を交換した場合であっても、簡易な構成で上記演算手段等の交換に対応でき、かつ、省エネルギーを達成できる制御装置を提供することが可能となるという効果を奏する。
【0115】
また、本発明の制御装置は、上記の制御装置において、前記比較手段での比較は、前記測定手段で測定した処理時間と、所定の基準時間との比率を求めることで行なわれるものである。
【0116】
それゆえ、演算手段等を交換する前後における処理速度が比較できる。これにより、演算手段等の交換後における遅延処理の処理回数を決定することができるという効果を奏する。
【0117】
また、本発明の制御装置は、上記の制御装置において、前記測定手段は、前記演算手段が新たな演算手段に交換された場合に、処理時間を測定するものである。
【0118】
それゆえ、演算手段が交換された場合にのみ測定を行なえばよいため、電力消費を抑制することができるという効果を奏する。
【0119】
また、本発明の制御装置は、上記の制御装置において、前記所定の基準時間は、前記演算手段が前記一定回数の遅延処理に要する処理時間であるものである。
【0120】
それゆえ、交換前の遅延処理の回数を基準として、交換後の遅延処理の回数を決定することができるという効果を奏する。
【0121】
また、本発明の制御装置は、上記の制御装置において、前記演算手段が行なう所定の遅延処理の回数は、演算手段が行なう所定の演算処理毎に設定されているものである。
【0122】
それゆえ、遅延させる時間が互いに異なる演算処理が行なわれる場合でも、演算手段等の交換後、それぞれの演算処理に応じて遅延処理の回数を変更することができるという効果を奏する。
【0123】
また、本発明の制御装置は、上記の制御装置において、前記一定回数は、一回であるものである。
【0124】
それゆえ、測定手段において測定に要する時間を短縮することが可能となるという効果を奏する。
【0125】
本発明の電子機器は、以上のように、上記の制御装置を備えるものである。
【0126】
それゆえ、演算手段等を交換した場合であっても、簡易な構成で上記演算手段等の交換に対応でき、かつ、省エネルギーを達成できる制御装置を備えた電子機器を提供することが可能となるという効果を奏する。
【図面の簡単な説明】
【図1】本実施の形態に係る制御装置における処理速度比較部の概略構成を主として示したブロック図である。
【図2】本実施の形態に係る制御装置の概略構成を示したブロック図である。
【図3】上記制御装置におけるフラッシュROMに格納されているプログラムを示した説明図である。
【図4】(a)は、CPU交換前における、バッテリ残量検知プログラムおよび省エネ復帰プログラムの各ディレイ値を示した説明図であり、(b)は、CPU交換後における、バッテリ残量検知プログラムおよび省エネ復帰プログラムの各ディレイ値を示した説明図である。
【図5】(a)は、CPU交換前における、上記他のプログラムのディレイ値を示した説明図であり、(b)は、CPU交換後における、上記他のプログラムのディレイ値を示した説明図である。
【図6】上記制御装置におけるディレイ値変更処理のフローチャートである。
【図7】バッテリ残量を検知するバッテリ残量検知回路を示した回路図である。
【図8】バッテリ残量を検知する際のフローチャートである。
【図9】省エネモードから通常モードへの復帰処理を説明するフローチャートである。
【符号の説明】
1 制御装置
2 CPU(演算手段)
10 基準クロック発生部
11 処理速度比較部
12 ディレイ値変更部(変更手段)
21 コントロールレジスタ部
22 カウンタ部(測定手段)
23 処理速度比率演算部(比較手段)
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a control device provided in an electronic device or the like. More specifically, the present invention relates to control of delay processing of an arithmetic operation in an arithmetic processing unit in a control device.
[0002]
[Prior art]
In general, various electronic devices include a control device inside the device. Various processes are executed by the control device. In addition, the control device generally includes a central processing unit (hereinafter, referred to as a CPU).
[0003]
Here, as an example of the above process, a process for determining the remaining battery level of the electronic device will be described with reference to FIGS. FIG. 7 is a circuit diagram showing a battery remaining power detection circuit for detecting the remaining battery power. FIG. 8 is a flowchart when the remaining battery level is detected.
[0004]
As shown in FIG. 7, the battery remaining amount detection circuit includes a first register 51, a battery circuit 52, a reference voltage generation circuit 53, a comparator 54, and a second register 55. The first register 51 receives a command from the CPU and issues a command to the battery circuit 52 to detect the battery voltage. The battery circuit 52 is a circuit for measuring a battery voltage of an electronic device.
[0005]
The reference voltage generation circuit 53 is a circuit that generates a predetermined voltage. The comparator 54 compares the battery voltage detected by the battery circuit 52 with a predetermined voltage generated by the reference voltage generation circuit 53. Then, the comparator 54 transmits the comparison result to the second register 55. Further, the comparison result stored in the second register 55 is read when the CPU accesses the second register 55.
[0006]
Here, after the CPU issues an instruction to the first register 51, it takes time for the battery remaining amount detection circuit to process the comparison result from the second register 55 until the comparison result can be read out. Requires a certain amount of time. That is, there is a time difference between the time when the CPU issues a command to the first register 51 and the time when the CPU can obtain the comparison result from the second register 55. This time difference is hereinafter referred to as a delay time (delay time).
[0007]
Next, the flow at the time of detecting the remaining battery level will be described with reference to FIG.
[0008]
First, the CPU issues a remaining amount detection instruction to the first register 51 (S11). Specifically, for example, a signal “1” is sent to the first register 51. Then, after S11, the battery remaining amount detection process is started (S12).
[0009]
After the battery remaining amount detection process is started in S12, the CPU repeats the delay process until the comparison result is stored in the second register 55 (S13). Here, the delay processing refers to, for example, processing in which a CPU executes a dummy program (hereinafter, referred to as a delay processing program) to delay predetermined arithmetic processing by the CPU. In other words, this is a process of delaying the access timing of the CPU to the comparison result stored in the second register 55.
[0010]
As described above, the reason for performing the delay processing is that, when the CPU issues a command to the first register 51 and immediately accesses the second register 55, the comparison result is still stored in the second register 55 at the time of access. This is because accurate detection of the remaining battery level is not possible. The time required for one delay processing is a time determined according to the dummy program or the like.
[0011]
Therefore, in order for the CPU to obtain an accurate comparison result from the second register 55, it is necessary to repeat the delay processing at least over the delay time when the battery is detected.
[0012]
Therefore, after S13, it is determined whether or not the delay processing has been performed a predetermined number of times (N times) (S14). Note that the predetermined number (N times) is a predetermined value determined in advance according to the processing content. That is, in the battery remaining amount detection process, it is determined in advance that accurate comparison results can be obtained in the second register 55 if the delay process is performed at least N times, and the value is set as a result. The predetermined number (N times) is referred to as a delay value.
[0013]
If the delay process has not been performed N times in S14, the process returns to S13 and repeats the delay process. On the other hand, if the delay processing has been executed N times, the CPU reads the comparison result from the second register 55 and then performs the arithmetic processing. Thus, a series of processing ends.
[0014]
As described above, when detecting the remaining battery level, the CPU reads out the comparison result from the second register 55 after performing the delay processing a predetermined number of times (N times).
[0015]
In the above description, the process of detecting the remaining battery level has been described, but the same applies to the process of returning from the energy saving mode such as the so-called sleep mode to the normal mode. Hereinafter, the return process will be described with reference to FIG. FIG. 9 is a flowchart illustrating a process of returning from the energy saving mode to the normal mode.
[0016]
In the energy saving mode as described above, for example, the memory power supply is turned off (S21). Then, after S21, it is determined whether there is an instruction to return to the normal mode (S22). The instruction to return to the normal mode is issued by, for example, pressing any button provided on the electronic device.
[0017]
If there is an instruction to return to the normal mode in S22, the memory power is turned on and the initialization of the memory is started (S23). On the other hand, when there is no instruction to return to the normal mode, the process returns to S22 again and waits for the instruction to return. After S23, the CPU performs a delay process (S24). This delay processing is the same processing as the above-described delay processing in battery remaining amount detection.
[0018]
After S24, it is determined whether the delay processing has been performed a predetermined number of times (M times) (S25). The predetermined number of times (M times) is a predetermined value determined in advance according to the processing content. That is, in the memory initialization processing, it is determined in advance that the memory initialization is completed if the delay processing is performed at least M times, and the value is set as a result. The predetermined number (M times) is also referred to as a delay value.
[0019]
If the delay process has not been executed M times in S25, the process returns to S24 and repeats the delay process. On the other hand, if the delay process has been executed M times, the CPU starts accessing the memory, and the operation in the normal mode is performed (S26).
[0020]
As described above, when switching from the energy saving mode to the normal mode, the delay processing is performed a predetermined number of times (M times), and the CPU accesses the memory.
[0021]
Here, in an electronic device that performs various processes such as the battery remaining amount detection process and the return process from the energy saving mode as described above, the CPU or a board on which the CPU is mounted may be, for example, a faster process speed. If replaced with a new one, the following problems occur.
[0022]
That is, in the processing shown in FIGS. 8 and 9, the CPU performs the delay processing N or M times to delay the desired processing for a predetermined time, but for example, the CPU is upgraded to a high-speed CPU. In this case, even if the delay processing is performed N times or M times, there is a problem that it is not possible to obtain an accurate comparison result of the remaining battery level or access the memory in a state where the memory has been initialized. .
[0023]
Since the delay processing is performed using a high-speed CPU, even if the delay processing is performed N times or M times, the comparison result of the CPU can be obtained before the predetermined delay time elapses. It is because it starts.
[0024]
Further, even if the number of clocks of the CPU is doubled, for example, the processing speed is not doubled. Therefore, even if the delay value is simply doubled, an accurate result cannot be obtained.
[0025]
Therefore, conventionally, in order to change the delay processing program in accordance with the replacement of the CPU or the like, the ROM itself storing the program has to be replaced with a new ROM.
[0026]
On the other hand, in recent years, a control device that does not require replacement of the ROM or the like has been developed. For example, Japanese Patent Laying-Open No. 1-152554 discloses a control device in which hardware is newly provided and access timing of a CPU can be adjusted without changing a program. According to this control device, the timing of access when the CPU acquires the comparison result from the second register 55, the timing of accessing the memory, and the like can be adjusted.
[0027]
[Patent Document 1]
JP-A-1-152554 (Published date: June 15, 2001)
[0028]
[Problems to be solved by the invention]
However, in the control device described in the above publication, when a plurality of different delay processes need to be performed as described above, it is necessary to provide a delay processing circuit for each process. That is, when there are processes with different delay times, such as the battery remaining amount detection process and the return process from the energy saving mode, separate delay processing circuits corresponding to these processes must be provided.
[0029]
Therefore, there arises a problem that the size of the control device is increased and the cost of the control device is increased.
[0030]
In the control device described in the above publication, it is necessary to operate the delay processing circuit in real time. That is, in various processes, it is necessary to always calculate the access timing of the CPU by the delay processing circuit. For this reason, power is consumed, and it is difficult for the control device to achieve energy saving.
[0031]
The present invention has been made in view of the above problems, and a purpose thereof is to provide a control device capable of coping with the above-described replacement with a simple configuration and achieving energy saving even when a CPU or the like is replaced. Another object of the present invention is to provide an electronic device including the control device.
[0032]
[Means for Solving the Problems]
In order to solve the above-mentioned problem, the control device of the present invention includes an arithmetic unit for performing arithmetic processing on digital data, the arithmetic unit performs a predetermined delay process a predetermined number of times, and performs a predetermined time by the arithmetic unit for a predetermined time. In the control device for delaying the arithmetic processing, a measuring means for measuring a processing time required for a predetermined number of delay processings by the arithmetic means, and a comparison for comparing the processing time measured by the measuring means with the predetermined reference time Means, and changing means for changing the number of times of the delay processing performed by the arithmetic means based on the result obtained by the comparing means.
[0033]
In the control device having the above-described configuration, or in a device including the control device (hereinafter, referred to as a control device or the like), the arithmetic unit performs processing with respect to a process performed by the control device or the like (hereinafter, referred to as a predetermined process). After issuing the processing start command, each unit such as the control device executes the above-described predetermined processing. Then, after the above-mentioned predetermined processing is completed, the calculation means obtains the processing result and performs the predetermined calculation processing.
[0034]
That is, in the control device and the like, it takes a predetermined time until the predetermined processing is completed. Therefore, the arithmetic unit obtains the processing result for the first time after the predetermined time has elapsed from the processing start command and performs the predetermined processing. It is configured to perform arithmetic processing.
[0035]
Then, in order to obtain a processing result after a lapse of a predetermined time, in the control device, after the calculation means issues a processing start instruction, the calculation means executes a predetermined delay processing a predetermined number of times.
[0036]
Here, for example, in order to increase the speed of processing in a control device or the like, when the arithmetic means and a board on which the arithmetic means are mounted (hereinafter referred to as arithmetic means and the like) are replaced with new arithmetic means and the like, the same predetermined If the delay processing is performed the same number of times for the processing described above, the following problem occurs. That is, since the processing speed of the arithmetic unit and the like is improved, the arithmetic unit obtains the processing result before the processing performed by the control device and the like ends. For this reason, an accurate processing result cannot be obtained.
[0037]
However, in the configuration of the present invention, first, the processing time required for the delay processing for a fixed number of times is measured by the measuring means. This makes it possible to measure the processing time required for a certain number of delay processes when the arithmetic unit or the like is replaced.
[0038]
Further, the processing time measured by the measuring means and the predetermined reference time, for example, the processing time required by the calculating means and the like for the predetermined number of delay processes before replacing the calculating means and the like, by the comparing means. Can be compared. This makes it possible to compare the processing speed before and after replacing the arithmetic means and the like.
[0039]
Then, the number of times of the predetermined delay processing can be changed by the changing means based on the result obtained by the comparing means. Accordingly, the number of times of the delay processing can be increased by the increase in the processing speed of the arithmetic unit or the like. Therefore, the processing means can acquire the processing result after the same time as before the replacement of the calculation means or the like (that is, after the predetermined time). Therefore, in the above control device, the calculation means can obtain an accurate processing result.
[0040]
Further, even if the predetermined processing performed by the control device or the like is a plurality of different processes, the control device does not perform delay processing for the plurality of different processes when the arithmetic means or the like is replaced. The number of times of processing can be changed. For this reason, in the above-described control device, for example, the configuration of the device can be reduced as compared with a device having a configuration in which a delay circuit is provided for each of a plurality of different processes.
[0041]
Further, as described above, since it is sufficient to change the number of times of the delay processing, it is not necessary to exchange the ROM or the like in which the delay processing program is stored every time the arithmetic means is replaced.
[0042]
Further, as will be described later, if the processing time is measured when the arithmetic unit or the like is replaced, power consumption can be suppressed.
[0043]
Therefore, even when the arithmetic means and the like are replaced, it is possible to provide a control device that can respond to the replacement of the arithmetic means and the like with a simple configuration and achieve energy saving.
[0044]
Further, the control device of the present invention is characterized in that, in the above control device, the comparison by the comparing means is performed by obtaining a ratio between a processing time measured by the measuring means and a predetermined reference time. I have.
[0045]
According to the above configuration, the comparison unit determines the ratio between the processing time measured by the measurement unit and the predetermined reference time. Thus, when the arithmetic means is replaced, the ratio between the processing time required by the replaced arithmetic means for a certain number of delay processes and the reference time can be determined.
[0046]
Therefore, it is possible to compare the processing speed before and after replacing the arithmetic means. This makes it possible to determine the number of times of the delay processing after the replacement of the arithmetic means or the like.
[0047]
Further, in the control device according to the present invention, in the above control device, the measuring means measures a processing time when the calculating means is replaced with a new calculating means.
[0048]
According to the arrangement, the measuring means measures the processing time when the calculating means is replaced with a new calculating means.
[0049]
Therefore, it is only necessary to perform the measurement when the calculation means is replaced, so that power consumption can be suppressed.
[0050]
In the control device according to the present invention, in the control device described above, the predetermined reference time is a processing time required for the arithmetic unit to perform the predetermined number of delay processes.
[0051]
According to the above configuration, when the arithmetic unit or the like is replaced, the comparing unit compares the processing time measured by the measuring unit after the exchange with the processing time required by the arithmetic unit before the replacement for a certain number of delay processes. Will compare.
[0052]
Therefore, the number of delay processes after replacement can be determined based on the number of delay processes before replacement.
[0053]
Further, the control device according to the present invention is characterized in that, in the above control device, the number of times of the predetermined delay processing performed by the calculation means is set for each predetermined calculation processing performed by the calculation means.
[0054]
According to the above configuration, the number of times of the predetermined delay processing performed by the arithmetic means is set for each predetermined arithmetic processing performed by the arithmetic means.
[0055]
Therefore, even when the arithmetic processings having different delay times are performed, the number of times of the delay processing can be changed according to each arithmetic processing after replacing the arithmetic means.
[0056]
Further, the control device according to the present invention is characterized in that, in the above control device, the predetermined number of times is one.
[0057]
According to the above configuration, the measuring unit measures the processing time required for one delay processing.
[0058]
Therefore, it is possible to reduce the time required for the measurement by the measuring means.
[0059]
According to another aspect of the invention, there is provided an electronic apparatus including the above-described control device.
[0060]
According to the above configuration, it is possible to provide an electronic device including a control device capable of responding to the replacement of the arithmetic unit and the like with a simple configuration and achieving energy saving even when the arithmetic unit and the like are replaced. Becomes possible.
[0061]
BEST MODE FOR CARRYING OUT THE INVENTION
One embodiment of the present invention will be described below with reference to FIGS.
[0062]
FIG. 2 is a block diagram showing a schematic configuration of the control device according to the present embodiment. The control device 1 includes a CPU (arithmetic means) 2, a system controller 3, a flash ROM 4, a memory 5, an energy saving circuit 6, a power supply 7, a battery remaining amount detection circuit 8, an EEPROM (electrically erasable / programmable read only memory) 9, and a reference clock. The apparatus includes a generation unit 10, a processing speed comparison unit 11, and a delay value change unit (change unit) 12.
[0063]
The control device 1 is a device mounted on various electronic devices, and controls the operation of the electronic devices.
[0064]
The CPU 2 performs arithmetic processing on digital data. More specifically, it is a central processing unit that performs calculations of various processes performed by the control device. The system controller 3 is a controller for controlling the system of the control device 1. The flash ROM 4 is a storage device that stores a program for a battery remaining amount detection process, a program for a return process from the energy saving mode to the normal mode, and the like. The remaining battery level detection processing and the return processing from the energy saving mode to the normal mode are basically the same as the processing described in FIGS. 8 and 9 in the related art, except for a part of the processing. The differences from the conventional processing will be described later. Further, programs and the like stored in the flash ROM 4 will be described later.
[0065]
The energy saving circuit 6 is a circuit for switching between an energy saving mode such as a so-called sleep mode and a normal mode. For example, when a certain signal is not input to the control device 1 for a certain period of time, the electronic device including the control device 1 is brought into a standby state in which power consumption is reduced more than in a normal standby state. The energy saving circuit 6 performs the process of returning from the energy saving mode to the normal mode as described in the related art.
[0066]
The energy saving circuit 6 turns off the power of the memory 5 when switching from the normal mode to the energy saving mode, and turns on the power of the memory 5 when switching from the energy saving mode to the normal mode. Further, when switching from the energy saving mode to the normal mode, the energy saving circuit 6 executes a recovery processing program stored in the flash ROM 4 (hereinafter referred to as an energy saving recovery processing program).
[0067]
The power supply 7 supplies power to the CPU 2, the system controller 3, the energy saving circuit 6, the remaining battery level detection circuit 8, the reference clock generation unit 10, the processing speed comparison unit 11, and the delay value change unit in the control device 1. I do.
[0068]
The battery remaining amount detection circuit 8 is the same circuit as the circuit shown in FIG. 7 in the related art. The battery remaining amount detecting circuit 8 executes a remaining amount detecting program (hereinafter referred to as a battery remaining amount detecting program) stored in the flash ROM 4 when detecting the remaining battery amount.
[0069]
The reference clock generator 10 generates a reference clock having a fixed number of clocks, and transmits the reference clock to the processing speed comparator 11.
[0070]
When the CPU 2 is replaced, the processing speed comparison unit 11 determines the delay value (that is, the predetermined number of times represented by N times, M times, and the like) corresponding to the CPUs 2 and the like. It compares the speed before and after replacement. Details of the processing speed comparison unit 11 will be described later.
[0071]
Further, the delay value changing unit 12 changes the delay value of the delay processing program stored in the flash ROM 4 based on the result obtained by the processing speed comparison unit 11. The delay processing program will be described later.
[0072]
Next, a program stored in the flash ROM 4 will be described. FIG. 3 is an explanatory diagram showing a program stored in the flash ROM 4.
[0073]
The flash ROM 4 stores at least a basic program, a battery remaining amount detection program, an energy saving return program, a first delay processing program, a second delay processing program, and a program updating program.
[0074]
The basic program is a program used when the electronic device performs a normal process. A specific example is a program in which processing contents for a copying machine, which is an electronic device, to perform a copying operation are described.
[0075]
The battery remaining amount detection program is a program for detecting the remaining amount of the battery using the battery remaining amount detecting circuit 8. Further, the energy saving return program is a program used when returning from the energy saving mode to the normal mode.
[0076]
Further, the first delay processing program and the second delay processing program are dummy programs used to delay a predetermined arithmetic processing of the CPU for a predetermined time. Here, for convenience of explanation, the first delay processing program is a program used in the remaining battery level detection processing and the energy saving recovery processing. Further, a delay value is set in each of the first delay processing program and the second delay processing program. Further, the processing in which the CPU 2 executes the first delay processing program or the second delay processing program is referred to as a predetermined delay processing.
[0077]
The program updating program is a program for changing the delay value described in the first and second delay processing programs. That is, for example, when the remaining battery level is detected, the program is for changing the number (N times) (delay value) of the delay processing (delay processing) performed by the CPU 2. It is a program executed by a delay value changing unit 12 described later.
[0078]
Next, the processing performed by the processing speed comparison unit 11 will be described with reference to FIG. FIG. 1 is a block diagram mainly showing a schematic configuration of the processing speed comparison unit 11.
[0079]
The processing speed comparing section 11 includes a control register section 21, a counter section (measuring means) 22, and a processing speed ratio calculating section (comparing means) 23. The control register section 21 first receives a command from the CPU 2. The contents of the command from the CPU 2 include the start (start) of the processing in the processing speed comparison unit 11, the stop (stop) of the processing, and the deletion (clear) of the comparison result stored in the control register unit 21. is there.
[0080]
In the control device 1, when the CPU 2 is replaced with a new one, the processing in the processing speed comparison unit 11 is started.
[0081]
At the initial setting stage, a predetermined reference counter value is stored in the control register section 21 in advance. This reference counter value is a counter value when the already mounted CPU 2 executes the delay processing program once before the CPU 2 is replaced. The above-mentioned delay value is determined from the above-mentioned counter value and the above-mentioned delay time (delay time).
[0082]
Further, the delay processing program executed by the CPU 2 is selected according to the processing content. For example, in the remaining battery level detection processing, the first delay processing program is selected.
[0083]
Here, when the CPU 2 is replaced with a new one, the counter unit 22 obtains a counter value (hereinafter referred to as a new counter value) when the new CPU 2 executes the delay processing program once. . When obtaining the counter value, a predetermined reference clock generated by the reference clock generator 10 is used. When setting the reference counter value, it is assumed that the counter value is obtained with the same number of clocks as the reference clock.
[0084]
Next, the processing speed ratio calculator 23 compares the new counter value obtained by the counter 22 with the reference counter value. Specifically, the ratio of the new counter value to the reference counter value is obtained. More specifically, a value obtained by dividing the processing speed of the CPU 2 before replacement by the processing speed of the CPU 2 after replacement (hereinafter, referred to as a processing speed ratio) is obtained. The data of the processing speed ratio is stored in the control register unit 21.
[0085]
Next, the delay value changing section 12 changes the delay value in the delay processing program using the processing speed ratio and the program update program in the flash ROM 4. Specifically, a value obtained by dividing the already set delay value by the processing speed ratio is set as a new delay value.
[0086]
Through the above processing, the setting of the delay value after the replacement of the CPU 2 and the like is completed.
[0087]
Next, the above-described series of delay value changing processing will be specifically described with reference to FIG. Here, the battery remaining amount detection process and the energy saving return process will be described as examples. That is, the case where the first delay processing program is used will be described.
[0088]
FIG. 4A is an explanatory diagram showing each delay value of the battery remaining amount detection program and the energy saving return program before CPU replacement. FIG. 4B is an explanatory diagram showing each delay value of the battery remaining amount detection program and the energy saving return program after the CPU replacement.
[0089]
Further, as shown in FIG. 4A, the delay value before the replacement of the CPU 2 is set to 100 in the battery remaining amount detecting process and to 200 in the energy saving returning process. Further, the reference counter value is set to 1000. When the CPU 2 before replacement is represented as a CPU (A), the number of clocks of the CPU (A) is 400 MHz.
[0090]
Here, when the CPU 2 is changed, the CPU 2 after the change is represented as a CPU (B). The number of clocks of the CPU (B) is 800 MHz.
[0091]
When the CPU 2 is exchanged (upgraded) from the CPU (A) to the CPU (B), the counter value measured by the counter unit 22 is assumed to be 400. The reason why the above counter value is small is that the processing speed of the CPU 2 is increasing.
[0092]
Then, the processing speed ratio calculating section 23 obtains a value of 0.4 obtained by dividing 400 by 1000 as the processing speed ratio. After that, as shown in FIG. 4B, the delay value changing unit 12 adds a new value 250, which is a value obtained by dividing the delay value 100 by the processing speed ratio 0.4, to the new battery remaining amount detection process. Set as delay value. On the other hand, as for the above-mentioned energy saving return processing, as shown in the figure, 500 which is a value obtained by dividing the delay value 200 by the processing speed ratio 0.4 is set as a new delay value.
[0093]
With the above processing, the setting of the delay value after the replacement of the CPU 2 is completed.
[0094]
As described above, in the control device 1, even when the CPU 2 is upgraded, the delay time can be made the same as that before the upgrade by increasing the delay value.
[0095]
On the other hand, when performing processing other than the remaining battery level detection processing and the energy saving recovery processing (hereinafter, referred to as other processing), for example, it may be preferable to execute a delay processing program different from the first delay processing program. is there. In this case, the different delay processing program, for example, the second delay processing program shown in FIG. 3 may be separately stored in the flash ROM 4, and the second delay processing program may be executed. In the following, a program that performs the other processing is referred to as another program.
[0096]
Here, a series of delay value change processing when the second delay processing program is used will be specifically described with reference to FIG. 5 as follows.
[0097]
FIG. 5A is an explanatory diagram showing the delay values of the other programs before the CPU replacement. FIG. 5B is an explanatory diagram showing delay values of the other programs after the CPU replacement.
[0098]
Also, as shown in FIG. 5A, the delay value before the replacement of the CPU 2 is set to 500 in the other processing. Further, the reference counter value is set to 3000.
[0099]
When the CPU 2 is changed from the CPU (A) to the CPU (B), the counter value measured by the counter unit 22 is 1500.
[0100]
Then, the processing speed ratio calculator 23 obtains a value of 0.5 obtained by dividing 1500 by 3000 as the processing speed ratio. After that, as shown in FIG. 5B, the delay value changing unit 12 replaces 1000, which is a value obtained by dividing the delay value 500 by the processing speed ratio 0.5, with the new delay value (for the other processes). L times).
[0101]
FIG. 6 is a flowchart of a delay value changing process in the control device according to the present embodiment. Here, a processing flow of the above series of delay value changes will be described with reference to FIG.
[0102]
First, at the same time as power-on, hardware initialization is performed (S1). Then, after S1, it is determined whether or not the CPU 2 has been replaced (S2). If the CPU 2 has been replaced, the processing speed comparing section 11 compares the processing speed of the delay processing program before and after the replacement of the CPU 2 (S3). On the other hand, if the CPU 2 has not been replaced, the change processing ends without changing the delay value.
[0103]
After S3, the delay value in the delay processing program is changed by the delay value changing unit 12 (S4). Thus, the delay value changing process ends.
[0104]
As described above, the control device 1 according to the present embodiment is configured to have the delay value according to the processing content. Therefore, even when it is necessary to perform a plurality of delay processes having different delay values, there is no need to provide a delay processing circuit for each process as in the related art.
[0105]
Further, in the control device 1, since the delay value is changed only when the CPU 2 is replaced, the power consumption is significantly reduced as compared with the conventional configuration in which the delay processing circuit is operated in real time. Can be suppressed. Therefore, the control device 1 can achieve energy saving.
[0106]
Therefore, even when the CPU or the like is replaced, it is possible to cope with the replacement with a simple configuration and achieve energy saving.
[0107]
After the CPU 2 is replaced, the counter value measured by the replaced CPU 2 is newly set as a reference counter value. That is, the counter value obtained by the counter unit 22 is used as the reference counter value stored in the control register unit 21. Thus, when the CPU is further replaced, a new delay value can be set using the delay value after the previous change.
[0108]
Further, in the above description, the reference counter value is a relative value set based on the processing speed of the CPU before replacement, but is not necessarily limited to this. For example, the reference counter value may be an absolute value that makes the value constant. However, in this case, it is necessary to store an initially set delay value corresponding to the reference counter value. This is because it is necessary to calculate a new delay value based on the initially set delay value when the CPU is replaced.
[0109]
In the above description, the delay value is changed when the CPU 2 is replaced. However, the present invention is not limited to this. For example, even when the board on which the CPU 2 is mounted is changed, it is necessary to make the same delay value change. This is because the processing time of the delay processing program changes even when the substrate is replaced.
[0110]
Also, in the above description, the delay processing program is executed once, and the counter value is obtained by the counter section 22, but the present invention is not necessarily limited to this. For example, the counter value may be obtained by executing the delay processing program a plurality of times. However, in this case, the reference count value also needs to be a value corresponding to the plurality of times.
[0111]
In the above description, the energy saving circuit 6 and the remaining battery level detection circuit 8 have been described. However, these are merely examples, and the control device 1 may include various other processing circuits. Good. Further, the configuration including the energy saving circuit 6, the remaining battery level detection circuit 8, and various other processing circuits may be provided not only in the control device 1 but also in a device or the like including the control device.
[0112]
Further, the control method of the delay processing of the CPU 2 performed by the control device 1 includes an arithmetic means for performing arithmetic processing on digital data, and the arithmetic means performs a predetermined delay processing a predetermined number of times, and performs the predetermined processing for a predetermined time. In a delay processing control method for delaying a predetermined arithmetic processing by an arithmetic means, a first step of measuring a processing time required for a predetermined number of delay processings by the arithmetic means, a processing time measured in the measuring step, And a third step of changing the number of times of the delay processing performed by the calculating means based on the result obtained in the second step. It can be said that this is a method of controlling the processing.
[0113]
【The invention's effect】
As described above, the control device of the present invention compares the processing time measured by the measuring means with the processing time required for the delay processing of a fixed number of times by the arithmetic means, and the processing time measured by the measuring means with the predetermined reference time. And a changing means for changing the number of times of the delay processing performed by the calculating means based on the result obtained by the comparing means.
[0114]
Therefore, even when the arithmetic means and the like are replaced, it is possible to provide a control device that can cope with the replacement of the arithmetic means and the like with a simple configuration and can achieve energy saving.
[0115]
Further, in the control device according to the present invention, in the above-mentioned control device, the comparison by the comparing means is performed by obtaining a ratio between the processing time measured by the measuring means and a predetermined reference time.
[0116]
Therefore, it is possible to compare the processing speed before and after replacing the arithmetic means. As a result, there is an effect that the number of times of the delay processing after the replacement of the arithmetic unit or the like can be determined.
[0117]
Further, in the control device according to the present invention, in the control device described above, the measuring means measures a processing time when the arithmetic means is replaced with a new arithmetic means.
[0118]
Therefore, it is only necessary to perform the measurement when the calculation means is replaced, and thus it is possible to suppress power consumption.
[0119]
Further, in the control device according to the present invention, in the control device described above, the predetermined reference time is a processing time required for the arithmetic unit to perform the predetermined number of delay processes.
[0120]
Therefore, there is an effect that the number of delay processes after replacement can be determined based on the number of delay processes before replacement.
[0121]
Further, in the control device according to the present invention, in the above control device, the number of times of the predetermined delay processing performed by the arithmetic means is set for each predetermined arithmetic processing performed by the arithmetic means.
[0122]
Therefore, even when arithmetic operations having different delay times are performed, it is possible to change the number of delay processes according to each arithmetic operation after replacing the arithmetic means.
[0123]
Further, in the control device according to the present invention, in the above control device, the predetermined number of times is one.
[0124]
Therefore, there is an effect that the time required for the measurement by the measuring means can be reduced.
[0125]
As described above, the electronic apparatus of the present invention includes the above-described control device.
[0126]
Therefore, it is possible to provide an electronic device equipped with a control device that can respond to the replacement of the arithmetic means and the like with a simple configuration and achieve energy saving even when the arithmetic means and the like are replaced. This has the effect.
[Brief description of the drawings]
FIG. 1 is a block diagram mainly showing a schematic configuration of a processing speed comparison unit in a control device according to the present embodiment.
FIG. 2 is a block diagram showing a schematic configuration of a control device according to the present embodiment.
FIG. 3 is an explanatory diagram showing a program stored in a flash ROM in the control device.
FIG. 4A is an explanatory diagram showing delay values of a battery remaining amount detection program and an energy saving recovery program before CPU replacement, and FIG. 4B is a battery remaining amount detection program after CPU replacement. FIG. 7 is an explanatory diagram showing delay values of an energy saving return program.
FIG. 5A is an explanatory diagram showing a delay value of the other program before CPU replacement, and FIG. 5B is an explanatory diagram showing a delay value of the other program after CPU replacement. FIG.
FIG. 6 is a flowchart of a delay value changing process in the control device.
FIG. 7 is a circuit diagram showing a battery remaining amount detection circuit for detecting a remaining battery amount.
FIG. 8 is a flowchart for detecting a remaining battery level.
FIG. 9 is a flowchart illustrating a return process from an energy saving mode to a normal mode.
[Explanation of symbols]
1 controller
2 CPU (computing means)
10 Reference clock generator
11 Processing speed comparison unit
12 Delay value change unit (change means)
21 Control register section
22 Counter section (measuring means)
23 Processing speed ratio calculator (comparing means)

Claims (7)

デジタルデータを演算処理する演算手段を備え、
前記演算手段が所定の遅延処理を所定の回数行なって、一定の時間、前記演算手段による所定の演算処理を遅延させる制御装置において、
前記演算手段による一定回数の遅延処理に要する処理時間を測定する測定手段と、
前記測定手段で測定した処理時間と、前記所定の基準時間とを比較する比較手段と、
前記比較手段で得られた結果を基に、前記演算手段が行なう遅延処理の処理回数を変更する変更手段とを備えていることを特徴とする制御装置。
Computing means for computing digital data,
In the control device, wherein the arithmetic unit performs a predetermined delay process a predetermined number of times, and a predetermined time, the predetermined arithmetic process by the arithmetic unit is delayed.
Measuring means for measuring a processing time required for a predetermined number of delay processes by the arithmetic means,
A processing time measured by the measuring means, a comparing means for comparing the predetermined reference time,
A control device, comprising: a change unit that changes the number of times of the delay process performed by the arithmetic unit based on a result obtained by the comparison unit.
前記比較手段での比較は、前記測定手段で測定した処理時間と、所定の基準時間との比率を求めることで行なわれることを特徴とする請求項1に記載の制御装置。2. The control device according to claim 1, wherein the comparison by the comparing unit is performed by calculating a ratio between a processing time measured by the measuring unit and a predetermined reference time. 3. 前記測定手段は、前記演算手段が新たな演算手段に交換された場合に、処理時間を測定することを特徴とする請求項1または2に記載の制御装置。The control device according to claim 1, wherein the measuring unit measures a processing time when the arithmetic unit is replaced with a new arithmetic unit. 前記所定の基準時間は、前記演算手段が前記一定回数の遅延処理に要する処理時間であることを特徴とする請求項3に記載の制御装置。4. The control device according to claim 3, wherein the predetermined reference time is a processing time required for the arithmetic unit to perform the predetermined number of delay processes. 5. 前記演算手段が行なう所定の遅延処理の回数は、演算手段が行なう所定の演算処理毎に設定されていることを特徴とする請求項1から4の何れか1項に記載の制御装置。The control device according to any one of claims 1 to 4, wherein the number of times of the predetermined delay processing performed by the calculation means is set for each predetermined calculation processing performed by the calculation means. 前記一定回数は、一回であることを特徴とする請求項1から5の何れか1項に記載の制御装置。The control device according to any one of claims 1 to 5, wherein the predetermined number of times is one. 請求項1から6の何れか1項に記載の制御装置を備えていることを特徴とする電子機器。An electronic apparatus comprising the control device according to claim 1.
JP2003053336A 2003-02-28 2003-02-28 Controller and electronic apparatus provided with the same Withdrawn JP2004265021A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2003053336A JP2004265021A (en) 2003-02-28 2003-02-28 Controller and electronic apparatus provided with the same
US10/773,238 US20040190904A1 (en) 2003-02-28 2004-02-09 Wavelength selection module comprising variable wavelength selecting section for selecting a plurality of wavelengths

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003053336A JP2004265021A (en) 2003-02-28 2003-02-28 Controller and electronic apparatus provided with the same

Publications (1)

Publication Number Publication Date
JP2004265021A true JP2004265021A (en) 2004-09-24

Family

ID=33117967

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003053336A Withdrawn JP2004265021A (en) 2003-02-28 2003-02-28 Controller and electronic apparatus provided with the same

Country Status (1)

Country Link
JP (1) JP2004265021A (en)

Similar Documents

Publication Publication Date Title
US10571996B2 (en) System on a chip with fast wake from sleep
TWI417740B (en) System and method for operating components of an integrated circuit at independent frequencies and/or voltages
US7228446B2 (en) Method and apparatus for on-demand power management
EP3146408B1 (en) System on a chip with always-on processor
US11086388B2 (en) Memory controller and operating method thereof
US5913068A (en) Multi-processor power saving system which dynamically detects the necessity of a power saving operation to control the parallel degree of a plurality of processors
US7392413B2 (en) Changing of operating voltage in semiconductor integrated circuit
US7941684B2 (en) Synchronization of processor time stamp counters to master counter
US7627730B1 (en) System and method for optimizing a memory controller
CN104011626B (en) By the system for being used for high energy efficiency and energy-conservation, the method and apparatus that configure power-management parameter during runtime
US20130173946A1 (en) Controlling power consumption through multiple power limits over multiple time intervals
US20150347287A1 (en) System on a Chip with Always-On Processor Which Reconfigures SOC and Supports Memory-Only Communication Mode
US12001263B2 (en) Controlling a processor clock
EP3332306A1 (en) System and method for cache aware low power mode control in a portable computing device
JP3552213B2 (en) SD memory card host controller and clock control method
JP3988636B2 (en) Microcomputer and vehicle ECU
US7219248B2 (en) Semiconductor integrated circuit operable to control power supply voltage
CN107729055B (en) Microprocessor and execution method thereof
JP4373595B2 (en) Computer system
US20070143757A1 (en) Program product, operating system, compiler, and electronic device for reducing the power consumption
CN112631414A (en) Fan control method, system and medium
JP2004265021A (en) Controller and electronic apparatus provided with the same
CN109165189B (en) Microprocessor, method of configuring the same, and computer-readable storage medium
CN117930960A (en) MCU low-power mode detection method and device
US20220413984A1 (en) Precise shadowing and adjustment of on-die timers in low power states

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: 20060509