JP2009111967A - Data reception apparatus and microcomputer - Google Patents

Data reception apparatus and microcomputer Download PDF

Info

Publication number
JP2009111967A
JP2009111967A JP2008151618A JP2008151618A JP2009111967A JP 2009111967 A JP2009111967 A JP 2009111967A JP 2008151618 A JP2008151618 A JP 2008151618A JP 2008151618 A JP2008151618 A JP 2008151618A JP 2009111967 A JP2009111967 A JP 2009111967A
Authority
JP
Japan
Prior art keywords
setting value
temperature
correction
period setting
value
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.)
Granted
Application number
JP2008151618A
Other languages
Japanese (ja)
Other versions
JP4462371B2 (en
Inventor
Isshin Matsuo
一心 松尾
Toshihiko Matsuoka
俊彦 松岡
Hideaki Ishihara
秀昭 石原
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2008151618A priority Critical patent/JP4462371B2/en
Priority to US12/285,581 priority patent/US8099621B2/en
Publication of JP2009111967A publication Critical patent/JP2009111967A/en
Application granted granted Critical
Publication of JP4462371B2 publication Critical patent/JP4462371B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)
  • Manipulation Of Pulses (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To generate a clock signal having accurate frequency, even if a CR oscillation circuit is subjected to temperature change or aging change. <P>SOLUTION: An A/D conversion value indicating the temperature of a CR oscillator 12 and a multiplier setting value FMULR determining a multiplier of a CR oscillation circuit 8 are stored correspondingly in an EEPROM 3, The multiplier setting value FMULR corresponding to the A/D conversion value (detection temperature T) is read out and set to a register of the CR oscillation circuit 8. Each time a communication circuit 7 receives a synchronization signal, a clock signal CLK is counted to measure a unit bit length; the multiplier setting value FMULR is corrected based on a count value XA of the clock signals and a reference count value XB, based on a reference cycle with respect to a regular unit bit time; and the corrected multiplier setting value FMULR is written in the EEPROM 3 corresponding to the detection temperature T. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、CR発振回路から出力されるクロック信号を用いたデータ受信装置および当該データ受信装置を備えたマイクロコンピュータに関する。   The present invention relates to a data receiving device using a clock signal output from a CR oscillation circuit and a microcomputer provided with the data receiving device.

通信装置やマイクロコンピュータ(マイコン)では、正確で安定した基準クロックを生成するために発振子が用いられている。特許文献1、2には、水晶発振器における経年変化補正を行う技術が開示されている。しかし、発振子は比較的高価であるため、発振子を用いない発振子レスの構成が望まれている。発振子の代用回路としてCR発振回路があるが、CR発振回路は温度変化および電源電圧変化により発振周期が変化し易く、特に温度が変化する環境、特に車載機器のように温度変化の大きい環境下では基準クロックとして使用することができない。   In communication apparatuses and microcomputers (microcomputers), an oscillator is used to generate an accurate and stable reference clock. Patent Documents 1 and 2 disclose a technique for correcting aging in a crystal oscillator. However, since an oscillator is relatively expensive, an oscillator-less configuration that does not use an oscillator is desired. There is a CR oscillation circuit as a substitute circuit for an oscillator, but the CR oscillation circuit easily changes its oscillation cycle due to temperature change and power supply voltage change, especially in an environment where the temperature changes, particularly in an environment where the temperature change is large such as in-vehicle equipment. Therefore, it cannot be used as a reference clock.

例えば、車載LANの通信プロトコルであるLIN(Local Interconnect Network)では、マスタノードから送信されるフレームのヘッダに0x55なるシンクバイトフィールド(Synch Byte Field)が付加されている。スレーブノードでは、この時間を基準クロックを用いて計数することにより1ビット時間(bit time)の正確な値を算出して通信レートを得るようになっている(例えば特許文献3参照)。しかし、この同期信号を検出する間に温度変化が生じて基準クロックが変動すると、正しくデータの送受信を行えない。   For example, in a LIN (Local Interconnect Network) which is a communication protocol for in-vehicle LAN, a sync byte field (Synch Byte Field) of 0x55 is added to the header of a frame transmitted from a master node. In the slave node, the communication rate is obtained by calculating an accurate value of 1 bit time by counting this time using a reference clock (see, for example, Patent Document 3). However, if the reference clock fluctuates due to a temperature change during the detection of this synchronization signal, data cannot be transmitted / received correctly.

これに対し、特許文献4には、温度変化に応じて発振周波数が変化した場合に、CR発振回路の時定数を変化させることなく、通信回路のデータ送信時間が一定となるように制御するマイコンが開示されている。通信回路により管理される1フレームのデータ送信時間を一定とするための通信レートCMRを決定するデータを予めメモリに記憶しておき、検出温度に応じてメモリに記憶されているデータを読み出し、決定した通信レートCMRを通信回路に設定する。また、データが不足する温度領域では、高低2点間を一次関数で補間することにより近似の通信レートCMRを得ている。
特開2004−282118号公報 特開2002−305442号公報 特開2006−311237号公報 特開2006−270917号公報
On the other hand, Patent Document 4 discloses a microcomputer that controls the data transmission time of the communication circuit to be constant without changing the time constant of the CR oscillation circuit when the oscillation frequency changes according to the temperature change. Is disclosed. Data for determining the communication rate CMR for making the data transmission time of one frame managed by the communication circuit constant is stored in the memory in advance, and the data stored in the memory is read and determined according to the detected temperature. The communication rate CMR thus set is set in the communication circuit. In a temperature region where data is insufficient, an approximate communication rate CMR is obtained by interpolating between two points of high and low with a linear function.
JP 2004-282118 A JP 2002-305442 A JP 2006-311237 A JP 2006-270917 A

特許文献4記載の補正手段では、製品ごとに事前に初期特性を測定し、その特性に対応したデータをメモリに書き込む必要がある。誤差を低減するには極力多くの温度についてデータを準備することが好ましいが、データ数が増加すると初期特性の測定工数および書込工数が増大してコストが上昇する。また、上述したように数点のデータのみを準備してその間を直線補間すると、補間される温度領域の初期特性に誤差が生じ易い。初期特性の誤差は、出荷後の実動作においては補正することができない。さらに、CR発振回路は、同じ温度条件、電圧条件であっても時間経過とともに徐々に発振周波数が変化する。特許文献4記載の補正手段では、再度データを書き換えない限り経年変化による誤差を補正できない。   In the correction means described in Patent Document 4, it is necessary to measure the initial characteristics for each product in advance and write data corresponding to the characteristics in the memory. In order to reduce the error, it is preferable to prepare data for as many temperatures as possible. However, as the number of data increases, the number of man-hours for initial characteristics and the number of man-hours for writing increase, thereby increasing costs. Also, as described above, if only several points of data are prepared and linear interpolation is performed between them, an error tends to occur in the initial characteristics of the temperature region to be interpolated. The error in the initial characteristic cannot be corrected in the actual operation after shipment. Further, the oscillation frequency of the CR oscillation circuit gradually changes with time even under the same temperature condition and voltage condition. The correction means described in Patent Document 4 cannot correct errors due to secular change unless data is rewritten again.

本発明は上記事情に鑑みてなされたもので、その目的は、CR発振回路に温度変化、電圧変化または経年変化が生じても正確な周波数を持つクロック信号を生成できるデータ受信装置およびマイクロコンピュータを提供することにある。   The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a data receiving apparatus and a microcomputer that can generate a clock signal having an accurate frequency even when a temperature change, a voltage change, or a secular change occurs in the CR oscillation circuit. It is to provide.

請求項1に記載した手段によれば、温度検出手段によりCR発振器周辺の温度を検出し、その検出温度に対応した周期設定値(例えば逓倍数、分周比)を記憶手段から読み出して発振回路に与える。発振回路は、CR発振器の発振信号をその周期設定値に基づいて逓倍または分周してクロック信号を出力する。この周期設定値は、受信手段で受信する正確な通信レートを持つデータ信号の単位ビット長を基準として補正されたものなので、クロック信号の周期は上記通信レートと同程度の精度を有することになる。従って、温度変化が生じても正確な周期を持つクロック信号を生成可能となる。   According to the means described in claim 1, the temperature around the CR oscillator is detected by the temperature detecting means, and the period setting value (for example, the multiplication number and the frequency dividing ratio) corresponding to the detected temperature is read from the storage means, and the oscillation circuit To give. The oscillation circuit multiplies or divides the oscillation signal of the CR oscillator based on the period setting value and outputs a clock signal. Since this cycle setting value is corrected with reference to the unit bit length of the data signal having an accurate communication rate received by the receiving means, the cycle of the clock signal has the same accuracy as the communication rate. . Therefore, it is possible to generate a clock signal having an accurate period even if a temperature change occurs.

クロック信号を用いて受信手段でデータ信号を受信するとき、そのデータ信号の単位ビット長を、上記発振回路から出力されるクロック信号の計数により計測する。そして、このクロック信号の計数値(実際値)と、単位ビット長に対する基準周期に基づく基準計数値(基準値)とに基づいて、そのときの検出温度に対応した周期設定値を補正し、補正後の周期設定値を検出温度に対応させて記憶手段に書き込む。   When the data signal is received by the receiving means using the clock signal, the unit bit length of the data signal is measured by counting the clock signal output from the oscillation circuit. Then, based on the count value (actual value) of this clock signal and the reference count value (reference value) based on the reference cycle for the unit bit length, the cycle set value corresponding to the detected temperature at that time is corrected and corrected. The later cycle set value is written in the storage means in correspondence with the detected temperature.

本手段によれば、データ信号を受信してその単位ビット長の計測を実行するごとに、その計測時の検出温度における記憶された周期設定値を最新の値に更新でき、或いは当該検出温度における記憶された周期設定値が存在しない場合(補間等により周期設定値を求めている場合)には、周期設定値を新たに生成して記憶することができる。すなわち、データ受信装置は、受信するデータ信号の同期信号などにおける単位ビット長に基づいて当該温度における周期設定値を次々に学習する機能を有している。   According to this means, every time a data signal is received and the unit bit length is measured, the stored cycle setting value at the detected temperature at the time of measurement can be updated to the latest value, or at the detected temperature. When the stored cycle setting value does not exist (when the cycle setting value is obtained by interpolation or the like), the cycle setting value can be newly generated and stored. That is, the data receiving device has a function of successively learning the cycle set value at the temperature based on the unit bit length in the synchronization signal of the received data signal.

従って、周期設定値の初期値の数が少ない場合や初期値に誤差が存在する場合であっても、正確な規定通信レートを持つデータ信号を受信するに従って、温度補正に用いる周期設定値を拡充することができる。また、CR発振周期に経年変化が生じても、上記更新によりその誤差をキャンセルすることができる。   Therefore, even if the initial value of the cycle setting value is small or there is an error in the initial value, the cycle setting value used for temperature correction is expanded as a data signal having an accurate specified communication rate is received. can do. Even if the CR oscillation cycle changes over time, the error can be canceled by the above update.

請求項2に記載した手段によれば、当該検出温度に対応する周期設定値を補正する場合、他の温度に対応する周期設定値も合わせて補正する。すなわち、補正後の周期設定値と当該検出温度に対応した補正前の周期設定値との差分を演算し、記憶手段に記憶されている各温度に対応した周期設定値に前記差分を加算する。これにより、経年変化によるずれが生じた場合に、全温度範囲の周期設定値を一度に補正することができる。また、極端に高い温度や低い温度などのように発生頻度が少ない温度に対応した周期設定値が補正されずに初期の誤差や経年変化が残存し続けることを防止できる。   According to the second aspect of the present invention, when the cycle set value corresponding to the detected temperature is corrected, the cycle set value corresponding to another temperature is also corrected. That is, the difference between the corrected cycle setting value and the cycle setting value before correction corresponding to the detected temperature is calculated, and the difference is added to the cycle setting value corresponding to each temperature stored in the storage means. Thereby, when the shift | offset | difference by a secular change arises, the period setting value of the whole temperature range can be correct | amended at once. In addition, it is possible to prevent the initial error and the secular change from continuing to remain without correcting the cycle set value corresponding to the temperature with low occurrence frequency such as extremely high temperature or low temperature.

請求項3に記載した手段によれば、当該検出温度に対応する周期設定値を補正する場合、他の温度に対応する周期設定値も合わせて補正する。すなわち、補正後の周期設定値と当該検出温度に対応した補正前の周期設定値との差分を演算し、記憶手段に記憶されている各温度に対応した周期設定値に、上記差分を各温度に応じて重み付けして得た値を加算する。これにより、温度ごとに異なる初期の誤差特性や経年変化の特性まで考慮したより適切な補正ができる。   According to the means described in claim 3, when correcting the cycle set value corresponding to the detected temperature, the cycle set value corresponding to another temperature is also corrected. That is, the difference between the corrected cycle set value and the pre-correction cycle set value corresponding to the detected temperature is calculated, and the difference is set to the cycle set value corresponding to each temperature stored in the storage means. The value obtained by weighting according to is added. This makes it possible to perform more appropriate correction in consideration of initial error characteristics and aging characteristics that differ depending on the temperature.

請求項4に記載した手段によれば、補正により得られる周期設定値が所定回数だけ連続して一致した場合に、当該補正後の周期設定値を温度検出手段により検出された温度に対応させて記憶手段に書き込む。これによりフィルタ作用が得られ、誤計測などによる誤周期設定値を排除でき、周期設定値を安定させることができる。   According to the means described in claim 4, when the cycle setting value obtained by the correction coincides continuously a predetermined number of times, the corrected cycle setting value is made to correspond to the temperature detected by the temperature detection unit. Write to storage means. Thereby, a filter action is obtained, an erroneous cycle set value due to erroneous measurement or the like can be eliminated, and the cycle set value can be stabilized.

請求項5に記載した手段によれば、所定回数だけ連続して一致しない場合であっても、補正により得られる周期設定値が所定回数だけ連続して単調に増加または減少した場合に、当該補正後の周期設定値を温度検出手段により検出された温度に対応させて記憶手段に書き込む。これにより、温度変化により周期設定値が一定せず絶えず単調に変化する場合に、周期設定値の補正がいつまでも反映されない事態を防止することができる。   According to the means described in claim 5, even when the predetermined number of times does not coincide with each other, the correction is performed when the period setting value obtained by the correction continuously increases or decreases by a predetermined number of times. The subsequent cycle setting value is written in the storage means in correspondence with the temperature detected by the temperature detection means. As a result, it is possible to prevent a situation in which the correction of the cycle setting value is not reflected indefinitely when the cycle setting value is not constant and changes monotonously due to a temperature change.

請求項6ないし10に記載した手段は、それぞれ請求項1ないし5に記載した手段に対し、CR発振器周辺の検出温度のみならずCR発振器に供給される電源電圧にも対応させて周期設定値の記憶、読み出し、補正およびクロック周期の設定を実行する。すなわち、CR発振器に供給される電源の電圧を検出する電圧検出手段を備え、温度検出手段により検出された温度および電圧検出手段により検出された電圧に対応した周期設定値を記憶手段から読み出して発振回路に与える。補正手段は、受信手段で受信する正確な通信レートを持つデータ信号の単位ビット長を基準として周期設定値を補正し、補正後の周期設定値を検出温度および検出電圧に対応させて記憶手段に書き込む。これらの手段によれば、CR発振器周辺の温度およびCR発振器の電源電圧における周期設定値を次々に学習し、温度変動のみならず電源電圧変動が生じても、正確な周期を持つクロック信号を生成可能となる。   The means described in claims 6 to 10 is different from the means described in claims 1 to 5 in that the period set value is set corresponding to not only the detected temperature around the CR oscillator but also the power supply voltage supplied to the CR oscillator. Store, read, correct and set clock cycle. That is, voltage detecting means for detecting the voltage of the power supplied to the CR oscillator is provided, and the temperature detected by the temperature detecting means and the period setting value corresponding to the voltage detected by the voltage detecting means are read from the storage means and oscillated. Give to the circuit. The correction unit corrects the cycle setting value with reference to the unit bit length of the data signal having an accurate communication rate received by the reception unit, and stores the corrected cycle setting value in correspondence with the detected temperature and the detection voltage in the storage unit. Write. According to these means, the temperature around the CR oscillator and the period setting value of the power supply voltage of the CR oscillator are learned one after another, and a clock signal having an accurate period is generated even if power supply voltage fluctuations occur as well as temperature fluctuations. It becomes possible.

請求項11に記載した手段によれば、受信手段で受信するデータ信号に含まれる所定の同期信号を検出したときに単位ビット長を計測するので、例えばマスタからの正確な規定通信レートを持つデータ信号を受信するごとに周期設定値を補正することができる。   According to the means described in claim 11, since the unit bit length is measured when a predetermined synchronization signal included in the data signal received by the receiving means is detected, for example, data having an accurate prescribed communication rate from the master The period set value can be corrected every time a signal is received.

請求項12に記載した手段によれば、補正前後の周期設定値の差分を演算し、その差分が所定の制限値以下である場合に限り周期設定値の補正および補正後の周期設定値の記憶手段への書き込みを実行する。想定される温度変動(および電圧変動)の最大幅に対応した周期設定値の変化幅を制限値として設定すれば、それを超える誤った補正を回避することができる。   According to the means described in claim 12, the difference between the cycle set values before and after the correction is calculated, and the cycle set value is corrected and stored after the correction only when the difference is equal to or less than a predetermined limit value. Write to the means. If the change width of the cycle setting value corresponding to the maximum width of the assumed temperature fluctuation (and voltage fluctuation) is set as the limit value, erroneous correction exceeding that can be avoided.

請求項13に記載した手段によれば、マイクロコンピュータが上述した何れかのデータ受信装置を備え、そのデータ受信装置でデータ信号を受信することにより、CR発振回路で正確な周波数を持つクロック信号を生成してシステムクロック信号とすることができる。本手段によれば、発振子を搭載する必要がないためコストを下げることができる。また、データ信号を受信するごとに、クロック信号の周期を決定する周期設定値を学習(補正)し続けるので、温度変化、電圧変化または経年変化が生じても正確な周波数を持つクロック信号を生成できる。   According to the means described in claim 13, the microcomputer is provided with any of the data receiving devices described above, and the data signal is received by the data receiving device, whereby the clock signal having an accurate frequency is received by the CR oscillation circuit. It can be generated as a system clock signal. According to this means, since it is not necessary to mount an oscillator, the cost can be reduced. Also, every time a data signal is received, the cycle setting value that determines the cycle of the clock signal is continuously learned (corrected), so that a clock signal having an accurate frequency can be generated even if a temperature change, voltage change or aging change occurs. it can.

請求項14に記載した手段によれば、データ受信装置の補正手段が周期設定値の補正演算を実行することに替えて、上位コンピュータが補正演算を実行する。そのため、マイクロコンピュータは、データ信号を送信するデータ送信装置を備え、データ受信装置の計測手段によるクロック信号の計数値と記憶手段から読み出された周期設定値とをデータ送信装置により上位コンピュータに送信する。上位コンピュータは、クロック信号の計数値とデータ信号の単位ビット長に対する基準周期に基づく基準計数値とに基づいて周期設定値を補正し、マイクロコンピュータに送信する。本手段によれば、発振子レスであって小規模で安価なマイクロコンピュータの処理負担を軽減でき、演算処理能力の不足を補うことができる。   According to the means described in claim 14, the host computer executes the correction calculation instead of the correction means of the data receiving apparatus executing the correction calculation of the cycle set value. Therefore, the microcomputer includes a data transmission device that transmits a data signal, and transmits the count value of the clock signal by the measurement unit of the data reception device and the period setting value read from the storage unit to the host computer by the data transmission device. To do. The host computer corrects the cycle setting value based on the count value of the clock signal and the reference count value based on the reference cycle with respect to the unit bit length of the data signal, and transmits it to the microcomputer. According to this means, it is possible to reduce the processing load of a small-sized and inexpensive microcomputer that does not require an oscillator, and it is possible to compensate for the shortage of arithmetic processing capability.

(第1の実施形態)
以下、本発明の第1の実施形態について図1ないし図4を参照しながら説明する。
図1は、車両のECU(Electronic Control Unit)に搭載されているワンチップマイクロコンピュータの電気的構成を示す機能ブロック図である。このマイコン1は、CPU2、EEPROM3(記憶手段に相当)、RAM4、ROM5、A/D変換器6、例えばUART(Universal Asynchronous Receiver/Transmitter)などの通信回路7(受信手段に相当)、CR発振回路8および温度検出回路9(温度検出手段に相当)を備えている。温度検出回路9以外の回路は、アドレスバス10およびデータバス11を介してCPU2に接続されている。CPU2は、本発明でいうクロック周期設定手段、計測手段および補正手段に相当する。これらの各回路には、電源線14とグランド15を通して電源(電圧Vcc)が供給されている。
(First embodiment)
Hereinafter, a first embodiment of the present invention will be described with reference to FIGS.
FIG. 1 is a functional block diagram showing an electrical configuration of a one-chip microcomputer mounted on an ECU (Electronic Control Unit) of a vehicle. The microcomputer 1 includes a CPU 2, an EEPROM 3 (corresponding to storage means), a RAM 4, a ROM 5, an A / D converter 6, for example, a communication circuit 7 (corresponding to receiving means) such as a UART (Universal Asynchronous Receiver / Transmitter), a CR oscillation circuit. 8 and a temperature detection circuit 9 (corresponding to temperature detection means). Circuits other than the temperature detection circuit 9 are connected to the CPU 2 via an address bus 10 and a data bus 11. The CPU 2 corresponds to a clock cycle setting unit, a measurement unit, and a correction unit in the present invention. Each of these circuits is supplied with power (voltage Vcc) through a power line 14 and a ground 15.

CR発振回路8は、CR発振器12およびPLL(Phase Locked Loop)回路13から構成されている。PLL回路13は、CR発振器12の発振信号を逓倍数設定値FMULRに基づいて逓倍し、さらに分周比設定値FDIVRに基づいて分周してクロック信号CLKを生成し出力する。逓倍数設定値FMULRおよび分周比設定値FDIVRは、本発明でいう周期設定値に相当し、それぞれCR発振回路8内のレジスタに格納される。   The CR oscillation circuit 8 includes a CR oscillator 12 and a PLL (Phase Locked Loop) circuit 13. The PLL circuit 13 multiplies the oscillation signal of the CR oscillator 12 based on the multiplication number setting value FMULR, and further divides the frequency based on the division ratio setting value FDIVR to generate and output the clock signal CLK. The multiplication number setting value FMULR and the frequency division ratio setting value FDIVR correspond to the period setting value referred to in the present invention, and are stored in registers in the CR oscillation circuit 8 respectively.

クロック信号CLKは、マイコン1のシステムクロックとしてCPU2、A/D変換器6、通信回路7などに供給される。以下では周期設定値として分周比設定値FDIVRを一定とし逓倍数設定値FMULRを補正する場合について説明するが、逓倍数設定値FMULRを一定とし分周比設定値FDIVRを補正し、或いは逓倍数設定値FMULRと分周比設定値FDIVRの両者を補正してもよい。   The clock signal CLK is supplied to the CPU 2, the A / D converter 6, the communication circuit 7 and the like as the system clock of the microcomputer 1. In the following description, the frequency division ratio setting value FDIVR is fixed as the cycle setting value and the multiplication number setting value FMULR is corrected. However, the frequency division ratio setting value FMULR is fixed and the frequency division ratio setting value FDIVR is corrected, or the multiplication number is set. Both the set value FMULR and the division ratio set value FDIVR may be corrected.

温度検出回路9は、電源線14とグランド15との間に接続された抵抗16とダイオード17〜19との直列回路により構成されている。抵抗16とダイオード17との接続ノードは、A/D変換器6の入力端子に接続されている。周知のようにダイオードの順方向電圧Vfは、−2.0〜−2.5mV/℃の温度特性を有している。A/D変換器6を介してダイオード17〜19の順方向電圧3・Vfを入力することにより、A/D変換値に対応して温度を検出することができる。この温度検出回路9は、CR発振器12(またはその周辺)の温度を検出することができるように、半導体基板上でCR発振器12に近接して形成されている。   The temperature detection circuit 9 is configured by a series circuit of a resistor 16 and diodes 17 to 19 connected between the power supply line 14 and the ground 15. A connection node between the resistor 16 and the diode 17 is connected to an input terminal of the A / D converter 6. As is well known, the forward voltage Vf of the diode has a temperature characteristic of −2.0 to −2.5 mV / ° C. By inputting the forward voltage 3 · Vf of the diodes 17 to 19 through the A / D converter 6, the temperature can be detected corresponding to the A / D conversion value. The temperature detection circuit 9 is formed in the vicinity of the CR oscillator 12 on the semiconductor substrate so that the temperature of the CR oscillator 12 (or its surroundings) can be detected.

通信回路7は、車載LANのシリアル通信プロトコルであるLINのスレーブノードとして機能する。通信回路7がフレーム(データ信号に相当)を受信するときの各ビットの取込タイミングおよび通信回路7が送信するときの通信レート(ボーレート)は、CR発振回路8から出力されるクロック信号CLKの周波数に基づいて定まるため、クロック信号CLKの周波数(周期)が変動すると送受信に支障が生じる。   The communication circuit 7 functions as a slave node of LIN, which is a serial communication protocol for in-vehicle LAN. The timing at which each bit is captured when the communication circuit 7 receives a frame (corresponding to a data signal) and the communication rate (baud rate) when the communication circuit 7 transmits the clock signal CLK output from the CR oscillation circuit 8 are as follows. Since it is determined based on the frequency, if the frequency (cycle) of the clock signal CLK varies, transmission / reception will be hindered.

LIN仕様2.0によれば、マスタノードの発振周波数の許容誤差(Oscillator Tolerance)は±0.5%未満であり、スレーブノードの発振周波数の許容誤差は±1.5%未満である。また、スレーブノードにおける同期前の規定周波数からのずれは±14%未満である。何らの補正手段も持たない一般のCR発振回路を用いて、例えば−40℃から+125℃の広範な温度範囲で発振周波数を±1.5%未満の変動に保つことは極めて難しい。   According to LIN specification 2.0, the master node oscillation frequency tolerance (Oscillator Tolerance) is less than ± 0.5%, and the slave node oscillation frequency tolerance is less than ± 1.5%. The deviation from the specified frequency before synchronization in the slave node is less than ± 14%. It is extremely difficult to keep the oscillation frequency within a fluctuation of less than ± 1.5% in a wide temperature range of, for example, −40 ° C. to + 125 ° C. by using a general CR oscillation circuit having no correction means.

そこで、本実施形態では、CPU2は、EEPROM3に逓倍数設定値FMULRと検出温度T(実際にはA/D変換値)とを対応付けて記憶し、EEPROM3からその時々の検出温度T(A/D変換値)に対応した逓倍数設定値FMULRを読み出してそれをCR発振回路8内のレジスタに与え、PLL回路13の逓倍数を制御する。上述したように、本実施形態では分周比設定値FDIVRを一定としている。   Therefore, in the present embodiment, the CPU 2 stores the multiplication number setting value FMULR and the detected temperature T (actually an A / D conversion value) in association with each other in the EEPROM 3, and stores the detected temperature T (A / D) from the EEPROM 3 at that time. The multiplication number setting value FMULR corresponding to the (D conversion value) is read and given to the register in the CR oscillation circuit 8 to control the multiplication number of the PLL circuit 13. As described above, in this embodiment, the frequency division ratio setting value FDIVR is constant.

さらに、CPU2は、マスタノードから送信されるフレームのうちシンクバイトフィールド(Synch Byte Field)を受信するごとに、クロック信号CLKを計数することにより1ビット時間(単位ビット長に相当)を計測し、その計数値XAと1ビット時間に対する基準周期に基づく基準計数値XB(=1ビット時間/基準周期)とに基づいて、検出温度Tに対応する逓倍数設定値FMULRを補正し、当該補正後の逓倍数設定値FMULRを当該検出温度T(A/D変換値)に対応させてEEPROM3に書き込む。   Further, every time the CPU 2 receives a synch byte field from the frame transmitted from the master node, it counts the clock signal CLK to measure one bit time (corresponding to the unit bit length), Based on the count value XA and the reference count value XB based on the reference period for 1 bit time (= 1 bit time / reference period), the multiplier set value FMULR corresponding to the detected temperature T is corrected, and the corrected value The multiplication number setting value FMULR is written in the EEPROM 3 in correspondence with the detected temperature T (A / D conversion value).

以下、本実施形態の作用を図2ないし図4を参照しながら具体的に説明する。
まず、マイコン1を製品として出荷する前の検査工程で、逓倍数設定値FMULRの初期値を設定しEEPROM3に書き込む。すなわち、マイコン1を所定の温度Tの環境下で動作させ、クロック信号CLKが規定周波数(例えば4MHz)に一致するように逓倍数設定値FMULRを決定する。そして、A/D変換器6が出力するA/D変換値(検出温度Tと等価)と上記決定した逓倍数設定値FMULRとを対応させてEEPROM3に書き込む。これを複数の温度例えば−40℃、25℃、125℃の3点で実行する。
Hereinafter, the operation of the present embodiment will be described in detail with reference to FIGS.
First, in an inspection process before the microcomputer 1 is shipped as a product, an initial value of the multiplication number setting value FMULR is set and written to the EEPROM 3. That is, the microcomputer 1 is operated in an environment of a predetermined temperature T, and the multiplication number setting value FMULR is determined so that the clock signal CLK matches a specified frequency (for example, 4 MHz). Then, the A / D conversion value (equivalent to the detected temperature T) output from the A / D converter 6 and the determined multiplication number setting value FMULR are written in the EEPROM 3 in association with each other. This is performed at a plurality of temperatures, for example, -40 ° C, 25 ° C, and 125 ° C.

また、製品ごとに逓倍数設定値FMULRを決定して書き込むことに替えて、設計値または当該製品ロットの代表値等に基づいて逓倍数設定値FMULRを算出し、それをA/D変換値(検出温度T)に対応させてEEPROM3に書き込んでもよい。後述するように、マイコン1は、逓倍数設定値FMULRに多少の誤差が存在しても、その後の学習処理により誤差をキャンセルすることができる。   Further, instead of determining and writing the multiplication number setting value FMULR for each product, the multiplication number setting value FMULR is calculated based on the design value or the representative value of the product lot, and the A / D conversion value ( It may be written in the EEPROM 3 in correspondence with the detected temperature T). As will be described later, the microcomputer 1 can cancel the error by the subsequent learning process even if there is some error in the multiplication number setting value FMULR.

図2は、製品出荷後のマイコン1が実行するCR発振周期の補正処理を示すフローチャートである。CPU2は、ステップP1においてA/D変換器6からA/D変換値を入力する。このA/D変換値は、CR発振器12の温度Tに対応している。続いてステップP2に移行し、EEPROM3からA/D変換値(つまり検出温度T)に対応した逓倍数設定値FMULRを読み出し、ステップP3でそれをCR発振回路8内のレジスタに設定する。   FIG. 2 is a flowchart showing a CR oscillation cycle correction process executed by the microcomputer 1 after product shipment. The CPU 2 inputs an A / D conversion value from the A / D converter 6 in step P1. This A / D conversion value corresponds to the temperature T of the CR oscillator 12. Subsequently, the process proceeds to step P2, and the multiplication number setting value FMULR corresponding to the A / D conversion value (that is, the detected temperature T) is read from the EEPROM 3, and is set in a register in the CR oscillation circuit 8 in step P3.

A/D変換値に対応した逓倍数設定値FMULRが存在しない場合には、例えば当該A/D変換値を挟み込むように存在する2つのA/D変換値に対応した逓倍数設定値FMULRに基づいて一次関数で補間して逓倍数設定値FMULRを求めればよい。PLL回路13は、レジスタFMULRの値に従って原発振信号を逓倍し、その後一定の分周比設定値FDIVRに従って分周してクロック信号CLKを出力する。   When there is no multiplication number setting value FMULR corresponding to the A / D conversion value, for example, based on the multiplication number setting value FMULR corresponding to two A / D conversion values existing so as to sandwich the A / D conversion value. The multiplication value set value FMULR may be obtained by interpolation with a linear function. The PLL circuit 13 multiplies the original oscillation signal according to the value of the register FMULR, and then divides the frequency according to a constant frequency division ratio setting value FDIVR and outputs the clock signal CLK.

CPU2は、ステップP4においてLINのマスタノードから送信された同期信号を検出したか否かを判断する。図3は、LINのフレーム構成を示している。マスタノードから送信されたフレームのヘッダは、新たなフレームの開始を示す13ビット長のブレークフィールド、0x55のデータ値を持つシンクバイトフィールドおよび識別フィールドから構成されている。通信回路7がブレークフィールドとシンクバイトフィールドを受信した時点でそれがヘッダであることを認識できる。   The CPU 2 determines whether or not the synchronization signal transmitted from the LIN master node is detected in step P4. FIG. 3 shows a LIN frame configuration. The header of the frame transmitted from the master node includes a 13-bit break field indicating the start of a new frame, a sync byte field having a data value of 0x55, and an identification field. When the communication circuit 7 receives the break field and sync byte field, it can recognize that it is a header.

通信回路7が同期信号であるシンクバイトフィールドを含むヘッダを受信していない期間は、ステップP1ないしP4の処理を繰り返し実行する。この期間は、逓倍数設定値FMULRの補正がなされず、EEPROM3に既に記憶されている逓倍数設定値FMULRを用いてクロック信号CLKが生成される。   During a period in which the communication circuit 7 does not receive a header including a sync byte field that is a synchronization signal, the processes of steps P1 to P4 are repeatedly executed. During this period, the multiplication number setting value FMULR is not corrected, and the clock signal CLK is generated using the multiplication number setting value FMULR already stored in the EEPROM 3.

一方、通信回路7がシンクバイトフィールドを受信するとステップP5に移行し、1ビット長を計測する。具体的には、シンクバイトフィールドのスタートビットと第7ビットの両ダウンエッジの間の時間8Tbitをクロック信号CLKを計数することにより計測し、その計数値を8で除すことにより1ビット時間の計数値XAを得る。例えば、マスタノードが9600bpsの正確な通信レートで送信した場合、クロック信号CLKが正確に4MHzであれば計数値は416となる。この1ビット時間(1/9600=104.2μs)に対する基準周期(1/4MHz=0.25μs)に基づく計数値を基準計数値XBとする。   On the other hand, when the communication circuit 7 receives the sync byte field, the process proceeds to step P5 to measure the 1-bit length. Specifically, the time 8 Tbit between the start bit and the down edge of the seventh bit of the sync byte field is measured by counting the clock signal CLK, and the counted value is divided by 8 to obtain one bit time. A count value XA is obtained. For example, if the master node transmits at an accurate communication rate of 9600 bps, the count value is 416 if the clock signal CLK is exactly 4 MHz. A count value based on the reference period (1/4 MHz = 0.25 μs) with respect to this 1-bit time (1/9600 = 104.2 μs) is set as a reference count value XB.

CPU2は、ステップP6に移行し、以下の(1)式により補正後の逓倍数設定値FMULRを演算し、それをPLL回路13のレジスタに設定する。設定後、PLL回路13は補正後の新たな逓倍数設定値FMULRに従って原発振信号を逓倍する。
補正後のFMULR=現在のFMULR×XB/XA …(1)
The CPU 2 proceeds to step P6, calculates the corrected multiplication number setting value FMULR by the following equation (1), and sets it in the register of the PLL circuit 13. After the setting, the PLL circuit 13 multiplies the original oscillation signal in accordance with the corrected new multiplication number setting value FMULR.
FMULR after correction = Current FMULLR × XB / XA (1)

その後、ステップP7に移行し、補正後の逓倍数設定値FMULRをA/D変換値(検出温度T)に対応させてEEPROM3に書き込む。当該検出温度Tに対応する逓倍数設定値FMULRが既にEEPROM3に書き込まれている場合には周期設定値の更新(上書き)となり、書き込まれていない場合(補正前の逓倍数設定値FMULRを補間等により求めた場合)には、逓倍数設定値FMULRを新たにEEPROM3に書き込むことになる。以上のステップP1〜P7の処理は、繰り返し実行される。   Thereafter, the process proceeds to step P7, and the corrected multiplication number setting value FMULR is written in the EEPROM 3 in correspondence with the A / D conversion value (detected temperature T). When the multiplication number setting value FMULR corresponding to the detected temperature T has already been written in the EEPROM 3, the period setting value is updated (overwritten), and when it has not been written (the multiplication number setting value FMULR before correction is interpolated, etc.) ), The multiplication factor set value FMULR is newly written in the EEPROM 3. The processes in steps P1 to P7 are repeatedly executed.

図4は、温度変化に対するCR発振器12の発振周波数(黒丸)と逓倍数設定値FMULR(白丸)の特性を示している。(a)は補正前の特性で、(b)は検出温度TでCR発振器12の発振周波数がずれたと仮定した場合の逓倍数設定値FMULRの補正方法を示している。ただし、実際には発振周波数が検出温度Tだけで大きくずれることはなく、(b)に示す場合には少なくとも検出温度Tに近い温度範囲においても発振周波数がずれている。   FIG. 4 shows the characteristics of the oscillation frequency (black circle) and multiplication factor set value FMULR (white circle) of the CR oscillator 12 with respect to temperature change. (A) shows the characteristics before correction, and (b) shows a correction method for the multiplier set value FMULR when it is assumed that the oscillation frequency of the CR oscillator 12 has shifted at the detected temperature T. However, in actuality, the oscillation frequency does not deviate greatly only by the detected temperature T, and in the case shown in FIG.

CR発振器12は、一般に温度上昇とともに発振周波数が低下する特性を持っているため、逓倍数設定値FMULRは温度上昇とともに増加する特性となる。CPU2は、同期信号の検出を条件にステップP5〜P7を実行するごとに、そのときの検出温度Tに対応した逓倍数設定値FMULRを補正する。図4(b)に示す場合、CR発振器12の発振周波数ひいてはクロック信号CLKの周波数が低下したため計数値XAが減少し、当該検出温度Tにおける逓倍数設定値FMULRを増加させるような補正がなされている。   Since the CR oscillator 12 generally has a characteristic that the oscillation frequency decreases as the temperature rises, the multiplier setting value FMULR increases as the temperature rises. Each time the CPU 2 executes Steps P5 to P7 on the condition that the synchronization signal is detected, the CPU 2 corrects the multiplication number setting value FMULR corresponding to the detected temperature T at that time. In the case shown in FIG. 4B, the count value XA is decreased because the oscillation frequency of the CR oscillator 12 and thus the frequency of the clock signal CLK is decreased, and correction is performed so as to increase the multiplier set value FMULR at the detected temperature T. Yes.

以上説明したように、本実施形態によればCR発振器12の温度を示すA/D変換値とCR発振回路8の逓倍数を決める逓倍数設定値FMULRとを対応付けてEEPROM3に記憶する。そして、マイコン1の動作中は、A/D変換値(検出温度T)に応じた逓倍数設定値FMULRを読み出してCR発振回路8のレジスタに設定するので、温度変化によりCR発振器12の発振周波数がずれてもクロック信号CLKの周波数を一定化することができる。   As described above, according to the present embodiment, the A / D conversion value indicating the temperature of the CR oscillator 12 and the multiplication number setting value FMULR that determines the multiplication number of the CR oscillation circuit 8 are associated with each other and stored in the EEPROM 3. During the operation of the microcomputer 1, the multiplier setting value FMULR corresponding to the A / D conversion value (detected temperature T) is read and set in the register of the CR oscillation circuit 8. Even if the shift occurs, the frequency of the clock signal CLK can be made constant.

CPU2は、マスタノードから送られてくるフレームの同期信号を受信するごとに、クロック信号CLKを計数して1ビット長を計測する。LINでは、マスタノードから正確な通信レートでフレームが送信されてくるので、CPU2は、上記1ビット長のクロック信号CLKによる計数値XAと正規の1ビット時間を基準周期で除して得られる基準計数値XBとに基づいて逓倍数設定値FMULRを補正し、補正後の逓倍数設定値FMULRを検出温度Tに対応させてEEPROM3に書き込む。   Each time the CPU 2 receives a frame synchronization signal transmitted from the master node, the CPU 2 counts the clock signal CLK and measures the 1-bit length. In LIN, since a frame is transmitted from the master node at an accurate communication rate, the CPU 2 obtains the reference value obtained by dividing the count value XA by the 1-bit clock signal CLK and the regular 1-bit time by the reference period. Based on the count value XB, the multiplication number setting value FMULR is corrected, and the corrected multiplication number setting value FMULR is written in the EEPROM 3 in association with the detected temperature T.

これにより、マスタノードからの同期信号を受信するごとに、その時のCR発振器12の温度に対応した逓倍数設定値FMULRを最新の値に更新できる。また、当該温度に対応した逓倍数設定値FMULRが記憶されていない場合には、新たに生成して記憶することができる。つまり、マイコン1は、CR発振回路8の温度に対応した逓倍数設定値FMULRを次々に学習することができる。マイコン1は、LINの通信波形の波形を用いて補正を行うので、別に基準信号を準備する必要がない。   Thereby, every time a synchronization signal is received from the master node, the multiplication number setting value FMULR corresponding to the temperature of the CR oscillator 12 at that time can be updated to the latest value. Further, when the multiplication number setting value FMULR corresponding to the temperature is not stored, it can be newly generated and stored. That is, the microcomputer 1 can learn the multiplication number setting value FMULR corresponding to the temperature of the CR oscillation circuit 8 one after another. Since the microcomputer 1 performs correction using the waveform of the LIN communication waveform, it is not necessary to prepare a reference signal separately.

逓倍数設定値FMULRの初期値の数が少ない場合や初期値に誤差が存在する場合であっても、正確な規定通信レートを持つ同期信号を受信するに従って、温度補正に用いる逓倍数設定値FMULRを拡充することができる。また、CR発振器12に経年変化が生じた場合でも、逓倍数設定値FMULRを補正してクロック信号CLKの周波数を正確な値に一定に保つことができる。さらに、長時間に亘りマスタノードからの同期信号を受信することがなくても、その後受信すれば正しく補正することができる。これにより、ビットずれによる通信エラーを生ずることなくデータの送受信を行うことができる。   Even when the number of initial values of the multiplier setting value FMULR is small or when there is an error in the initial value, the multiplier setting value FMULR used for temperature correction is received as a synchronization signal having an accurate prescribed communication rate is received. Can be expanded. Further, even when the CR oscillator 12 changes with time, the multiplication number setting value FMULR can be corrected to keep the frequency of the clock signal CLK constant at an accurate value. Furthermore, even if the synchronization signal from the master node is not received for a long time, it can be corrected correctly if it is received thereafter. As a result, data can be transmitted and received without causing a communication error due to bit shift.

さらに、温度変化または経年変化にかかわらずクロック信号CLKの周波数が一定となるため、クロック信号CLKをシステムクロックとして用いることができる。その結果、発振子が不要となり、発振子を用いてシステムクロックを生成していた従来のマイコンに比べ低コストとなる。   Further, since the frequency of the clock signal CLK is constant regardless of temperature change or aging change, the clock signal CLK can be used as a system clock. As a result, an oscillator is not required, and the cost is lower than that of a conventional microcomputer that uses the oscillator to generate a system clock.

(第2の実施形態)
次に、本発明の第2の実施形態について図5および図6を参照しながら説明する。
本実施形態は、第1の実施形態に対しEEPROM3に記憶されている逓倍数設定値FMULRの補正方法が異なる。図5は、CR発振周期の補正処理を示すフローチャートであり、図2と同一の処理ステップには同一のステップ番号を付している。ステップP11では、次の(2)式により、補正後の逓倍数設定値FMULRと現在の(補正前の)逓倍数設定値FMULRとの差分ΔFMULRを求める。そして、EEPROM3に記憶されている全ての逓倍数設定値FMULRに対しそれぞれ差分ΔFMULRを加算する。
ΔFMULR=補正後のFMULR−現在のFMULR …(2)
(Second Embodiment)
Next, a second embodiment of the present invention will be described with reference to FIGS.
This embodiment is different from the first embodiment in a method of correcting the multiplication number setting value FMULR stored in the EEPROM 3. FIG. 5 is a flowchart showing a CR oscillation cycle correction process. The same process steps as those in FIG. 2 are denoted by the same step numbers. In Step P11, the difference ΔFMULR between the corrected multiplication number setting value FMULR and the current (uncorrected) multiplication number setting value FMULR is obtained by the following equation (2). Then, the difference ΔFMULR is added to all the multiplication number setting values FMULR stored in the EEPROM 3.
ΔFMULR = FMULR after correction−Current FMULR (2)

図6は、図4と同様に温度変動に対するCR発振器12の発振周波数(黒丸)と逓倍数設定値FMULR(白丸)の変化特性を示している。図6(b)に示すように、1つの検出温度Tにおける補正量ΔFMULRを、EEPROM3に記憶されている各温度に対応する全ての逓倍数設定値FMULRに一様に反映させている。この補正方法によれば、CR発振器12に経年変化が生じた場合に、全ての逓倍数設定値FMULRを一度に補正することができる。また、極端に高い温度や低い温度などのように発生頻度が少ない温度に対応した逓倍数設定値FMULRが補正されずに放置される事態を防ぐことができる。   FIG. 6 shows the change characteristics of the oscillation frequency (black circle) and multiplication factor set value FMULR (white circle) of the CR oscillator 12 with respect to temperature fluctuations as in FIG. As shown in FIG. 6B, the correction amount ΔFMULR at one detected temperature T is uniformly reflected in all the multiplication number setting values FMULR corresponding to each temperature stored in the EEPROM 3. According to this correction method, when a secular change occurs in the CR oscillator 12, all the multiplication number setting values FMULR can be corrected at a time. Further, it is possible to prevent the multiplication number setting value FMULR corresponding to a temperature with a low occurrence frequency such as an extremely high temperature or a low temperature from being left uncorrected.

なお、上述した補正方法に替えて、EEPROM3に記憶されている全ての逓倍数設定値FMULRに対し、それぞれ差分ΔFMULRを各温度に応じて重み付けして得た値を加算してもよい。経年変化による発振周波数のずれが温度に依存する場合には、そのずれの傾向に合わせた重み付けをすることにより一層正確な補正を行うことができる。   Instead of the correction method described above, a value obtained by weighting the difference ΔFMULR according to each temperature may be added to all multiplication number setting values FMULR stored in the EEPROM 3. When the deviation of the oscillation frequency due to secular change depends on the temperature, more accurate correction can be performed by weighting according to the tendency of the deviation.

(第3の実施形態)
次に、本発明の第3の実施形態について図7を参照しながら説明する。
本実施形態も、第1の実施形態に対しEEPROM3に記憶されている逓倍数設定値FMULRの補正方法が異なる。図7は、CR発振周期の補正処理を示すフローチャートであり、図2と同一の処理ステップには同一のステップ番号を付している。
(Third embodiment)
Next, a third embodiment of the present invention will be described with reference to FIG.
This embodiment also differs from the first embodiment in the correction method of the multiplication number setting value FMULR stored in the EEPROM 3. FIG. 7 is a flowchart showing a CR oscillation cycle correction process. The same process steps as those in FIG. 2 are denoted by the same step numbers.

CPU2は、ステップP21において、(2)式により算出した差分ΔFMULRが3回連続して一致したか否かを判断する。ここで、一致している場合(YES)にはステップP7に移行し、補正後の逓倍数設定値FMULRをA/D変換値(検出温度T)に対応させてEEPROM3に書き込む。ただし、差分ΔFMULRが0の場合であって、既にEEPROM3に当該検出温度Tに対応した逓倍数設定値FMULRが書き込まれている場合には、書き込みは不要である。   In step P21, the CPU 2 determines whether or not the difference ΔFMULR calculated by the expression (2) coincides three times in succession. Here, if they match (YES), the process proceeds to step P7, and the corrected multiplication number setting value FMULR is written in the EEPROM 3 in correspondence with the A / D conversion value (detected temperature T). However, when the difference ΔFMULR is 0 and the multiplication number setting value FMULR corresponding to the detected temperature T is already written in the EEPROM 3, writing is not necessary.

一方、一致していない(NO)場合にはステップP22に移行し、補正後の逓倍数設定値FMULRが所定回数(例えば3回)連続して単調に増加または単調に減少しているか否かを判断する。単調に増減変化している場合(YES)にはステップP7に移行し、単調に変化していない場合(NO)にはステップP1に戻る。   On the other hand, if they do not match (NO), the process proceeds to step P22, and it is determined whether or not the corrected multiplication number setting value FMULR has increased or decreased monotonously continuously for a predetermined number of times (for example, 3 times). to decide. If the change is monotonous (YES), the process proceeds to Step P7. If the change is not monotonous (NO), the process returns to Step P1.

ステップP21を設けることによりフィルタ作用が得られ、計測誤差などによる逓倍数設定値FMULRの誤書き換えを防止できる。また、ステップP22を設けることにより、急激な温度変化が生じた場合に上記フィルタ作用により逓倍数設定値FMULRの書き換えが妨げられることまたは遅れることを防止できる。   By providing step P21, a filter action is obtained, and erroneous rewriting of the multiplication number set value FMULR due to a measurement error or the like can be prevented. In addition, by providing Step P22, it is possible to prevent rewriting of the multiplication factor set value FMULR from being hindered or delayed by the filter action when a sudden temperature change occurs.

(第4の実施形態)
次に、本発明の第4の実施形態について図8を参照しながら説明する。
図8は、CR発振周期の補正処理を示すフローチャートである。図2と同一の処理ステップには同一のステップ番号を付し、説明を省略する。ステップP6で補正後の逓倍数設定値FMULRを演算した後ステップP31に移行し、(2)式を用いて補正後の逓倍数設定値FMULRと現在の(補正前の)逓倍数設定値FMULRとの差分ΔFMULRを求め、その絶対値|ΔFMULR|を得る。
(Fourth embodiment)
Next, a fourth embodiment of the present invention will be described with reference to FIG.
FIG. 8 is a flowchart showing a CR oscillation cycle correction process. The same processing steps as those in FIG. 2 are denoted by the same step numbers, and description thereof is omitted. After calculating the corrected multiplication number setting value FMULR in step P6, the process proceeds to step P31, and using the equation (2), the corrected multiplication number setting value FMULR and the current (before correction) multiplication number setting value FMULR are calculated. Difference ΔFMULR is obtained, and its absolute value | ΔFMULR | is obtained.

続いて、ステップP32において、差分|ΔFMULR|と制限値Dmとを比較する。差分|ΔFMULR|が制限値Dm以下である場合にはステップP7に移行し、補正後の逓倍数設定値FMULRをEEPROM3に書き込む。一方、差分|ΔFMULR|が制限値Dmより大きい場合には、その補正後の逓倍数設定値FMULRを破棄し(PLL回路13のレジスタを補正前の値に戻す)、ステップP7を飛ばしてステップP1に戻る。想定される温度変動の最大幅に対応した逓倍数設定値FMULRの変化幅を制限値Dmとして設定すれば、それを超える誤った補正を回避することができる。   Subsequently, in step P32, the difference | ΔFMULR | is compared with the limit value Dm. If the difference | ΔFMULR | is equal to or less than the limit value Dm, the process proceeds to step P7, and the corrected multiplication number setting value FMULR is written in the EEPROM 3. On the other hand, when the difference | ΔFMULR | is larger than the limit value Dm, the corrected multiplication number setting value FMULR is discarded (the register of the PLL circuit 13 is returned to the value before correction), and step P7 is skipped and step P1 is skipped. Return to. If the change range of the multiplication number set value FMULR corresponding to the assumed maximum range of temperature fluctuation is set as the limit value Dm, erroneous correction exceeding that can be avoided.

(第5の実施形態)
次に、本発明の第5の実施形態について図9および図10を参照しながら説明する。
本実施形態は、第1の実施形態の構成を基にして、さらにCR発振回路8(CR発振器12)に印加される電源電圧Vccの変化によりCR発振器12の発振周波数がずれても、クロック信号CLKの周波数を一定化するものである。第1の実施形態と同様に、分周比設定値FDIVRを一定とし逓倍数設定値FMULRを補正する場合について説明する。
(Fifth embodiment)
Next, a fifth embodiment of the present invention will be described with reference to FIGS.
This embodiment is based on the configuration of the first embodiment, and even if the oscillation frequency of the CR oscillator 12 shifts due to a change in the power supply voltage Vcc applied to the CR oscillation circuit 8 (CR oscillator 12), the clock signal The frequency of CLK is made constant. Similar to the first embodiment, a case will be described in which the frequency division ratio setting value FDIVR is fixed and the multiplication number setting value FMULR is corrected.

図9は、マイコンの電気的構成を示す機能ブロック図であり、図1と同一構成部分には同一符号を付している。マイコン21は、分圧などにより電源電圧Vccを検出する電圧検出回路22(電圧検出手段に相当)を備えており、その検出した電圧はA/D変換器6に入力されている。   FIG. 9 is a functional block diagram showing the electrical configuration of the microcomputer. The same components as those in FIG. The microcomputer 21 includes a voltage detection circuit 22 (corresponding to voltage detection means) that detects the power supply voltage Vcc by voltage division or the like, and the detected voltage is input to the A / D converter 6.

CPU2は、EEPROM3に逓倍数設定値FMULRと検出温度T(実際にはA/D変換値)および検出電圧Vcc(実際にはA/D変換値)とを対応付けて記憶し、EEPROM3からその時々の検出温度T(A/D変換値)および検出電圧Vcc(A/D変換値)に対応した逓倍数設定値FMULRを読み出してそれをCR発振回路8内のレジスタに与え、PLL回路13の逓倍数を制御する。   The CPU 2 stores the multiplier set value FMULR, the detected temperature T (actually A / D converted value) and the detected voltage Vcc (actually A / D converted value) in the EEPROM 3 in association with each other. The multiplication number setting value FMULR corresponding to the detected temperature T (A / D conversion value) and the detection voltage Vcc (A / D conversion value) is read out and given to the register in the CR oscillation circuit 8 to multiply the PLL circuit 13 Control the number.

さらに、CPU2は、マスタノードから送信されるフレームのうちシンクバイトフィールドを受信するごとに、検出温度Tおよび検出電圧Vccに対応する逓倍数設定値FMULRを補正し、当該補正後の逓倍数設定値FMULRを当該検出温度T(A/D変換値)および検出電圧Vcc(A/D変換値)に対応させてEEPROM3に書き込む。   Further, every time the CPU 2 receives the sync byte field in the frame transmitted from the master node, the CPU 2 corrects the multiplication number setting value FMULR corresponding to the detected temperature T and the detection voltage Vcc, and the corrected multiplication number setting value. FMULR is written in the EEPROM 3 in correspondence with the detected temperature T (A / D converted value) and the detected voltage Vcc (A / D converted value).

マイコン21を製品として出荷する前の検査工程では、逓倍数設定値FMULRの初期値を設定しEEPROM3に書き込む。すなわち、マイコン1を所定の温度Tおよび電源電圧Vccの環境下で動作させ、クロック信号CLKが規定周波数(例えば4MHz)に一致するように逓倍数設定値FMULRを決定する。そして、A/D変換器6が出力するA/D変換値(検出温度T、検出電圧Vccと等価)と上記決定した逓倍数設定値FMULRとを対応させてEEPROM3に書き込む。これを複数の温度(例えば−40℃、25℃、125℃)および複数の電圧(例えば4.95V、5.00V、5.05V)で実行し、組み合わせとして9個の逓倍数設定値FMULRを得る。なお、設計値または代表値等に基づいて逓倍数設定値FMULRを決定してもよい。   In the inspection process before the microcomputer 21 is shipped as a product, the initial value of the multiplier setting value FMULR is set and written to the EEPROM 3. That is, the microcomputer 1 is operated under the environment of the predetermined temperature T and the power supply voltage Vcc, and the multiplication number set value FMULR is determined so that the clock signal CLK matches a specified frequency (for example, 4 MHz). Then, the A / D conversion value (equivalent to the detection temperature T and the detection voltage Vcc) output from the A / D converter 6 and the determined multiplication number setting value FMULR are written in the EEPROM 3 in association with each other. This is executed at a plurality of temperatures (for example, −40 ° C., 25 ° C., 125 ° C.) and a plurality of voltages (for example, 4.95 V, 5.00 V, 5.05 V), and nine multiplication setting values FMULR are combined as combinations. obtain. Note that the multiplication factor set value FMULR may be determined based on a design value or a representative value.

図10は、マイコン21が実行するCR発振周期の補正処理を示すフローチャートであり、図2に示す処理と同一の処理には同一のステップ番号を付している。CPU2は、ステップP41において、CR発振器12の温度Tに対応するA/D変換値と、CR発振器12に供給される電源電圧Vccに対応するA/D変換値とを入力する。続いてステップP42に移行し、EEPROM3からA/D変換値(つまり検出温度Tと検出電圧Vcc)に対応した逓倍数設定値FMULRを読み出し、ステップP3でそれをCR発振回路8内のレジスタに設定する。その後、既述したステップP3〜P6を経て補正後の逓倍数設定値FMULRを演算し、ステップP47で補正後の逓倍数設定値FMULRをA/D変換値(検出温度T、検出電圧Vcc)に対応させてEEPROM3に書き込む。   FIG. 10 is a flowchart showing a CR oscillation cycle correction process executed by the microcomputer 21, and the same step numbers are assigned to the same processes as those shown in FIG. In step P41, the CPU 2 inputs an A / D conversion value corresponding to the temperature T of the CR oscillator 12 and an A / D conversion value corresponding to the power supply voltage Vcc supplied to the CR oscillator 12. Subsequently, the process proceeds to step P42, and the multiplication number setting value FMULR corresponding to the A / D conversion value (that is, the detected temperature T and the detected voltage Vcc) is read from the EEPROM 3, and is set in the register in the CR oscillation circuit 8 in step P3. To do. Thereafter, the corrected multiplication number setting value FMULR is calculated through the steps P3 to P6 described above, and the corrected multiplication number setting value FMULR is converted into an A / D conversion value (detection temperature T, detection voltage Vcc) in step P47. Write to the EEPROM 3 correspondingly.

本実施形態によれば、第1の実施形態と同様の効果が得られる他、温度変化のみならず電源電圧変化によりCR発振器12の発振周波数がずれても、クロック信号CLKの周波数を一定化することができる。   According to the present embodiment, the same effect as that of the first embodiment can be obtained, and the frequency of the clock signal CLK is made constant even when the oscillation frequency of the CR oscillator 12 is shifted due to not only the temperature change but also the power supply voltage change. be able to.

(第6の実施形態)
次に、本発明の第6の実施形態について図11および図12を参照しながら説明する。
図11は、車両用アクチュエータの制御システムの構成を示している。アクチュエータ31は、モータ32と該モータ32を制御するマイコン33とを搭載している。上位に位置するECU34(上位コンピュータに相当)および複数(図11では3個)のアクチュエータ31は、バス35により相互接続されてLINによる通信が可能となっている。ここで、ECU34がマスタノードであり、アクチュエータ31がスレーブノードである。
(Sixth embodiment)
Next, a sixth embodiment of the present invention will be described with reference to FIGS.
FIG. 11 shows the configuration of a control system for a vehicle actuator. The actuator 31 includes a motor 32 and a microcomputer 33 that controls the motor 32. The ECU 34 (corresponding to the host computer) and a plurality of (three in FIG. 11) actuators 31 located at the upper level are interconnected by a bus 35 and can communicate by LIN. Here, the ECU 34 is a master node, and the actuator 31 is a slave node.

アクチュエータ31のマイコン33は、上述したマイコン1またはマイコン21と同様の電気的構成を備えているが、CPU2が実行する処理内容が一部異なっている。以下では、マイコン1と同様の電気的構成を備えているものについて説明する。なお、通信回路7は、データの送信も可能であって、本発明でいう受信手段およびデータ送信装置に相当する。   The microcomputer 33 of the actuator 31 has the same electrical configuration as that of the microcomputer 1 or the microcomputer 21 described above, but the processing content executed by the CPU 2 is partially different. Below, what is provided with the same electrical configuration as the microcomputer 1 is demonstrated. The communication circuit 7 can also transmit data, and corresponds to the receiving means and the data transmitting apparatus referred to in the present invention.

図12は、CR発振周期の補正処理を示すフローチャートである。CPU2は、ステップP5で1ビット時間の計数値XAを得た後、自ら逓倍数設定値FMULRの補正演算をするのではなく、ステップP51で現在の(補正前の)逓倍数設定値FMULR、計数値XAおよびA/D変換値(検出温度T)をECU34に送信する。   FIG. 12 is a flowchart showing a CR oscillation cycle correction process. After obtaining the count value XA for one bit time in step P5, the CPU 2 does not perform the correction calculation of the multiplication number setting value FMULR by itself, but in step P51, the current multiplication number setting value FMULR The numerical value XA and the A / D conversion value (detected temperature T) are transmitted to the ECU 34.

ECU34は、アクチュエータ31からこれらのデータを受信すると、アクチュエータ31のマイコン33に代わって(1)式を用いて逓倍数設定値FMULRの補正演算をし、その演算した値と書き換えるべきデータ(記憶すべきEEPROM3のアドレス)とを含む書き換え指令をアクチュエータ31に送信する。1ビット時間の計数値XAは、ECU34が自ら有している。マイコン33は、ステップP52で書き換え指令を受信し、受信した補正後の逓倍数設定値FMULRをPLL回路13のレジスタに設定する。続くステップP7で、受信した補正後の逓倍数設定値FMULRをA/D変換値(検出温度T)に対応させてEEPROM3に書き込む。   When the ECU 34 receives these data from the actuator 31, the ECU 34 corrects the multiplication number set value FMULR using the equation (1) instead of the microcomputer 33 of the actuator 31, and rewrites the calculated value and data to be rewritten (stored). A rewrite command including the address of the power EEPROM 3 is transmitted to the actuator 31. The ECU 34 has a count value XA for one bit time. The microcomputer 33 receives the rewrite command in step P52 and sets the received corrected multiplication number setting value FMULR in the register of the PLL circuit 13. In subsequent step P7, the received corrected multiplication number setting value FMULR is written in the EEPROM 3 in correspondence with the A / D conversion value (detected temperature T).

アクチュエータ31のマイコン33は、発振子レスとすることで小規模で安価な構成とした点に特に有用性があるが、その分だけ処理能力を切り詰めた設計となっている。本実施形態によれば、マイコン33の処理負担を軽減することができるので、マイコン33の持つ演算処理能力の不足を補うことができる。   The microcomputer 33 of the actuator 31 is particularly useful in that the configuration is small and inexpensive by eliminating an oscillator, but the processing capacity is reduced by that amount. According to the present embodiment, the processing load on the microcomputer 33 can be reduced, so that the shortage of the arithmetic processing capability of the microcomputer 33 can be compensated.

(その他の実施形態)
なお、本発明は上記し且つ図面に示す各実施形態に限定されるものではなく、例えば以下のように変形または拡張が可能である。
第5の実施形態に対しても第2の実施形態と同様の変形が可能である。すなわち、CPU2は、(2)式により差分ΔFMULRを求め、EEPROM3に記憶されている各温度および各電源電圧に対応した全ての逓倍数設定値FMULRに対しそれぞれ差分ΔFMULRを加算してもよい。また、EEPROM3に記憶されている各温度および各電源電圧に対応した全ての逓倍数設定値FMULRに対し、それぞれ差分ΔFMULRを各温度および電源電圧に応じて重み付けして得た値を加算してもよい。
(Other embodiments)
The present invention is not limited to the embodiments described above and shown in the drawings, and can be modified or expanded as follows, for example.
The fifth embodiment can be modified similarly to the second embodiment. That is, the CPU 2 may obtain the difference ΔFMULR by the equation (2) and add the difference ΔFMULR to all the multiplication number setting values FMULR corresponding to each temperature and each power supply voltage stored in the EEPROM 3. Alternatively, the value obtained by weighting the difference ΔFMULR according to each temperature and power supply voltage to each multiplication number setting value FMULR corresponding to each temperature and each power supply voltage stored in the EEPROM 3 may be added. Good.

第5の実施形態に対しても第3の実施形態と同様の変形が可能である。すなわち、CPU2は、差分ΔFMULRが所定回数だけ連続して一致した場合に、補正後の逓倍数設定値FMULRをA/D変換値(検出温度Tと検出電圧Vcc)に対応させてEEPROM3に書き込むようにしてもよい。一致していない場合でも、補正後の逓倍数設定値FMULRが所定回数だけ連続して単調に増加または単調に減少している場合には、補正後の逓倍数設定値FMULRをA/D変換値(検出温度Tと検出電圧Vcc)に対応させてEEPROM3に書き込むようにしてもよい。   The fifth embodiment can be modified similarly to the third embodiment. That is, when the difference ΔFMULR continuously matches a predetermined number of times, the CPU 2 writes the corrected multiplication number setting value FMULR in the EEPROM 3 in association with the A / D conversion value (detection temperature T and detection voltage Vcc). It may be. Even if they do not match, if the corrected multiplication number setting value FMULR increases monotonously or decreases monotonously for a predetermined number of times, the corrected multiplication number setting value FMULR is converted into an A / D conversion value. You may make it write in EEPROM3 corresponding to (detection temperature T and detection voltage Vcc).

第5の実施形態に対して、第2の実施形態と同様の変形および第3の実施形態と同様の変形を同時に施してもよい。
発振回路と、CR発振器に供給される電源の電圧を検出する電圧検出手段と、周期設定値を検出電圧に関連付けて記憶する記憶手段と、検出電圧に対応した周期設定値を記憶手段から読み出して発振回路に与えるクロック周期設定手段と、受信手段と、受信するデータ信号の単位ビット長をクロック信号を計数することにより計測する計測手段と、計数値と基準計数値とに基づいて検出電圧に対応した周期設定値を補正するとともに、当該補正後の周期設定値を当該検出電圧に対応させて記憶手段に書き込む補正手段とを備えた構成としてもよい。
The fifth embodiment may be subjected to the same modification as the second embodiment and the same modification as the third embodiment at the same time.
An oscillation circuit; voltage detection means for detecting the voltage of a power source supplied to the CR oscillator; storage means for storing the cycle setting value in association with the detection voltage; and reading the cycle setting value corresponding to the detection voltage from the storage means. Corresponding to the detection voltage based on the count value and the reference count value, the clock cycle setting means to be given to the oscillation circuit, the reception means, the measurement means for measuring the unit bit length of the received data signal by counting the clock signal The cycle setting value may be corrected, and the correction unit may be configured to write the corrected cycle setting value to the storage unit in association with the detected voltage.

PLL回路13のレジスタに逓倍数設定値FMULRおよび分周比設定値FDIVRの初期値を設定しておけば、EEPROM3への初期値の書き込みを不要とすることができる。この場合も、マイコン1がマスタノードからの同期信号を受信するごとに、その時のCR発振器12の温度に対応した逓倍数設定値FMULRが新たなデータとしてEEPROM3に記憶される。   If the initial values of the multiplication number setting value FMULR and the frequency division ratio setting value FDIVR are set in the register of the PLL circuit 13, writing of the initial values to the EEPROM 3 can be made unnecessary. Also in this case, every time the microcomputer 1 receives the synchronization signal from the master node, the multiplication number setting value FMULR corresponding to the temperature of the CR oscillator 12 at that time is stored in the EEPROM 3 as new data.

逓倍数設定値FMULRと分周比設定値FDIVRとを用いてクロック信号CLKの周波数を一定化する場合には、分周比設定値FDIVRも併せて検出温度或いは検出温度と電源電圧に対応させてEEPROM3に書き込めばよい。
受信手段はLINを用いて送受信する通信回路7に限られず、他の通信ネットワーク、通信形式でデータ信号を受信するものであってもよい。
When the frequency of the clock signal CLK is made constant using the multiplication number setting value FMULR and the division ratio setting value FDIVR, the frequency division ratio setting value FDIVR is also associated with the detected temperature or the detected temperature and the power supply voltage. What is necessary is just to write in EEPROM3.
The receiving means is not limited to the communication circuit 7 that transmits and receives using LIN, and may receive data signals in other communication networks and communication formats.

シンクバイトフィールドのスタートビットと第7ビットの両ダウンエッジの間の時間8Tbitを計数して計数値XAとし、この8Tbitに対する基準周期に基づく計数値を基準計数値XBとしてもよい。8Tbitを計測することは、1ビット時間Tbitを計測することと実質的に等価である。本発明でいう単位ビット長には、1ビット長に限らず所定単位を構成するビット長(2ビット長、…、8ビット長、…)も含まれる。   The time 8Tbit between the start bit and the 7th bit down edge of the sync byte field may be counted as the count value XA, and the count value based on the reference period for the 8Tbit may be used as the reference count value XB. Measuring 8 Tbit is substantially equivalent to measuring 1 bit time Tbit. The unit bit length referred to in the present invention is not limited to 1 bit length but also includes bit lengths (2 bit length,..., 8 bit length,...) Constituting a predetermined unit.

第2の実施形態と第3の実施形態とを組み合わせることも可能である。例えば、差分ΔFMULRが3回連続して一致した場合に、EEPROM3に記憶されている全ての逓倍数設定値FMULRに対しそれぞれ差分ΔFMULRを加算する。補正後の逓倍数設定値FMULRが所定回数連続して単調に増加または減少している場合も同様である。   It is also possible to combine the second embodiment and the third embodiment. For example, when the difference ΔFMULR coincides three times in succession, the difference ΔFMULR is added to all the multiplication number setting values FMULR stored in the EEPROM 3. The same applies to the case where the corrected multiplication number setting value FMULR is monotonously increasing or decreasing a predetermined number of times.

抵抗16に替えて定電流回路を採用すると電源電圧Vccが変動する場合でも正確な温度検出が可能となる。温度検出手段は、温度検出回路9に限られず、温度を検出可能に構成される回路であればどのようなものであってもよい。   If a constant current circuit is employed instead of the resistor 16, accurate temperature detection is possible even when the power supply voltage Vcc varies. The temperature detection means is not limited to the temperature detection circuit 9 and may be any circuit as long as it is configured to detect the temperature.

本発明の第1の実施形態を示すマイクロコンピュータの電気的な機能ブロック図1 is an electrical functional block diagram of a microcomputer showing a first embodiment of the present invention. CR発振周期の補正処理を示すフローチャートFlow chart showing CR oscillation cycle correction processing LINのフレーム構成を示す図Diagram showing the frame structure of LIN CR発振器の発振周波数と逓倍数設定値FMULRの温度特性図Temperature characteristics diagram of oscillation frequency of CR oscillator and multiplier setting value FMULR 本発明の第2の実施形態を示す図2相当図FIG. 2 equivalent view showing the second embodiment of the present invention 図4相当図4 equivalent diagram 本発明の第3の実施形態を示す図2相当図FIG. 2 equivalent view showing the third embodiment of the present invention 本発明の第4の実施形態を示す図2相当図FIG. 2 equivalent view showing a fourth embodiment of the present invention 本発明の第5の実施形態を示す図1相当図FIG. 1 equivalent view showing a fifth embodiment of the present invention 図2相当図2 equivalent diagram 本発明の第6の実施形態を示す車両用アクチュエータの制御システムの構成図The block diagram of the control system of the actuator for vehicles which shows the 6th Embodiment of this invention 図2相当図2 equivalent diagram

符号の説明Explanation of symbols

1、21、33はマイクロコンピュータ、2はCPU(クロック周期設定手段、計測手段、補正手段)、3はEEPROM(記憶手段)、7は通信回路(受信手段、データ送信装置)、8はCR発振回路、9は温度検出回路(温度検出手段)、12はCR発振器、22は電圧検出回路(電圧検出手段)、34はECU(上位コンピュータ)である。   1, 2 and 33 are microcomputers, 2 is a CPU (clock cycle setting means, measurement means, correction means), 3 is an EEPROM (storage means), 7 is a communication circuit (reception means, data transmission device), and 8 is a CR oscillation. A circuit, 9 is a temperature detection circuit (temperature detection means), 12 is a CR oscillator, 22 is a voltage detection circuit (voltage detection means), and 34 is an ECU (upper computer).

Claims (14)

CR発振器の発振信号を周期設定値に基づいて逓倍または分周してクロック信号を出力する発振回路と、
前記CR発振器周辺の温度を検出する温度検出手段と、
前記周期設定値を前記温度検出手段により検出された温度に関連付けて記憶する記憶手段と、
前記温度検出手段により検出された温度に対応した周期設定値を前記記憶手段から読み出して前記発振回路に与えるクロック周期設定手段と、
前記クロック信号を用いてデータ信号を受信する受信手段と、
前記受信手段で受信するデータ信号の単位ビット長を前記クロック信号を計数することにより計測する計測手段と、
前記計測手段による前記クロック信号の計数値と前記単位ビット長に対する基準周期に基づく基準計数値とに基づいて、前記温度検出手段により検出された温度に対応した周期設定値を補正するとともに、当該補正後の周期設定値を当該検出温度に対応させて前記記憶手段に書き込む補正手段とを備えていることを特徴とするデータ受信装置。
An oscillation circuit that outputs a clock signal by multiplying or dividing the oscillation signal of the CR oscillator based on the period setting value;
Temperature detecting means for detecting the temperature around the CR oscillator;
Storage means for storing the cycle set value in association with the temperature detected by the temperature detection means;
A clock cycle setting unit that reads a cycle set value corresponding to the temperature detected by the temperature detection unit from the storage unit and supplies the cycle setting value to the oscillation circuit;
Receiving means for receiving a data signal using the clock signal;
Measuring means for measuring a unit bit length of a data signal received by the receiving means by counting the clock signal;
Based on the count value of the clock signal by the measuring means and the reference count value based on the reference period for the unit bit length, the period setting value corresponding to the temperature detected by the temperature detecting means is corrected, and the correction A data receiving apparatus comprising: a correction unit that writes a later cycle set value in the storage unit in association with the detected temperature.
前記補正手段は、前記補正後の周期設定値と当該検出温度に対応した補正前の周期設定値との差分を演算し、前記記憶手段に記憶されている各温度に対応した周期設定値に前記差分を加算することを特徴とする請求項1記載のデータ受信装置。   The correction means calculates a difference between the corrected period setting value and the period setting value before correction corresponding to the detected temperature, and sets the period setting value corresponding to each temperature stored in the storage means. The data receiving apparatus according to claim 1, wherein the difference is added. 前記補正手段は、前記補正後の周期設定値と当該検出温度に対応した補正前の周期設定値との差分を演算し、前記記憶手段に記憶されている各温度に対応した周期設定値に、前記差分を各温度に応じて重み付けして得た値を加算することを特徴とする請求項1記載のデータ受信装置。   The correction unit calculates a difference between the corrected period setting value and the period setting value before correction corresponding to the detected temperature, and sets the period setting value corresponding to each temperature stored in the storage unit. 2. The data receiving apparatus according to claim 1, wherein a value obtained by weighting the difference according to each temperature is added. 前記補正手段は、補正により得られる周期設定値が所定回数だけ連続して一致した場合に、当該補正後の周期設定値を前記温度検出手段により検出された温度に対応させて前記記憶手段に書き込むことを特徴とする請求項1記載のデータ受信装置。   The correction unit writes the corrected cycle setting value in the storage unit in correspondence with the temperature detected by the temperature detection unit when the cycle setting value obtained by the correction continuously matches a predetermined number of times. The data receiving apparatus according to claim 1. 前記補正手段は、補正により得られる周期設定値が所定回数だけ連続して一致しない場合であっても、補正により得られる周期設定値が所定回数だけ連続して単調に増加または減少した場合に、当該補正後の周期設定値を前記温度検出手段により検出された温度に対応させて前記記憶手段に書き込むことを特徴とする請求項4記載のデータ受信装置。   The correction means, even if the period setting value obtained by the correction does not coincide with the predetermined number of times continuously, when the period setting value obtained by the correction continuously increases or decreases by a predetermined number of times, 5. The data receiving apparatus according to claim 4, wherein the corrected period setting value is written in the storage unit in correspondence with the temperature detected by the temperature detecting unit. CR発振器の発振信号を周期設定値に基づいて逓倍または分周してクロック信号を出力する発振回路と、
前記CR発振器周辺の温度を検出する温度検出手段と、
前記CR発振器に供給される電源の電圧を検出する電圧検出手段と、
前記周期設定値を前記温度検出手段により検出された温度と前記電圧検出手段により検出された電圧とに関連付けて記憶する記憶手段と、
前記温度検出手段により検出された温度および前記電圧検出手段により検出された電圧に対応した周期設定値を前記記憶手段から読み出して前記発振回路に与えるクロック周期設定手段と、
前記クロック信号を用いてデータ信号を受信する受信手段と、
前記受信手段で受信するデータ信号の単位ビット長を前記クロック信号を計数することにより計測する計測手段と、
前記計測手段による前記クロック信号の計数値と前記単位ビット長に対する基準周期に基づく基準計数値とに基づいて、前記温度検出手段により検出された温度および前記電圧検出手段により検出された電圧に対応した周期設定値を補正するとともに、当該補正後の周期設定値を当該検出温度および検出電圧に対応させて前記記憶手段に書き込む補正手段とを備えていることを特徴とするデータ受信装置。
An oscillation circuit that outputs a clock signal by multiplying or dividing the oscillation signal of the CR oscillator based on the period setting value;
Temperature detecting means for detecting the temperature around the CR oscillator;
Voltage detecting means for detecting a voltage of a power source supplied to the CR oscillator;
Storage means for storing the cycle set value in association with the temperature detected by the temperature detection means and the voltage detected by the voltage detection means;
A clock cycle setting unit that reads out the cycle setting value corresponding to the temperature detected by the temperature detection unit and the voltage detected by the voltage detection unit from the storage unit and supplies the cycle setting value to the oscillation circuit;
Receiving means for receiving a data signal using the clock signal;
Measuring means for measuring a unit bit length of a data signal received by the receiving means by counting the clock signal;
Based on the count value of the clock signal by the measuring means and the reference count value based on the reference period for the unit bit length, the temperature detected by the temperature detecting means and the voltage detected by the voltage detecting means correspond to A data receiving apparatus comprising: a correcting unit that corrects the cycle set value and writes the corrected cycle set value in the storage unit in correspondence with the detected temperature and the detected voltage.
前記補正手段は、前記補正後の周期設定値と当該検出温度および検出電圧に対応した補正前の周期設定値との差分を演算し、前記記憶手段に記憶されている各温度および各電圧に対応した周期設定値に前記差分を加算することを特徴とする請求項6記載のデータ受信装置。   The correction means calculates a difference between the corrected period setting value and the period setting value before correction corresponding to the detected temperature and detection voltage, and corresponds to each temperature and each voltage stored in the storage means. The data receiving apparatus according to claim 6, wherein the difference is added to the cycle setting value. 前記補正手段は、前記補正後の周期設定値と当該検出温度および検出電圧に対応した補正前の周期設定値との差分を演算し、前記記憶手段に記憶されている各温度および電圧に対応した周期設定値に、前記差分を各温度および電圧に応じて重み付けして得た値を加算することを特徴とする請求項6記載のデータ受信装置。   The correcting means calculates a difference between the corrected period setting value and the corrected period setting value corresponding to the detected temperature and detection voltage, and corresponds to each temperature and voltage stored in the storage means. 7. The data receiving apparatus according to claim 6, wherein a value obtained by weighting the difference according to each temperature and voltage is added to the period setting value. 前記補正手段は、補正により得られる周期設定値が所定回数だけ連続して一致した場合に、当該補正後の周期設定値を前記温度検出手段により検出された温度および前記電圧検出手段により検出された電圧に対応させて前記記憶手段に書き込むことを特徴とする請求項6記載のデータ受信装置。   The correction means detects the corrected period setting value detected by the temperature detection means and the voltage detection means when the period setting values obtained by the correction coincide with each other a predetermined number of times. 7. The data receiving apparatus according to claim 6, wherein the data is written in the storage unit in correspondence with a voltage. 前記補正手段は、補正により得られる周期設定値が所定回数だけ連続して一致しない場合であっても、補正により得られる周期設定値が所定回数だけ連続して単調に増加または減少した場合に、当該補正後の周期設定値を前記温度検出手段により検出された温度および前記電圧検出手段により検出された電圧に対応させて前記記憶手段に書き込むことを特徴とする請求項9記載のデータ受信装置。   The correction means, even if the period setting value obtained by the correction does not coincide with the predetermined number of times continuously, when the period setting value obtained by the correction continuously increases or decreases by a predetermined number of times, 10. The data receiving apparatus according to claim 9, wherein the corrected period setting value is written in the storage unit in correspondence with the temperature detected by the temperature detecting unit and the voltage detected by the voltage detecting unit. 前記計測手段は、前記受信手段で受信するデータ信号に含まれる所定の同期信号を検出したときに前記単位ビット長を計測することを特徴とする請求項1ないし10の何れかに記載のデータ受信装置。   11. The data reception according to claim 1, wherein the measuring unit measures the unit bit length when a predetermined synchronization signal included in a data signal received by the receiving unit is detected. apparatus. 前記補正手段は、前記補正後の周期設定値と補正前の周期設定値との差分を演算し、その差分が所定の制限値以下であることを条件として前記周期設定値の補正および前記記憶手段への書き込みを実行することを特徴とする請求項1ないし11の何れかに記載のデータ受信装置。   The correction means calculates a difference between the period setting value after correction and the period setting value before correction, and the correction of the period setting value and the storage means on condition that the difference is equal to or less than a predetermined limit value. The data receiving device according to claim 1, wherein the data receiving device executes writing into the data. 請求項1ないし12の何れかに記載のデータ受信装置を備え、前記発振回路から出力されるクロック信号をシステムクロック信号とすることを特徴とするマイクロコンピュータ。   13. A microcomputer comprising the data receiving device according to claim 1, wherein a clock signal output from the oscillation circuit is a system clock signal. データ信号を送信するデータ送信装置を備え、
前記データ受信装置の補正手段が周期設定値の補正演算を実行することに替えて、前記データ受信装置の計測手段によるクロック信号の計数値と記憶手段から読み出された周期設定値とを前記データ送信装置により上位コンピュータに送信し、その上位コンピュータにおいて前記クロック信号の計数値とデータ信号の単位ビット長に対する基準周期に基づく基準計数値とに基づいて補正された周期設定値を受信し、この受信した補正後の周期設定値を前記発振回路に設定するとともに前記データ受信装置の記憶手段に書き込むことを特徴とする請求項13記載のマイクロコンピュータ。
A data transmission device for transmitting a data signal;
Instead of the correction means of the data receiving apparatus executing the correction operation of the period setting value, the count value of the clock signal by the measuring means of the data receiving apparatus and the period setting value read from the storage means are used as the data. Transmitted to a higher-level computer by a transmission device, and receives a cycle setting value corrected based on the count value of the clock signal and a reference count value based on a reference cycle with respect to a unit bit length of the data signal in the higher-level computer. 14. The microcomputer according to claim 13, wherein the corrected period setting value is set in the oscillation circuit and written to the storage means of the data receiving device.
JP2008151618A 2007-10-12 2008-06-10 Data receiving apparatus and microcomputer Expired - Fee Related JP4462371B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2008151618A JP4462371B2 (en) 2007-10-12 2008-06-10 Data receiving apparatus and microcomputer
US12/285,581 US8099621B2 (en) 2007-10-12 2008-10-09 Data reception apparatus and microcomputer having the same

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2007266843 2007-10-12
JP2008151618A JP4462371B2 (en) 2007-10-12 2008-06-10 Data receiving apparatus and microcomputer

Publications (2)

Publication Number Publication Date
JP2009111967A true JP2009111967A (en) 2009-05-21
JP4462371B2 JP4462371B2 (en) 2010-05-12

Family

ID=40779917

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008151618A Expired - Fee Related JP4462371B2 (en) 2007-10-12 2008-06-10 Data receiving apparatus and microcomputer

Country Status (1)

Country Link
JP (1) JP4462371B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012199622A (en) * 2011-03-18 2012-10-18 Denso Corp Oscillation frequency correction apparatus
JP2016122901A (en) * 2014-12-24 2016-07-07 国立大学法人東北大学 Receiving data restoration device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11340820A (en) * 1998-05-26 1999-12-10 Alps Electric Co Ltd Reference oscillating frequency setting system for data communication equipment
JP2006121171A (en) * 2004-10-19 2006-05-11 Matsushita Electric Ind Co Ltd Clock supplying device with frequency correction function
JP2006270917A (en) * 2005-02-28 2006-10-05 Denso Corp Microcomputer
JP2007194711A (en) * 2006-01-17 2007-08-02 Denso Corp Microcomputer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11340820A (en) * 1998-05-26 1999-12-10 Alps Electric Co Ltd Reference oscillating frequency setting system for data communication equipment
JP2006121171A (en) * 2004-10-19 2006-05-11 Matsushita Electric Ind Co Ltd Clock supplying device with frequency correction function
JP2006270917A (en) * 2005-02-28 2006-10-05 Denso Corp Microcomputer
JP2007194711A (en) * 2006-01-17 2007-08-02 Denso Corp Microcomputer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012199622A (en) * 2011-03-18 2012-10-18 Denso Corp Oscillation frequency correction apparatus
JP2016122901A (en) * 2014-12-24 2016-07-07 国立大学法人東北大学 Receiving data restoration device

Also Published As

Publication number Publication date
JP4462371B2 (en) 2010-05-12

Similar Documents

Publication Publication Date Title
JP6832777B2 (en) Semiconductor device
JP6140459B2 (en) Sensor data transmission device
US7260657B2 (en) Serial data transferring apparatus
US20110026572A1 (en) Baud rate error detection circuit and baud rate error detection method
JP4462371B2 (en) Data receiving apparatus and microcomputer
CN112448874A (en) Vehicle-mounted communication device and time synchronization method thereof
EP3101552A1 (en) System and method of realignment of read data by spi controller
US7356719B2 (en) Microcomputer
KR101699047B1 (en) Apparatus and Method for Amending Clock Error for Vehicle
JP4487937B2 (en) Microcomputer
US8099621B2 (en) Data reception apparatus and microcomputer having the same
CN116170008A (en) Frequency compensation method, device, medium and clock system of oscillator
JP2016197807A (en) Communication device and communication method
US11507525B2 (en) High speed communication system
CN114500209A (en) Frequency offset compensation method, system, electronic device and computer readable storage medium
JP5565349B2 (en) Oscillation frequency correction device
US20060161367A1 (en) System and method for calibrating the clock frequency of a clock generator unit over a data line
JP4127535B2 (en) Oscillator frequency correction method
CN110233620B (en) Self-correction algorithm applied to clock system of USB slave device
CN115688649B (en) Time sequence early warning circuit system, method and digital integrated circuit
US11604483B2 (en) Current generator circuit and diagnostic circuit
JP2017033055A (en) Electronic control device, actuator, and sensor
CN102414567A (en) Correction device, probability density function measuring device, jitter measuring device, jitter separating device, electronic device, correction method, program, and recording medium
JP6102785B2 (en) Physical quantity sensor
JP2007333451A (en) Method for updating corrected value of incremental encoder

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090819

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090915

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100126

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100208

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

Free format text: PAYMENT UNTIL: 20130226

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4462371

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20140226

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees