JP2005025440A - Information processing device and microcomputer - Google Patents

Information processing device and microcomputer Download PDF

Info

Publication number
JP2005025440A
JP2005025440A JP2003189391A JP2003189391A JP2005025440A JP 2005025440 A JP2005025440 A JP 2005025440A JP 2003189391 A JP2003189391 A JP 2003189391A JP 2003189391 A JP2003189391 A JP 2003189391A JP 2005025440 A JP2005025440 A JP 2005025440A
Authority
JP
Japan
Prior art keywords
value
information processing
processing apparatus
register
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003189391A
Other languages
Japanese (ja)
Inventor
Akihiro Kurihara
章浩 栗原
Yujiro Kaneko
雄次郎 金子
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.)
Hitachi Ltd
Hitachi Solutions Technology Ltd
Original Assignee
Hitachi Ltd
Hitachi ULSI Systems Co Ltd
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 Hitachi Ltd, Hitachi ULSI Systems Co Ltd filed Critical Hitachi Ltd
Priority to JP2003189391A priority Critical patent/JP2005025440A/en
Publication of JP2005025440A publication Critical patent/JP2005025440A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an information processing device and a microcomputer capable of reducing a load of a CPU. <P>SOLUTION: This information processing device is provided with an event count comparing means 1 counting the number of occurrences of events on an input pulse waveform taking a trailing edge as an event and generating a capture signal when the counted number matches a value previously set in a count comparing register 6, a capturing means 2 performing timer counting by a reference clock Pϕ and holding the value of the timer count in the generation of the capture signal in the capture register 8, and a computing means 3 performing shift computing on the value of the capture register 8 under a condition set in a shift condition setting register 9 and the addition computing of a value set in an addition value setting register 10. These means are mounted in the microcomputer. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、情報処理装置及びマイクロコンピュータに関し、特に、非同期通信を行う際の処理を行う情報処理装置及びその情報処理装置を搭載したマイクロコンピュータに適用して有効な技術に関する。
【0002】
【従来の技術】
本発明者が検討したところによれば、非同期通信を行う際のマイクロコンピュータの技術に関しては、以下のような技術が考えられる。
【0003】
例えば、SCI(serial communication interface)やUART(universal asynchronous receiver transmitter)およびUSB(universal serial bus)などといったシリアル通信モジュールを搭載したマイクロコンピュータが多く実在している。
【0004】
これらのマイクロコンピュータ間で非同期のシリアル通信を行う場合、その前処理として双方の通信転送速度を一致させる必要がある。この通信転送速度を一致させる際には、一般的に、通信プロトコルの定めなどにより、双方のシリアル通信モジュールに対してある固定した値の通信転送速度を設定する。
【0005】
しかしながら、LIN(local interconnect network)通信プロトコルなどのように、一方の通信転送速度を実際の通信の速度から読み取って、通信転送速度に補正を加えるような通信プロトコルも存在する。このような場合は、通常、マイクロコンピュータが搭載しているタイマモジュールを用いながら、ソフトウェアによって必要な情報の処理を行う。
【0006】
【発明が解決しようとする課題】
ところで、前記のような非同期通信を行う際のマイクロコンピュータの技術について、本発明者が検討した結果、以下のようなことが明らかとなった。
【0007】
近年、ネットワーク技術の進歩により、多数の通信プロトコルが存在し、これらの通信プロトコルの処理は、例えばマイクロコンピュータなどによって行われている。このようなマイクロコンピュータでは、通信機能および通信対象機器の増加と通信転送速度の高速化などによって、複雑な処理を高速で行うことが要求されている。
【0008】
このような中、例えば自動車用のマイクロコンピュータなどでも、自動車の制御の電子化に伴い複雑な制御の実施要求が高まり、制御ユニットへの負担が増加している。特に各センサからの信号処理やユニット間の通信転送速度の高速化により、マイクロコンピュータなどにおけるソフトウェア処理が、CPUへの負荷を重くしている。また、自動車内制御ユニットでは、ノイズの影響を低減する等の理由からマイクロコンピュータの動作周波数を極力低く抑える必要性があり、CPUへの負荷は更に重くなる。
【0009】
自動車の制御ユニットは、より緻密な制御を行うためユニット間での通信によりデータを共有し、制御を分割する事で効率を高めている。また、ユニット開発工数やコストの低減のため、インタフェースも標準規格化される傾向にあり、現在ではCAN(controller area network)やLIN等の通信プロトコルが主流となっている。
【0010】
通常、このCAN通信の処理は、マイクロコンピュータ内に専用モジュールを搭載して行われるが、LIN通信の処理は、マイクロコンピュータ内の既存の内蔵モジュールとソフトウェア処理を組み合わせて行われる。LIN通信処理において、ソフトウェア処理の介入を必要不可欠としている事から、CPUの負荷は、マイクロコンピュータの動作周波数に依存する。しかしながら、前述のようにマイクロコンピュータの動作周波数を低く抑える必要性があるため、場合によっては、LIN通信プロトコルに定義されている機能を全て実現させるのは困難となる場合が考えられる。
【0011】
例えば、LIN通信プロトコルでは、Synch−Feild(1ビット毎に“High”“Low”反転を10ビット間繰り返す同期信号フィールド)のパルス幅を計測し、通信転送速度の補正を行う機能が必要とされる。この機能は、とりわけ、ソフトウェア処理による除算等の演算が必要となるため、CPUの負荷が重くなり、CPUの動作周波数や通信転送速度の値によっては、この機能を実現するのが困難な状況となり得る。
【0012】
そこで、本発明の目的は、CPUの負荷を軽減することができる情報処理装置およびマイクロコンピュータを提供することにある。
【0013】
本発明の前記並びにその他の目的と新規な特徴は、本明細書の記述及び添付図面から明らかになるであろう。
【0014】
【課題を解決するための手段】
本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、次のとおりである。
【0015】
本発明による情報処理装置は、信号の切り替わりをイベントとする入力パルス波形に対し、前記イベントの発生回数をカウントし、そのカウントの値からスタート信号とキャプチャ信号を発生する手段と、前記キャプチャ信号を発生するカウントの値を設定する手段と、基準クロックに同期してカウントを行い、前記スタート信号が発生してから前記キャプチャ信号が発生するまでの前記基準クロックに同期したカウントの値を保持する手段と、前記保持したカウントの値を演算する手段とを有するものである。
【0016】
この構成によって、入力パルス波形に対して、設定した回数のパルスのエッジが入力されるのに要する時間を計測し、その計測した値を基に演算を行うことが可能となる。
【0017】
また、前記情報処理装置は、さらに、前記演算する手段によって得た値をパルス幅とするパルス波形を生成する手段を有するものである。この構成によって、入力パルス波形を基に、それを変形したパルス波形を生成することが可能となる。
【0018】
そして、前記のような情報処理装置における前記演算する手段は、予めシフト回数とシフト方向を設定し、前記保持したカウントの値に対して前記設定したシフト回数分のシフト演算を行う機能と、予め加算値を設定し、前記シフト演算後の値に対して前記設定した加算値を加算する機能を含むものである。これらの機能によって、シリアル通信モジュールに設定する値などを算出することが可能になる。
【0019】
また、前記のような情報処理装置における前記パルス波形を生成する手段は、前記演算する手段によって得た値を初期値として、前記基準クロックに同期したダウンカウントを行い、アンダーフローが発生した際には、前記初期値のリロードを行う機能と、前記アンダーフローをトリガとして信号が切り替わるパルス波形を生成する機能を有するものである。これらの機能によって、前記演算する手段によって得た値をパルス幅とするパルス波形を生成することが可能になる。
【0020】
また、これらの情報処理装置は、特にマイクロコンピュータに適用して、有益なものとなる。
【0021】
【発明の実施の形態】
以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において、同一部材には同一の符号を付し、その繰り返しの説明は省略する。
【0022】
図1は、本発明の一実施の形態の情報処理装置において、その構成と動作の一例を示す概略図である。
【0023】
まず、図1により、本発明の一実施の形態の情報処理装置の構成の一例を説明する。図1に示す情報処理装置は、例えば、イベントカウントコンペア手段1と、キャプチャ手段2と、演算手段3などから構成される。
【0024】
前記イベントカウントコンペア手段1は、例えば、イベントカウンタ4と、コントロール/ステータスレジスタ5と、イベントカウントコンペアレジスタ6などを有している。前記コントロール/ステータスレジスタ5では、入力端子より入力されたパルス波形のエッジ(信号の切り替わり)に対し、イベントとして用いるエッジの種類などを設定することができる。エッジの種類には、立上りエッジまたは立下りエッジあるいはその両方などが含まれる。前記イベントカウンタ4は、前記コントロール/ステータスレジスタ5で設定されたイベントを検出し、そのイベントの発生回数をカウントする機能などを有している。
【0025】
また、前記イベントカウントコンペア手段1は、割り込み信号であるスタート信号を発生する機能と割り込み信号であるキャプチャ信号を発生する機能などを有している。前記スタート信号は、イベントカウンタ4が示す値(イベントカウンタ値)が‘1’となった際に発生する。前記キャプチャ信号は、予めイベントカウントコンペアレジスタ6に値を設定し、その設定した値と前記イベントカウンタ値とが一致した際に発生する。
【0026】
なお、イベントカウンタ4は、キャプチャ信号の発生後、イベントカウンタ値を‘0’にする機能と‘1’にする機能を備えている。この‘0’か‘1’の選択は、例えば、前記コントロール/ステータスレジスタ5などで設定することができる。
【0027】
前記キャプチャ手段2は、タイマカウンタ7とキャプチャレジスタ8などを有している。このタイマカウンタ7は、前記スタート信号によって、タイマカウンタ7が示す値(タイマカウンタ値)をクリアし、その後に基準クロックPφに同期したカウント動作を開始する機能と、前記キャプチャ信号によって、その時点のタイマカウンタ値をキャプチャレジスタ8へ保持する機能などを有する。
【0028】
前記演算手段3は、シフト回数およびシフト方向を設定するシフト条件設定レジスタ9と、加算値設定レジスタ10と、演算結果格納レジスタ11などを含んでいる。この演算手段3は、前記キャプチャレジスタ8の値を取り込み、この取り込んだ値に対して、シフト条件設定レジスタ9に設定したシフト回数分の右シフト演算または左シフト演算を行う機能と、そのシフト演算後の値に対して、加算値設定レジスタ10に設定した値を加算する機能と、その加算後の値を演算結果格納レジスタ11に格納する機能などを有している。そして、この演算結果格納レジスタ11の値は、DMAC(direct memory access)機能などによって他モジュールの内蔵I/Oレジスタ等に転送可能である。
【0029】
つぎに、図1に示す情報処理装置の動作の一例について説明する。
【0030】
図1に示す情報処理装置を用いると、例えば、通信のプロトコルなどで、実際の通信によって通信転送速度の読み取りや補正などが必要とされる場合に、ハードウェアでそれら読み取りや補正などの処理を行うことができる。ここでは、その一例として、本発明を、LIN通信プロトコルに適用した場合を想定する。
【0031】
LIN通信プロトコルは、マスターノード、スレーブノード間でシリアル通信を行う規格であり、その規格による通信を行う際の構成概要は図2のようになる。図2では、マスターノードと複数のスレーブノード(1)〜(3)が、それぞれのLINバスI/F(インタフェース)回路を介してLINバスに接続されている。
【0032】
そして、例えば、スレーブノード(1)〜(3)のそれぞれには、マイクロコンピュータが使用されており、そのマイクロコンピュータには、図1に示したような情報処理装置や、SCIおよびUARTといったシリアル通信モジュールなどが搭載されているものとする。
【0033】
前記マスターノードと前記スレーブノード(1)〜(3)間の通信波形の概要は図3のようになる。図3は、本発明の一実施の形態の情報処理装置およびマイクロコンピュータにおいて、その動作を説明するためのLIN通信波形を示す図であり、(a)は、1フレーム内の通信波形を示す概略図、(b)は、(a)の一部を詳細に示す図、(c)は、(a)の他の一部を詳細に示す図である。
【0034】
図3(a)のLIN通信波形は、マスターノードがスレーブノード(1)〜(3)に対して送信するヘッダフレームと、スレーブノード(1)〜(3)のいずれかがマスターノードに対して返答するレスポンスフレームから構成される。ヘッダフレームは、図3(b)に示すように、スタートフィールドと同期信号フィールドとIDフィールドを含んでいる。レスポンスフレームは、図3(c)に示すように、複数のデータフィ−ルドと、チェックサムフィールドを含んでいる。
【0035】
このようなLIN通信波形において、図3(b)の同期信号フィールドは、10回分の‘L’と‘H’の繰り返し信号となっている。そして、スレーブノードのマイクロコンピュータは、これらの信号の内の8回分(8ビット期間)から通信転送速度を読み取り、内蔵しているシリアル通信モジュールに対して、その読み取った値を反映した設定を行わなければならない。
【0036】
そこで、これら通信転送速度の読み取りおよびシリアル通信モジュールに対する設定を行う際に、図1のような情報処理装置およびそれを搭載したマイクロコンピュータを用いて図4に示すような処理を行う。図4は、本発明の一実施の形態の情報処理装置およびマイクロコンピュータにおいて、LIN通信での通信転送速度を読み取ってシリアル通信モジュールに反映させる際の処理フローの一例を示す図である。
【0037】
なお、ここでは、図1のような情報処理装置を搭載したマイクロコンピュータを用いて、図4に示すような処理を行うものとする。そして、その前提条件として、マイクロコンピュータの動作周波数をφ(MHz)、情報処理装置における前記キャプチャ手段2の基準クロックPφは、Pφ=φ/8(MHz)で動作させるものとする。このような条件において、図4に示す処理フローは、例えば次のようになる。
【0038】
S1において、ユーザが予め、図1の情報処理装置内の各レジスタ等に初期設定を行う。ここでは、コントロール/ステータスレジスタ5で立下りエッジをイベントとして指定し、イベントカウントコンペアレジスタ6に‘4’、シフト条件設定レジスタ9で右シフト指定とシフト回数を‘5’、加算値設定レジスタ10に‘−1’を設定する。また、イベントカウンタ値のクリアを行う。その後、図1の情報処理装置は、入力端子を監視し、この入力端子にイベント(入力パルス波形の立下りエッジ)が発生するのを待つ。そして、S2へ移行する。
【0039】
S2において、前記入力端子に最初のイベント信号が発生すると、イベントカウントコンペア手段1は、イベントカウンタ4で+1を加算し、キャプチャ手段2のタイマカウンタ7に対してスタート信号を出力する。タイマカウンタ7は、スタート信号を受けてタイマカウンタ値をクリアし、基準クロックPφのカウント動作を開始する。そして、S3へ移行する。
【0040】
S3において、前記入力端子に2〜4回目のイベント信号が入力され、イベントカウンタ値は、‘4’となる。なお、この間、タイマカウンタ7はカウント動作を継続している。そして、S4へ移行する。
【0041】
S4において、前記入力端子に5回目のイベントが入力されると、前記イベントカウントコンペアレジスタ6の値と前記イベントカウンタ値とが一致しているため、イベントカウントコンペア手段1は、キャプチャ信号を発生する。これによって、この時点のタイマカウンタ値がキャプチャレジスタ8に保持される。つまり、8ビット期間内のタイマカウンタ値が保持されることになる。そして、S5へ移行する。
【0042】
S5において、前記キャプチャレジスタ8の値を反映して、シリアル通信モジュールに対し、その仕様に応じた設定を行う。つまり、演算手段3により、前記キャプチャレジスタ8の値に対する演算が行われる。以下にその一例を説明する。
【0043】
シリアル通信モジュールでは、一般的に、そのモジュールが内蔵するボーレート発生回路の設定レジスタ(BRR:bit rate registerとする)に対し、設定したい通信転送速度に対応した値を格納する仕様となっている。そのBRRに格納する値は、シリアル通信モジュールの仕様によって様々であるが、その一例として、マイクロコンピュータの動作周波数をφ(MHz)、設定したい通信転送速度をTR(ビット/秒)とすると、例えば下記のような式が挙げられる。
【0044】
BRR格納値={φ×10/(64×22n−1×TR)}−1 (1)
この式(1)の場合を例に、BRR格納値を演算手段3により算出する。前記式(1)において、通信転送速度TR(ビット/秒)は、前記8ビット期間の8ビットを、その8ビット期間に要した時間で割ればよい。すなわち、TRは、前記キャプチャレジスタ8の値(CR値とする)と前記キャプチャ手段2での基準クロック周波数Pφ(=φ/8)(MHz)を用いて次のように表される。
【0045】
TR=8/{CR値×1/(Pφ×10)}=φ×10/CR値 (2)
したがって、式(2)を式(1)に代入すると、次のようになる。
【0046】
BRR格納値={CR値/(64×22n−1)}−1 (3)
nの値は、ボーレート発生回路が使用するクロックによって決まる整数値であるが、ここではn=0とする。すると、BRR格納値は、CR値を32(=2)で割って、それに−1を加えた値となる。
【0047】
すなわち、演算手段3にて、キャプチャレジスタ8の値(CR値)に対し、前記S1でのシフト条件設定レジスタ9の設定値により右シフトが5回行なわれ、前記S1での加算値設定レジスタ10の‘−1’により、−1が加算されることで、シリアル通信モジュールに設定する値を直接算出することができる。なお、他の仕様のシリアル通信モジュールについても、通常、式(1)での場合と同様に、シフト演算と加算演算によって、そのシリアル通信モジュールに設定する値を直接算出することができると考えられる。
【0048】
ところで、本発明の前提となる従来の技術においては、これまでに説明したような、通信転送速度の読み取りおよびシリアル通信モジュールに設定する値の算出などは、随所にソフトウェア処理を用いながら行われるのが一般的であった。例えば、従来では、タイマモジュールのキャプチャ機能などが用いられていたが、前記S2〜S4におけるイベント発生回数のカウントやキャプチャレジスタ8へ保持する際の処理、および、前記S5におけるシリアル通信モジュールへ設定する値の算出などはソフトウェア処理で行う必要があった。
【0049】
しかしながら、通信転送速度の高速化が進むと、ソフトウェア処理時間を短縮する必要性や、ソフトウェア処理によるCPUの負荷を軽減する必要性などが生じてくる。とりわけ、自動車用の半導体製品などでは、ノイズや低消費電力対策によりCPUの動作周波数を極力低く抑えるのが一般的であるため、前記のようなソフトウェア処理時間の短縮やCPU負荷の軽減は益々困難な状況となる。
【0050】
また、例えば、前記図3(b)を例として、同期信号フィールドと、それを反映させるIDフィールドとの間にウェイト時間が殆どないような場合、シリアル通信モジュールに対して、前記S4〜S5の処理を非常に高速に行わなければならない。このような処理をソフトウェアで行った場合、その処理時間が間に合わない可能性が考えられる。
【0051】
そこで、本発明を適用すると、これまでに述べたようにハードウェア処理によって通信転送速度の読み取り、およびシリアル通信モジュールなどに対する設定が可能となる。これによって、ソフトウェア処理が緩和され、CPUの負荷を軽減することができ、より高速な通信転送速度にも対応できるようになる。
【0052】
また、図1に示したような情報処理装置を応用すると、例えば、パルス周期が変動する入力波形に対し、その入力波形の逓倍波形などを生成することが可能になる。その一例を図5に示す。
【0053】
図5は、本発明の一実施の形態の情報処理装置において、図1の情報処理装置にカウンタ波形生成手段を追加した構成と動作の一例を示す概略図である。図5に示す情報処理装置は、図1に示した情報処理装置と同様に、例えば、イベントカウントコンペア手段1と、キャプチャ手段2と、演算手段3に加え、さらに、カウンタ波形生成手段(パルス波形を生成する手段)12が追加された構成となっている。なお、図5では省略しているが、イベントカウントコンペア手段1には、図1と同様、コントロール/ステータスレジスタ5やイベントカウントコンペアレジスタ6なども含まれている。
【0054】
前記カウンタ波形生成手段12は、例えば、ダウンカウンタ13と、ダウンカウンタ初期値レジスタ14と、図5には明示していないが、このダウンカウンタのアンダーフローをトリガとして出力信号のセットとリセットが切り替わる回路(例えば、Tフリップフロップのような回路)などを有している。その他、構成に関する説明は、図1の情報処理装置の場合と同様であるため省略する。
【0055】
つぎに、図5の情報処理装置の動作の一例について説明する。
【0056】
ここでは、仮に、自動車のクランク角センサからのパルス波形を入力し、その入力パルス波形の4倍クロックの逓倍波形を生成する場合を想定する。そして、このクランク角センサからのパルス波形は、自動車の加速または減速に伴って、図5の入力波形のようにパルスの周期が変動するものとする。すると、図5の情報処理装置は、例えば次のように動作する。なお、演算手段3までの基本的な動作は、図1の情報処理装置での説明と同様であるため一部説明を省略する。
【0057】
(1)初期設定において、コントロール/ステータスレジスタ5にイベントとして両エッジを指定し、イベントカウントコンペアレジスタ6に‘1’、シフト条件設定レジスタ9で右シフト指定とシフト回数に‘2’、加算値設定レジスタ10に‘0’を設定する。また、コントロール/ステータスレジスタ5の設定などによって、キャプチャ信号の発生後は、イベントカウンタ値を‘1’にする。
【0058】
(2)入力端子に、パルスの周期の変動を含むクランク角センサパルスが入力されると、イベントカウントコンペア手段1は、最初のエッジ(図5では立下りエッジ)が発生した際にスタート信号を発生し、それによりタイマカウンタ値のクリアとカウント動作の開始が行われる。以降、コントロール/ステータスレジスタ5やイベントカウントコンペアレジスタ6の設定により、イベントカウントコンペア手段1は、各立上りおよび立下りエッジ毎にキャプチャ信号を発生する。
【0059】
なお、イベントカウンタ値が‘1’となることにより、キャプチャ信号と同時にスタート信号が発生するが、この際にはキャプチャ信号が優先して処理される。すると、これらのキャプチャ信号によって、その都度、キャプチャレジスタ8に対してタイマカウンタ値の取り込みが行われ、その後、スタート信号によって、タイマカウンタ値のクリアとカウント動作の開始が行われる。
【0060】
(3)前記キャプチャレジスタ8に値が取り込まれると、その都度、キャプチャレジスタ8の値が演算手段3に転送される。演算手段3は、シフト条件設定レジスタ9の設定値により、2回の右シフト演算(1/4演算)を行った結果を演算結果格納レジスタ11に格納する。
【0061】
(4)演算結果格納レジスタ11の値は、カウンタ波形生成手段12のダウンカウンタ初期値レジスタ14に転送される。ダウンカウンタ13は、ダウンカウンタ初期値レジスタ14の値を初期値としてカウント動作を行い、値が0になった際にアンダーフローを発生する。また、その後、ダウンカウンタ13には、前記初期値のリロードが行われる。そして、カウンタ波形生成手段12は、このアンダーフローをトリガとして信号が切り替わる(反転する)パルス波形を生成し、出力端子より出力する。
【0062】
このようにして、図5に示すように、入力波形においてパルス周期が異なる各パルス幅を4等分したような逓倍波形を生成することができる。なお、前記逓倍波形は、入力波形におけるあるパルスの幅を計測した後にその逓倍波形を生成することになる。このため、図5に示した入力波形と逓倍波形の関係は、時間軸を合わせて示すと、入力波形のパルス1個分に図5でのハードウェア処理に必要な時間を加えた分だけずれた関係になる。
【0063】
また、図5に示したような動作が可能になると、例えば、自動車の燃料噴射の点火タイミングなどを容易に、そして精度よく制御することが可能となる。この一例を図6に示す。
【0064】
図6は、本発明の一実施の形態の情報処理装置において、図5の情報処理装置を用いた実使用の一例を示す概念図である。図6では、例えば、円盤状のクランク角センサ15があり、このクランク角センサ15は、その外周上に固定した観測ポイントと、内周上に一定間隔の角度で被観測ポイントを有している。
【0065】
このようなクランク角センサ15が、加速および減速を伴いながら回転する際に、観測ポイントが被観測ポイントから信号を受けることで、例えば図6に示すようなパルス波形が生成される。ここで、クランク角を認識する上での基準位置を、仮にパルスAの位置とする。この前提で、例えば、燃料噴射のタイミングをパルスEの中点に設定する場合を想定する。
【0066】
このような場合、一般的な処理方法としては、例えば、パルスAを処理の起点とし、パルスA〜Gなどが発生した際にイベントとして数える処理と、パルスDなどのパルス幅を計測する処理と、その計測値から予想されるパルスEの中点までのカウント値を計算し、タイマのコンペアマッチ機能などを用いて点火信号を生成する処理などが考えられる。しかしながら、これらの処理のいずれにもソフトウェア処理が必要となり、特にクランクの回転数が高まった際には、高速なソフトウェア処理が必須となる。
【0067】
ところが、図5に示した情報処理装置を用いると、例えば、変動するパルス幅を常に4等分したような波形が生成でき、中点はその2等分目に当たる位置となる。したがって、パルスAを処理の起点とすると、その時点から発生した逓倍波形のエッジの発生回数を数えるだけで、点火タイミングを精度よく設定できるようになる。例えば、図6では、パルスAを処理の起点として、逓倍波形における19回目のエッジ(立下りエッジ)で点火信号を生成すればよい。
【0068】
以上のように、図5のような情報処理装置を用いると、ソフトウェア処理としては、前記逓倍波形のエッジの発生回数を数えて点火信号を生成する処理のみとなる。したがって、前述の一般的な処理方法に比べてソフトウェアの処理を緩和することができ、これによりCPUの負荷も軽減できる。なお、前記逓倍波形のエッジの発生回数を数えて点火信号を生成する処理も、図5の情報処理装置におけるイベントカウントコンペア手段1と同様なもので、ハードウェア処理によって行うことも可能である。
【0069】
なお、ここではパルス幅が変動する入力波形に対し、その逓倍波形を生成する場合を例としたが、パルス幅が一定の場合には、逓倍波形は勿論のこと、分周波形を生成することも可能になる。また、前記図5のカウンタ波形生成手段12では、ダウンカウンタ13によるアンダーフローを用いたが、例えばアップカウンタによるコンペアマッチなどでも実現可能である。
【0070】
以上、本発明者によってなされた発明をその実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。
【0071】
例えば、図1のような情報処理装置は、LIN通信を例に動作を説明したが、勿論これに限定される訳ではなく、実際の通信データからそのデータ転送速度を計測する際の処理装置として、広く適用可能である。また、例えば、図1のような情報処理装置は、マイクロコンピュータに限らず、通信コントローラ製品などに搭載することもできる。
【0072】
本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば、以下のとおりである。
【0073】
(1)ハードウェア処理によって通信転送速度の読み取り、およびシリアル通信モジュールなどに対する設定を行うことが可能な情報処理装置およびマイクロコンピュータを実現できる。
【0074】
(2)パルス周期が変動するような入力波形に対し、ハードウェア処理によってその入力波形の逓倍波形などを生成することが可能な情報処理装置およびマイクロコンピュータを実現できる。
【0075】
(3)前記(2)により、自動車の燃料噴射の点火タイミングなどを容易に、そして精度よく制御することが可能になる。
【0076】
(4)前記(1),(2)により、ソフトウェア処理が緩和され、CPUの負荷を軽減することが可能になる。これにより、より高速な動作にも対応できるようになる。
【0077】
【発明の効果】
ハードウェア処理によって、CPU負荷の軽減を可能にする情報処理装置およびマイクロコンピュータを実現することができる。
【図面の簡単な説明】
【図1】本発明の一実施の形態の情報処理装置において、その構成と動作の一例を示す概略図である。
【図2】本発明の一実施の形態の情報処理装置およびマイクロコンピュータにおいて、その適用例および動作例を説明するためのLINプロトコルによる通信を行う際の構成概要を示す図である。
【図3】本発明の一実施の形態の情報処理装置およびマイクロコンピュータにおいて、その動作例を説明するためのLIN通信波形を示す図であり、(a)は、1フレーム内の通信波形を示す概略図、(b)は、(a)の一部を詳細に示す図、(c)は、(a)の他の一部を詳細に示す図である。
【図4】本発明の一実施の形態の情報処理装置およびマイクロコンピュータにおいて、LIN通信での通信転送速度を読み取ってシリアル通信モジュールに反映させる際の処理フローの一例を示す図である。
【図5】本発明の一実施の形態の情報処理装置において、図1の情報処理装置にカウンタ波形生成手段を追加した構成と動作の一例を示す概略図である。
【図6】本発明の一実施の形態の情報処理装置において、図5の情報処理装置を用いた実使用の一例を示す概念図である。
【符号の説明】
1 イベントカウントコンペア手段
2 キャプチャ手段
3 演算手段
4 イベントカウンタ
5 コントロール/ステータスレジスタ
6 イベントカウントコンペアレジスタ
7 タイマカウンタ
8 キャプチャレジスタ
9 シフト条件設定レジスタ
10 加算値設定レジスタ
11 演算結果格納レジスタ
12 カウンタ波形生成手段
13 ダウンカウンタ
14 ダウンカウンタ初期値レジスタ
15 クランク角センサ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an information processing apparatus and a microcomputer, and more particularly, to a technology effective when applied to an information processing apparatus that performs processing when performing asynchronous communication and a microcomputer equipped with the information processing apparatus.
[0002]
[Prior art]
According to a study by the present inventor, the following technologies can be considered as a microcomputer technology when performing asynchronous communication.
[0003]
For example, there are many microcomputers equipped with serial communication modules such as SCI (serial communication interface), UART (universal asynchronous transmitter transmitter), and USB (universal serial bus).
[0004]
When asynchronous serial communication is performed between these microcomputers, it is necessary to match both communication transfer rates as preprocessing. When matching the communication transfer rates, generally, a fixed value of the communication transfer rate is set for both serial communication modules in accordance with the definition of the communication protocol.
[0005]
However, there is a communication protocol that reads one communication transfer rate from the actual communication rate and corrects the communication transfer rate, such as a LIN (local interconnect network) communication protocol. In such a case, usually, necessary information is processed by software while using a timer module mounted on the microcomputer.
[0006]
[Problems to be solved by the invention]
By the way, as a result of examination by the present inventor regarding the technology of the microcomputer for performing the asynchronous communication as described above, the following has been clarified.
[0007]
In recent years, due to advances in network technology, there are a large number of communication protocols, and processing of these communication protocols is performed by, for example, a microcomputer. Such a microcomputer is required to perform complicated processing at high speed due to an increase in communication functions and communication target devices and an increase in communication transfer speed.
[0008]
Under such circumstances, for example, even in microcomputers for automobiles, with the digitization of automobile control, demands for implementing complex controls are increasing, and the burden on the control unit is increasing. In particular, software processing in a microcomputer or the like increases the load on the CPU due to signal processing from each sensor and increase in communication transfer speed between units. In the in-vehicle control unit, it is necessary to keep the operating frequency of the microcomputer as low as possible for the reason of reducing the influence of noise, and the load on the CPU becomes heavier.
[0009]
In order to perform more precise control, automobile control units share data by communication between units, and improve efficiency by dividing control. In addition, the interface tends to be standardized in order to reduce unit development man-hours and costs, and communication protocols such as CAN (controller area network) and LIN are now mainstream.
[0010]
Normally, the CAN communication processing is performed by mounting a dedicated module in the microcomputer, but the LIN communication processing is performed by combining existing built-in modules in the microcomputer and software processing. In the LIN communication processing, software processing intervention is indispensable, so the CPU load depends on the operating frequency of the microcomputer. However, as described above, since it is necessary to keep the operating frequency of the microcomputer low, in some cases, it may be difficult to realize all the functions defined in the LIN communication protocol.
[0011]
For example, in the LIN communication protocol, a function for measuring the pulse width of Synch-Feild (synchronization signal field that repeats “High” and “Low” inversion every 10 bits for 10 bits) and correcting the communication transfer rate is required. The In particular, this function requires operations such as division by software processing, so the load on the CPU is heavy, and depending on the CPU operating frequency and communication transfer speed value, it is difficult to realize this function. obtain.
[0012]
Therefore, an object of the present invention is to provide an information processing apparatus and a microcomputer that can reduce the load on the CPU.
[0013]
The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.
[0014]
[Means for Solving the Problems]
Of the inventions disclosed in the present application, the outline of typical ones will be briefly described as follows.
[0015]
An information processing apparatus according to the present invention counts the number of occurrences of the event with respect to an input pulse waveform having a signal switching as an event, generates a start signal and a capture signal from the count value, and the capture signal Means for setting the value of the generated count; means for counting in synchronization with the reference clock, and means for holding the count value synchronized with the reference clock from when the start signal is generated to when the capture signal is generated And means for calculating the held count value.
[0016]
With this configuration, it is possible to measure the time required for inputting the set number of pulse edges to the input pulse waveform, and perform an operation based on the measured value.
[0017]
The information processing apparatus further includes means for generating a pulse waveform having a value obtained by the means for calculating as a pulse width. With this configuration, it is possible to generate a pulse waveform obtained by modifying the input pulse waveform.
[0018]
The calculating means in the information processing apparatus as described above has a function of setting the number of shifts and the shift direction in advance, and performing a shift calculation for the set number of shifts with respect to the held count value, A function of setting an addition value and adding the set addition value to the value after the shift calculation is included. With these functions, it is possible to calculate values to be set in the serial communication module.
[0019]
Further, the means for generating the pulse waveform in the information processing apparatus as described above performs a down-count in synchronization with the reference clock using the value obtained by the means for calculating as an initial value, and when an underflow occurs. Has a function of reloading the initial value and a function of generating a pulse waveform in which a signal is switched by using the underflow as a trigger. With these functions, it is possible to generate a pulse waveform having the pulse width as a value obtained by the means for calculating.
[0020]
In addition, these information processing apparatuses are particularly useful when applied to a microcomputer.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that in all the drawings for explaining the embodiments, the same members are denoted by the same reference numerals, and the repeated explanation thereof is omitted.
[0022]
FIG. 1 is a schematic diagram showing an example of the configuration and operation of an information processing apparatus according to an embodiment of the present invention.
[0023]
First, an example of the configuration of an information processing apparatus according to an embodiment of the present invention will be described with reference to FIG. The information processing apparatus shown in FIG. 1 includes, for example, an event count compare unit 1, a capture unit 2, a calculation unit 3, and the like.
[0024]
The event count compare means 1 includes, for example, an event counter 4, a control / status register 5, an event count compare register 6, and the like. In the control / status register 5, the type of edge used as an event can be set for the edge (signal switching) of the pulse waveform input from the input terminal. The edge type includes a rising edge, a falling edge, or both. The event counter 4 has a function of detecting an event set in the control / status register 5 and counting the number of occurrences of the event.
[0025]
The event count compare means 1 has a function of generating a start signal as an interrupt signal and a function of generating a capture signal as an interrupt signal. The start signal is generated when the value (event counter value) indicated by the event counter 4 becomes “1”. The capture signal is generated when a value is set in the event count compare register 6 in advance and the set value matches the event counter value.
[0026]
The event counter 4 has a function of setting the event counter value to “0” and a function of “1” after the capture signal is generated. The selection of “0” or “1” can be set by the control / status register 5 or the like, for example.
[0027]
The capture means 2 includes a timer counter 7 and a capture register 8. The timer counter 7 clears the value (timer counter value) indicated by the timer counter 7 by the start signal, and then starts a count operation synchronized with the reference clock Pφ, and the capture signal A function of holding the timer counter value in the capture register 8 is provided.
[0028]
The arithmetic means 3 includes a shift condition setting register 9 for setting the number of shifts and the shift direction, an addition value setting register 10, an arithmetic result storage register 11, and the like. The calculation means 3 takes in the value of the capture register 8, performs a right shift operation or a left shift operation for the number of shifts set in the shift condition setting register 9 with respect to the acquired value, and the shift calculation It has a function of adding the value set in the addition value setting register 10 to the subsequent value, a function of storing the value after the addition in the calculation result storage register 11, and the like. The value of the operation result storage register 11 can be transferred to a built-in I / O register or the like of another module by a DMAC (direct memory access) function or the like.
[0029]
Next, an example of the operation of the information processing apparatus illustrated in FIG. 1 will be described.
[0030]
When the information processing apparatus shown in FIG. 1 is used, for example, when reading or correction of the communication transfer speed is required by actual communication in a communication protocol or the like, processing such as reading or correction is performed by hardware. It can be carried out. Here, as an example, it is assumed that the present invention is applied to the LIN communication protocol.
[0031]
The LIN communication protocol is a standard for performing serial communication between a master node and a slave node, and a configuration outline when performing communication according to the standard is as shown in FIG. In FIG. 2, a master node and a plurality of slave nodes (1) to (3) are connected to a LIN bus via respective LIN bus I / F (interface) circuits.
[0032]
For example, a microcomputer is used for each of the slave nodes (1) to (3). The microcomputer includes an information processing apparatus as shown in FIG. 1 and serial communication such as SCI and UART. Assume that modules are installed.
[0033]
An outline of communication waveforms between the master node and the slave nodes (1) to (3) is as shown in FIG. FIG. 3 is a diagram showing a LIN communication waveform for explaining the operation of the information processing apparatus and microcomputer according to the embodiment of the present invention. FIG. 3A is a schematic diagram showing the communication waveform in one frame. FIGS. 4A and 4B are diagrams showing a part of (a) in detail, and FIG. 4C is a diagram showing another part of (a) in detail.
[0034]
The LIN communication waveform in FIG. 3A shows a header frame transmitted from the master node to the slave nodes (1) to (3) and any one of the slave nodes (1) to (3) to the master node. Consists of response frames that respond. As shown in FIG. 3B, the header frame includes a start field, a synchronization signal field, and an ID field. As shown in FIG. 3C, the response frame includes a plurality of data fields and a checksum field.
[0035]
In such a LIN communication waveform, the synchronization signal field in FIG. 3B is a repeated signal of “L” and “H” for 10 times. Then, the slave node microcomputer reads the communication transfer speed from 8 times (8-bit period) of these signals, and makes a setting reflecting the read value to the built-in serial communication module. There must be.
[0036]
Therefore, when reading these communication transfer rates and setting the serial communication module, the processing as shown in FIG. 4 is performed using the information processing apparatus as shown in FIG. 1 and a microcomputer equipped with the information processing apparatus. FIG. 4 is a diagram illustrating an example of a processing flow when the communication transfer rate in the LIN communication is read and reflected in the serial communication module in the information processing apparatus and microcomputer according to the embodiment of the present invention.
[0037]
Here, it is assumed that the process shown in FIG. 4 is performed using a microcomputer equipped with the information processing apparatus as shown in FIG. As a precondition, the operating frequency of the microcomputer is φ (MHz), and the reference clock Pφ of the capture means 2 in the information processing apparatus is operated at Pφ = φ / 8 (MHz). Under such conditions, the processing flow shown in FIG. 4 is as follows, for example.
[0038]
In S1, the user makes initial settings in advance in each register in the information processing apparatus of FIG. Here, the control / status register 5 designates the falling edge as an event, the event count compare register 6 is “4”, the shift condition setting register 9 is right shift designation and the number of shifts is “5”, and the addition value setting register 10 Set to −1. Also, the event counter value is cleared. 1 monitors the input terminal and waits for an event (falling edge of the input pulse waveform) to occur at this input terminal. Then, the process proceeds to S2.
[0039]
In S2, when the first event signal is generated at the input terminal, the event count compare means 1 adds +1 by the event counter 4 and outputs a start signal to the timer counter 7 of the capture means 2. The timer counter 7 receives the start signal, clears the timer counter value, and starts counting the reference clock Pφ. Then, the process proceeds to S3.
[0040]
In S3, the second to fourth event signals are input to the input terminal, and the event counter value is “4”. During this time, the timer counter 7 continues the counting operation. Then, the process proceeds to S4.
[0041]
In S4, when the fifth event is input to the input terminal, the event count compare means 1 generates the capture signal because the value of the event count compare register 6 matches the event counter value. . As a result, the timer counter value at this time is held in the capture register 8. That is, the timer counter value within the 8-bit period is held. Then, the process proceeds to S5.
[0042]
In S5, the serial communication module is set in accordance with the specification, reflecting the value of the capture register 8. That is, the calculation means 3 calculates the value of the capture register 8. One example will be described below.
[0043]
In general, a serial communication module has a specification for storing a value corresponding to a communication transfer speed to be set in a setting register (BRR: bit rate register) of a baud rate generation circuit built in the module. The value stored in the BRR varies depending on the specification of the serial communication module. As an example, assuming that the operating frequency of the microcomputer is φ (MHz) and the communication transfer speed to be set is TR (bits / second), for example, The following formula can be cited.
[0044]
BRR stored value = {φ × 10 6 / (64 × 2 2n-1 × TR)}-1 (1)
Taking the case of this equation (1) as an example, the BRR stored value is calculated by the calculation means 3. In the equation (1), the communication transfer rate TR (bits / second) may be obtained by dividing 8 bits of the 8 bit period by the time required for the 8 bit period. That is, TR is expressed as follows using the value of the capture register 8 (CR value) and the reference clock frequency Pφ (= φ / 8) (MHz) in the capture means 2.
[0045]
TR = 8 / {CR value × 1 / (Pφ × 10 6 )} = Φ × 10 6 / CR value (2)
Therefore, substituting equation (2) into equation (1) yields:
[0046]
BRR stored value = {CR value / (64 × 2 2n-1 )}-1 (3)
The value of n is an integer value determined by the clock used by the baud rate generation circuit, but here n = 0. Then, the BRR stored value has a CR value of 32 (= 2 5 ) And -1 added to it.
[0047]
That is, the arithmetic means 3 shifts the value (CR value) of the capture register 8 to the right by the setting value of the shift condition setting register 9 in S1 five times, and the addition value setting register 10 in S1. The value to be set in the serial communication module can be directly calculated by adding −1 by “−1”. For serial communication modules of other specifications, it is generally considered that the value set in the serial communication module can be directly calculated by the shift operation and the addition operation as in the case of Expression (1). .
[0048]
By the way, in the conventional technology which is the premise of the present invention, the reading of the communication transfer speed and the calculation of the value set in the serial communication module as described above are performed using software processing everywhere. Was common. For example, in the past, the capture function of the timer module has been used, but the event occurrence count in S2 to S4, the processing for holding in the capture register 8, and the serial communication module in S5 are set. It was necessary to calculate the value by software processing.
[0049]
However, as the communication transfer speed increases, the necessity for shortening the software processing time and the necessity for reducing the CPU load due to the software processing will arise. In particular, in semiconductor products for automobiles, it is common to keep the CPU operating frequency as low as possible by taking measures against noise and low power consumption. Therefore, it is more difficult to reduce the software processing time and the CPU load as described above. Situation.
[0050]
Further, for example, in the case of FIG. 3B as an example, when there is almost no wait time between the synchronization signal field and the ID field that reflects the synchronization signal field, the processing of S4 to S5 is performed on the serial communication module. Processing must be done very fast. When such processing is performed by software, the processing time may not be in time.
[0051]
Therefore, when the present invention is applied, the communication transfer rate can be read and the serial communication module can be set by hardware processing as described above. As a result, software processing is relaxed, the load on the CPU can be reduced, and higher communication transfer rates can be accommodated.
[0052]
Further, when the information processing apparatus as shown in FIG. 1 is applied, for example, it is possible to generate a multiplied waveform of the input waveform with respect to the input waveform whose pulse period varies. An example is shown in FIG.
[0053]
FIG. 5 is a schematic diagram illustrating an example of a configuration and an operation in which a counter waveform generation unit is added to the information processing apparatus in FIG. 1 in the information processing apparatus according to the embodiment of the present invention. As in the information processing apparatus shown in FIG. 1, for example, the information processing apparatus shown in FIG. 12) is added. Although omitted in FIG. 5, the event count compare means 1 includes a control / status register 5 and an event count compare register 6 as in FIG.
[0054]
The counter waveform generation means 12 is, for example, a down counter 13, a down counter initial value register 14, and although not explicitly shown in FIG. 5, output signal setting and resetting are triggered by the down counter underflow as a trigger. A circuit (for example, a circuit such as a T flip-flop) or the like. The other description regarding the configuration is the same as that of the information processing apparatus of FIG.
[0055]
Next, an example of the operation of the information processing apparatus in FIG. 5 will be described.
[0056]
Here, it is assumed that a pulse waveform from a crank angle sensor of an automobile is input and a multiplied waveform of a clock that is four times the input pulse waveform is generated. The pulse waveform from the crank angle sensor assumes that the pulse cycle varies as the input waveform in FIG. 5 as the automobile is accelerated or decelerated. Then, the information processing apparatus in FIG. 5 operates as follows, for example. Note that the basic operation up to the calculation means 3 is the same as that described in the information processing apparatus in FIG.
[0057]
(1) In the initial setting, both edges are designated as events in the control / status register 5, "1" is designated in the event count compare register 6, "2" is designated in the right shift designation and the number of shifts in the shift condition setting register 9, and the added value Set “0” in the setting register 10. Further, the event counter value is set to “1” after the capture signal is generated by setting the control / status register 5 or the like.
[0058]
(2) When a crank angle sensor pulse including fluctuation of the pulse cycle is input to the input terminal, the event count compare means 1 outputs a start signal when the first edge (falling edge in FIG. 5) occurs. The timer counter value is cleared and the count operation is started. Thereafter, according to the settings of the control / status register 5 and the event count compare register 6, the event count compare means 1 generates a capture signal for each rising and falling edge.
[0059]
Note that when the event counter value becomes “1”, a start signal is generated simultaneously with the capture signal. In this case, the capture signal is processed with priority. Then, the timer counter value is taken into the capture register 8 each time by these capture signals, and then the timer counter value is cleared and the count operation is started by the start signal.
[0060]
(3) Each time a value is taken into the capture register 8, the value in the capture register 8 is transferred to the computing means 3. The calculation means 3 stores the result of performing the right shift calculation (1/4 calculation) twice in the calculation result storage register 11 according to the set value of the shift condition setting register 9.
[0061]
(4) The value of the calculation result storage register 11 is transferred to the down counter initial value register 14 of the counter waveform generation means 12. The down counter 13 performs a counting operation using the value of the down counter initial value register 14 as an initial value, and generates an underflow when the value becomes zero. Thereafter, the down counter 13 is reloaded with the initial value. Then, the counter waveform generation means 12 generates a pulse waveform that switches (inverts) the signal with this underflow as a trigger, and outputs it from the output terminal.
[0062]
In this way, as shown in FIG. 5, it is possible to generate a multiplied waveform such that each pulse width having a different pulse period in the input waveform is divided into four equal parts. The multiplied waveform is generated after measuring the width of a certain pulse in the input waveform. For this reason, the relationship between the input waveform and the multiplied waveform shown in FIG. 5 is shifted by adding the time required for hardware processing in FIG. 5 to one pulse of the input waveform when the time axis is shown together. It becomes a relationship.
[0063]
Further, when the operation as shown in FIG. 5 becomes possible, for example, it is possible to easily and accurately control the ignition timing of the fuel injection of the automobile. An example of this is shown in FIG.
[0064]
FIG. 6 is a conceptual diagram showing an example of actual use using the information processing apparatus of FIG. 5 in the information processing apparatus of one embodiment of the present invention. In FIG. 6, for example, there is a disc-shaped crank angle sensor 15, and this crank angle sensor 15 has observation points fixed on the outer periphery and observed points at regular intervals on the inner periphery. .
[0065]
When such a crank angle sensor 15 rotates while accelerating and decelerating, a pulse waveform as shown in FIG. 6 is generated, for example, when the observation point receives a signal from the observed point. Here, the reference position for recognizing the crank angle is assumed to be the position of the pulse A. Under this assumption, for example, a case is assumed in which the fuel injection timing is set to the middle point of the pulse E.
[0066]
In such a case, as a general processing method, for example, a process that uses pulse A as the starting point of processing and counts as an event when pulses A to G, etc. occur, and a process that measures a pulse width such as pulse D A process of calculating a count value from the measured value to the expected midpoint of the pulse E and generating an ignition signal using a compare match function of a timer or the like can be considered. However, software processing is required for any of these processes, and high-speed software processing is indispensable particularly when the number of crank rotations increases.
[0067]
However, when the information processing apparatus shown in FIG. 5 is used, for example, a waveform in which the varying pulse width is always divided into four can be generated, and the midpoint is a position corresponding to the second half. Therefore, assuming that the pulse A is the starting point of processing, the ignition timing can be set with high accuracy simply by counting the number of occurrences of the edge of the multiplied waveform generated from that point. For example, in FIG. 6, the ignition signal may be generated at the 19th edge (falling edge) in the multiplied waveform, starting from the pulse A.
[0068]
As described above, when the information processing apparatus as shown in FIG. 5 is used, the software processing is only the processing for generating the ignition signal by counting the number of occurrences of the edge of the multiplied waveform. Therefore, software processing can be relaxed compared to the general processing method described above, and the load on the CPU can also be reduced. Note that the process of generating the ignition signal by counting the number of occurrences of the edge of the multiplied waveform is the same as the event count compare means 1 in the information processing apparatus of FIG. 5, and can also be performed by hardware processing.
[0069]
In this example, the multiplied waveform is generated for the input waveform whose pulse width varies. However, if the pulse width is constant, the divided waveform is generated as well as the multiplied waveform. Is also possible. Further, in the counter waveform generation means 12 of FIG. 5, the underflow by the down counter 13 is used, but it can also be realized by, for example, a compare match by an up counter.
[0070]
As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.
[0071]
For example, the operation of the information processing apparatus as shown in FIG. 1 has been described by taking LIN communication as an example, but of course, the present invention is not limited to this. Widely applicable. Further, for example, the information processing apparatus as shown in FIG. 1 can be mounted not only on the microcomputer but also on a communication controller product.
[0072]
Of the inventions disclosed in the present application, effects obtained by typical ones will be briefly described as follows.
[0073]
(1) An information processing apparatus and a microcomputer capable of reading a communication transfer rate and setting a serial communication module by hardware processing can be realized.
[0074]
(2) It is possible to realize an information processing apparatus and a microcomputer capable of generating a multiplied waveform of an input waveform by hardware processing for an input waveform whose pulse period varies.
[0075]
(3) The above (2) makes it possible to easily and accurately control the ignition timing of the fuel injection of the automobile.
[0076]
(4) Due to the above (1) and (2), the software processing is relaxed and the load on the CPU can be reduced. This makes it possible to cope with higher speed operations.
[0077]
【The invention's effect】
An information processing apparatus and a microcomputer that can reduce the CPU load can be realized by hardware processing.
[Brief description of the drawings]
FIG. 1 is a schematic diagram showing an example of the configuration and operation of an information processing apparatus according to an embodiment of the present invention.
FIG. 2 is a diagram showing an outline of a configuration when communication is performed according to a LIN protocol for explaining an application example and an operation example in the information processing apparatus and the microcomputer according to the embodiment of the present invention.
FIG. 3 is a diagram showing a LIN communication waveform for explaining an operation example in the information processing apparatus and the microcomputer according to the embodiment of the present invention, and (a) shows the communication waveform in one frame. Schematic, (b) is a diagram showing in detail a part of (a), (c) is a diagram showing in detail another part of (a).
FIG. 4 is a diagram illustrating an example of a processing flow when a communication transfer rate in LIN communication is read and reflected in a serial communication module in the information processing apparatus and the microcomputer according to the embodiment of this invention.
5 is a schematic diagram illustrating an example of a configuration and an operation in which a counter waveform generation unit is added to the information processing apparatus of FIG. 1 in the information processing apparatus according to the embodiment of the present invention.
6 is a conceptual diagram showing an example of actual use using the information processing apparatus of FIG. 5 in the information processing apparatus of an embodiment of the present invention.
[Explanation of symbols]
1 Event count compare method
2 Capture means
3 Calculation means
4 Event counter
5 Control / status register
6 Event count compare register
7 Timer counter
8 Capture register
9 Shift condition setting register
10 Addition value setting register
11 Operation result storage register
12 Counter waveform generation means
13 Down counter
14 Down counter initial value register
15 Crank angle sensor

Claims (5)

信号の切り替わりをイベントとする入力パルス波形に対し、前記イベントの発生回数をカウントし、そのカウントの値からスタート信号とキャプチャ信号を発生する手段と、
前記キャプチャ信号を発生するカウントの値を設定する手段と、
基準クロックに同期してカウントを行い、前記スタート信号が発生してから前記キャプチャ信号が発生するまでの前記基準クロックに同期したカウントの値を保持する手段と、
前記保持したカウントの値を演算する手段とを有することを特徴とする情報処理装置。
A means for counting the number of occurrences of the event with respect to an input pulse waveform having a signal switching as an event, and generating a start signal and a capture signal from the count value;
Means for setting a count value for generating the capture signal;
Means for counting in synchronization with a reference clock, and holding a count value synchronized with the reference clock from when the start signal is generated to when the capture signal is generated;
An information processing apparatus comprising: means for calculating the held count value.
請求項1記載の情報処理装置であって、
さらに、前記演算する手段によって得た値をパルス幅とするパルス波形を生成する手段を有することを特徴とする情報処理装置。
The information processing apparatus according to claim 1,
The information processing apparatus further comprises means for generating a pulse waveform whose pulse width is a value obtained by the means for calculating.
請求項1または2記載の情報処理装置であって、
前記演算する手段は、
予めシフト回数とシフト方向を設定し、前記保持したカウントの値に対して前記設定したシフト回数分のシフト演算を行う機能と、
予め加算値を設定し、前記シフト演算後の値に対して前記設定した加算値を加算する機能とを含むことを特徴とする情報処理装置。
The information processing apparatus according to claim 1, wherein
The means for calculating is
A function of setting the number of shifts and the shift direction in advance, and performing a shift operation for the set number of shifts with respect to the held count value;
An information processing apparatus comprising: a function of setting an addition value in advance and adding the set addition value to the value after the shift calculation.
請求項2または3記載の情報処理装置であって、
前記パルス波形を生成する手段は、
前記演算する手段によって得た値を初期値として、前記基準クロックに同期したダウンカウントを行い、アンダーフローが発生した際には、前記初期値のリロードを行う機能と、
前記アンダーフローをトリガとして信号が切り替わるパルス波形を生成する機能とを有することを特徴とする情報処理装置。
An information processing apparatus according to claim 2 or 3,
The means for generating the pulse waveform includes:
A value obtained by the means for calculating is used as an initial value, down-counting synchronized with the reference clock is performed, and when an underflow occurs, a function of reloading the initial value;
And a function of generating a pulse waveform in which a signal is switched by using the underflow as a trigger.
請求項1〜4のいずれか1項に記載の情報処理装置を有することを特徴とするマイクロコンピュータ。A microcomputer comprising the information processing apparatus according to claim 1.
JP2003189391A 2003-07-01 2003-07-01 Information processing device and microcomputer Pending JP2005025440A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003189391A JP2005025440A (en) 2003-07-01 2003-07-01 Information processing device and microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003189391A JP2005025440A (en) 2003-07-01 2003-07-01 Information processing device and microcomputer

Publications (1)

Publication Number Publication Date
JP2005025440A true JP2005025440A (en) 2005-01-27

Family

ID=34187619

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003189391A Pending JP2005025440A (en) 2003-07-01 2003-07-01 Information processing device and microcomputer

Country Status (1)

Country Link
JP (1) JP2005025440A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007166179A (en) * 2005-12-13 2007-06-28 Denso Corp Serial communication apparatus
JP2007324679A (en) * 2006-05-30 2007-12-13 Nec Electronics Corp Baud rate generator for serial communication
JP2009224824A (en) * 2008-03-13 2009-10-01 Hitachi Kokusai Electric Inc Radio communication terminal and adapter for radio communication terminal
JP2015014967A (en) * 2013-07-05 2015-01-22 富士通コンポーネント株式会社 Communication device, communication system, and communication method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007166179A (en) * 2005-12-13 2007-06-28 Denso Corp Serial communication apparatus
JP4736775B2 (en) * 2005-12-13 2011-07-27 株式会社デンソー Serial communication device
JP2007324679A (en) * 2006-05-30 2007-12-13 Nec Electronics Corp Baud rate generator for serial communication
JP2009224824A (en) * 2008-03-13 2009-10-01 Hitachi Kokusai Electric Inc Radio communication terminal and adapter for radio communication terminal
JP2015014967A (en) * 2013-07-05 2015-01-22 富士通コンポーネント株式会社 Communication device, communication system, and communication method

Similar Documents

Publication Publication Date Title
US8280559B2 (en) Apparatus and method for providing cooling to multiple components
KR100688516B1 (en) Method for serial data communication using a single line and apparatus therefor
US7360109B2 (en) Measuring the interval of a signal using a counter and providing the value to a processor
CN109543811B (en) Counting circuit, counting method and chip
JP2005025440A (en) Information processing device and microcomputer
JPS648374B2 (en)
JP5414479B2 (en) Semiconductor device
CN115356532A (en) Multi-channel frequency measuring system and method for microprocessor
JP4352297B2 (en) Serial communication apparatus and signal processing apparatus using the same
JP3597142B2 (en) Center phase determination circuit and center phase determination method
JPH06232699A (en) Pulse generator
JP3947017B2 (en) Dial pulse generator
JP4189729B2 (en) Asynchronous readout method of timer count value and timer
JPH10255489A (en) Microcomputer
KR100462736B1 (en) Timer capable of generating a plural time interrupt signal
JP3027890B2 (en) Parity error monitor circuit
KR19990043005A (en) Motor speed detection device using incremental encoder
US6973353B1 (en) Programmable controller for controlling an output state
JPH11143819A (en) Bus size circuit
JP3049671B2 (en) DC motor speed control device
JP3685982B2 (en) Synchronous clock signal generator and ATM device using the same
JP2725463B2 (en) Servo motor speed detector
JP3742092B2 (en) Center phase judgment circuit and its center phase judgment method
JPH07260845A (en) Pulse period measuring circuit
JPH083775B2 (en) Power-on reset device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060628

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081201

A131 Notification of reasons for refusal

Effective date: 20081209

Free format text: JAPANESE INTERMEDIATE CODE: A131

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090507