JP2012154722A - Integrated circuit, integrated circuit device, rotation detector - Google Patents

Integrated circuit, integrated circuit device, rotation detector Download PDF

Info

Publication number
JP2012154722A
JP2012154722A JP2011012963A JP2011012963A JP2012154722A JP 2012154722 A JP2012154722 A JP 2012154722A JP 2011012963 A JP2011012963 A JP 2011012963A JP 2011012963 A JP2011012963 A JP 2011012963A JP 2012154722 A JP2012154722 A JP 2012154722A
Authority
JP
Japan
Prior art keywords
circuit
rotation
integrated circuit
signal
pulse
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
JP2011012963A
Other languages
Japanese (ja)
Other versions
JP5725284B2 (en
Inventor
Takashi Shimobayashi
隆 下林
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2011012963A priority Critical patent/JP5725284B2/en
Publication of JP2012154722A publication Critical patent/JP2012154722A/en
Application granted granted Critical
Publication of JP5725284B2 publication Critical patent/JP5725284B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Measuring Volume Flow (AREA)
  • Transmission And Conversion Of Sensor Element Output (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an integrated circuit, etc., for effectively suppressing a power consumption of a detection system by intermittently driving a processor in the manner of outputting a detected rotation as an interruption signal and also by changing a sampling period of a sensor in accordance with a stop period of the rotation.SOLUTION: An integrated circuit 10, which detects the rotation by using a first pulse and second pulse 200A, 200B output from the sensor, includes at least one side of a first circuit 11 to detect a positive rotation or a second circuit 12 to detect a reversed rotation based on the first pulse and second pulse, and also includes a third circuit 13 to count the rotation stop period based on the first pulse and second pulse. The first circuit 11 outputs a first interruption signal 211, and the second circuit 12 outputs a second interruption signal 212, and the third circuit outputs a signal 213 for showing the rotation stop period.

Description

本発明は、集積回路、集積回路装置、回転検出装置等に関する。   The present invention relates to an integrated circuit, an integrated circuit device, a rotation detection device, and the like.

検出装置等で複数のサンプリング周期を切り換えることで消費電力を抑える手法が知られている。例えば特許文献1は、検出装置の一例である電子式水道メーターにおいて、流量に基づく回転体の回転を正常時のサンプリング結果と比較して、異常と判断した場合に限ってサンプリング周期を短くする。そのため、低消費電力化が図れる。   There is known a technique for suppressing power consumption by switching a plurality of sampling periods with a detection device or the like. For example, in Patent Document 1, in an electronic water meter that is an example of a detection device, the rotation of a rotating body based on a flow rate is compared with a normal sampling result, and the sampling cycle is shortened only when it is determined to be abnormal. Therefore, power consumption can be reduced.

特開平8−94401号公報JP-A-8-94401

電子式水道メーターなどの検出装置は、一般にセンサーとその出力を処理するプロセッサーを含む。プロセッサーとは、例えばCPUやマイクロコントローラー(以下、MCU)等である。特許文献1では、センサー(回転検出器)とCPUとを含むが、開示された方法で低消費電力化を図ることができるのはセンサーのみである。そのため、CPUも含めた更なる低消費電力化は困難であった。   Detection devices such as electronic water meters generally include a sensor and a processor that processes its output. The processor is, for example, a CPU or a microcontroller (hereinafter referred to as MCU). Patent Document 1 includes a sensor (rotation detector) and a CPU, but only the sensor can achieve low power consumption by the disclosed method. Therefore, it has been difficult to further reduce power consumption including the CPU.

本発明はこのような問題点に鑑みてなされたものである。本発明のいくつかの態様によれば、検出された回転を割り込み信号として出力することでプロセッサーを間欠駆動させて、かつ、回転の停止期間に応じてセンサーのサンプリング周期を変えることで、効果的に検出システムの電力消費を抑える集積回路等を提供することができる。   The present invention has been made in view of such problems. According to some aspects of the present invention, it is effective to intermittently drive the processor by outputting the detected rotation as an interrupt signal and to change the sampling period of the sensor according to the rotation stop period. In addition, an integrated circuit or the like that suppresses power consumption of the detection system can be provided.

(1)本発明は、センサーから出力される第1のパルスと第2のパルスを用いて回転を検出する集積回路であって、前記第1のパルスと前記第2のパルスに基づいて、正回転検出を行う第1の回路および逆回転検出を行う第2の回路の少なくとも一方と、前記第1のパルスと前記第2のパルスに基づいて回転停止期間をカウントする第3の回路と、を含み、前記第1の回路は、第1の割り込み信号を出力し、前記第2の回路は、第2の割り込み信号を出力し、前記第3の回路は、前記回転停止期間を示す信号を出力する。 (1) The present invention is an integrated circuit that detects rotation using a first pulse and a second pulse output from a sensor, and is based on the first pulse and the second pulse. At least one of a first circuit that performs rotation detection and a second circuit that performs reverse rotation detection; and a third circuit that counts a rotation stop period based on the first pulse and the second pulse. The first circuit outputs a first interrupt signal, the second circuit outputs a second interrupt signal, and the third circuit outputs a signal indicating the rotation stop period. To do.

本発明によれば、検出された回転を割り込み信号(第1の割り込み信号、第2の割り込み信号)として出力することで外部のプロセッサーを間欠駆動させる。そのため、割り込み信号が発生しない間、プロセッサーは例えば休止状態であってもよいのでシステムの消費電力を小さくできる。   According to the present invention, an external processor is intermittently driven by outputting the detected rotation as an interrupt signal (first interrupt signal, second interrupt signal). Therefore, while the interrupt signal is not generated, the processor may be in a sleep state, for example, so that the power consumption of the system can be reduced.

また、本発明によれば、第3の回路からの回転停止期間を示す信号によって、例えばプロセッサーが回転停止期間に応じたセンサーのサンプリング周期を選択する。そのため、センサーが消費する電力を抑えることができるので、システムの消費電力を小さくできる。   Further, according to the present invention, for example, the processor selects the sampling period of the sensor corresponding to the rotation stop period based on the signal indicating the rotation stop period from the third circuit. Therefore, the power consumed by the sensor can be suppressed, and the power consumption of the system can be reduced.

なお、本発明では、センサーから出力される第1のパルスと第2のパルスを用いるので高い精度の回転検出を行うことができる。   In the present invention, since the first pulse and the second pulse output from the sensor are used, highly accurate rotation detection can be performed.

そして、第3の回路の回転停止期間を示す信号は、回転停止期間を示すカウント値であってもよいし、回転停止期間が所定の間継続したことを示すパルス信号であってもよい。このとき、パルス信号は割り込み信号として出力されてもよい。   The signal indicating the rotation stop period of the third circuit may be a count value indicating the rotation stop period or a pulse signal indicating that the rotation stop period has continued for a predetermined period. At this time, the pulse signal may be output as an interrupt signal.

(2)この集積回路において、発振回路を含み、前記第3の回路は、前記発振回路から出力されるクロックに基づいてカウントしてもよい。 (2) This integrated circuit may include an oscillation circuit, and the third circuit may count based on a clock output from the oscillation circuit.

本発明によれば、発振回路を含むことによって、発振回路から出力されるクロックに基づいて回転停止期間を正確に測定することが可能である。そして、正確な回転停止期間に基づいて、適切なセンサーのサンプリング周期を選択することで、効果的な低消費電力化を図ることが可能になる。   According to the present invention, it is possible to accurately measure the rotation stop period based on the clock output from the oscillation circuit by including the oscillation circuit. By selecting an appropriate sensor sampling period based on an accurate rotation stop period, it is possible to effectively reduce power consumption.

(3)この集積回路において、前記第3の回路は、カウント値が所定の値になった場合に、前記回転停止期間を示す信号として第3の割り込み信号を出力してもよい。 (3) In this integrated circuit, when the count value reaches a predetermined value, the third circuit may output a third interrupt signal as a signal indicating the rotation stop period.

本発明によれば、第3の回路は前記回転停止期間を示す信号として第3の割り込み信号を出力する。そのため、例えばプロセッサーが定期的に回転停止期間を示すカウント値を読み出す必要がなくなる。割り込み信号が発生しない間、プロセッサーは例えば休止状態であってもよいのでシステムの消費電力を小さくできる。   According to the present invention, the third circuit outputs a third interrupt signal as a signal indicating the rotation stop period. This eliminates the need for the processor to periodically read a count value indicating the rotation stop period, for example. While the interrupt signal is not generated, the processor may be in a sleep state, for example, so that the power consumption of the system can be reduced.

(4)この集積回路において、前記センサーの電源供給を制御する電源供給制御信号を出力してもよい。 (4) In this integrated circuit, a power supply control signal for controlling the power supply of the sensor may be output.

本発明によれば、センサーの電源を電源供給制御信号によって制御することで、効果的な低消費電力化を図ることが可能になる。このとき、第3の回路からの回転停止期間を示す信号によって電源供給制御信号を選択することが可能である。そのため、消費電力の比較的大きいセンサー部分の電力消費を、状況に応じて効果的に抑えることが可能になる。   According to the present invention, it is possible to effectively reduce the power consumption by controlling the power source of the sensor by the power supply control signal. At this time, the power supply control signal can be selected by a signal indicating the rotation stop period from the third circuit. Therefore, it is possible to effectively suppress the power consumption of the sensor portion having a relatively large power consumption according to the situation.

(5)本発明は、前記のいずれかに記載の集積回路を含む集積回路装置である。 (5) The present invention is an integrated circuit device including any of the integrated circuits described above.

本発明によれば、前記の集積回路を1チップ化した集積回路装置とすることで小型化することができ、適用範囲の広めることが可能になる。   According to the present invention, the integrated circuit can be miniaturized by making the integrated circuit into a single chip, and the applicable range can be widened.

(6)本発明は、前記のいずれかに記載の集積回路と、前記集積回路から割り込み信号を受け取るMCUと、を含み、前記MCUは、第1の動作モードにおいて回転量を算出し、第2の動作モードにおいて前記第1の動作モードより低消費電力で動作し、前記割り込み信号を受け取った場合に、前記第2の動作モードから前記第1の動作モードに遷移する回転検出装置である。 (6) The present invention includes the integrated circuit according to any one of the above and an MCU that receives an interrupt signal from the integrated circuit, and the MCU calculates a rotation amount in a first operation mode, In the operation mode, the rotation detection device operates with lower power consumption than the first operation mode and transitions from the second operation mode to the first operation mode when the interrupt signal is received.

MCU(Micro Controller Unit)は、例えばプロセッサーであると共にROMやRAMなどのメモリーやインターフェース関連の周辺機能等を含んでいる。そのため、常に通常動作のモード(第1の動作モード)であると消費電力が大きくなる可能性がある。本発明のMCUは、例えばパワーセーブモードのような、消費電力を通常動作時より小さくするモード(第2の動作モード)を有している。なお、通常動作とは例えば回転検出装置が行う回転数の計算である。   The MCU (Micro Controller Unit) is, for example, a processor and includes a memory such as a ROM and a RAM and peripheral functions related to an interface. For this reason, there is a possibility that the power consumption increases when the mode is always the normal operation mode (first operation mode). The MCU of the present invention has a mode (second operation mode) in which power consumption is made smaller than that during normal operation, such as a power save mode. The normal operation is, for example, calculation of the number of rotations performed by the rotation detection device.

本発明によれば、集積回路からの割り込み信号を受け取ることで、第2の動作モードから第1の動作モードに遷移する。MCUは、割り込みが発生しない間は第2の動作モードであり、消費電力を低く抑えることができる。   According to the present invention, when the interrupt signal is received from the integrated circuit, the second operation mode is changed to the first operation mode. The MCU is in the second operation mode while no interrupt occurs, and can reduce power consumption.

第1実施形態の集積回路のブロック図。The block diagram of the integrated circuit of 1st Embodiment. 第1実施形態の集積回路を含む集積回路装置と回転検出装置。An integrated circuit device including the integrated circuit of the first embodiment and a rotation detection device. 図3(A)は割り込みを説明する波形図。図3(B)は図3(A)の一部の拡大図。FIG. 3A is a waveform diagram for explaining an interrupt. FIG. 3B is an enlarged view of a part of FIG. 図4(A)は第1の割り込み処理のフローチャート。図4(B)は第2の割り込み処理のフローチャート。FIG. 4A is a flowchart of the first interrupt process. FIG. 4B is a flowchart of the second interrupt process. 図5(A)は第3の割り込み処理のフローチャート。図5(B)はタイマー割り込み処理のフローチャート。FIG. 5A is a flowchart of third interrupt processing. FIG. 5B is a flowchart of timer interrupt processing. 変形例のフローチャート。The flowchart of a modification. 図7(A)は回転検出装置が設置される流路の上面図。図7(B)はその部分断面図。FIG. 7A is a top view of a flow path in which the rotation detection device is installed. FIG. 7B is a partial cross-sectional view thereof. 図8(A)〜図8(C)は磁気センサーを説明する図。8A to 8C are diagrams illustrating a magnetic sensor.

1.第1実施形態
本発明の第1実施形態について図1〜図5(B)を参照して説明する。また、回転検出装置の動作について図7(A)〜図8(C)を参照して説明する。以下では、回転検出装置の動作について最初に説明し、その後に第1実施形態の集積回路等について説明する。
1. First Embodiment A first embodiment of the present invention will be described with reference to FIGS. 1 to 5B. Further, the operation of the rotation detection device will be described with reference to FIGS. 7 (A) to 8 (C). Below, operation | movement of a rotation detection apparatus is demonstrated first, and the integrated circuit etc. of 1st Embodiment are demonstrated after that.

1.1.回転検出装置の動作
回転検出装置の動作について、図7(A)〜図8(C)を参照して説明する。図7(A)は回転検出装置が設置される流路の上面図であり、図7(B)はその部分断面図を表す。なお、図7(A)では磁気センサーの図示は省略している。
1.1. Operation of Rotation Detection Device The operation of the rotation detection device will be described with reference to FIGS. 7 (A) to 8 (C). FIG. 7A is a top view of a flow path in which the rotation detection device is installed, and FIG. 7B shows a partial cross-sectional view thereof. In FIG. 7A, the magnetic sensor is not shown.

回転検出装置では、測定したい量(被測定量)を回転数に置き換えて、その回転数を例えば磁気センサーで検出して電気信号を出力する。電気信号は例えばMCUで処理されて被測定量が得られる。被測定量とは、例えば水等の液体の流量であってもよいし、圧力、温度、照度等であってもよい。以下では、液体の流量を測定する回転検出装置について説明する。例えば液体は水であり、このとき水道メーターに適用可能である。   In the rotation detection device, the amount to be measured (measured amount) is replaced with the rotation speed, and the rotation speed is detected by, for example, a magnetic sensor and an electric signal is output. The electric signal is processed by, for example, an MCU to obtain a measured amount. The amount to be measured may be a flow rate of a liquid such as water, or may be pressure, temperature, illuminance, or the like. Below, the rotation detection apparatus which measures the flow volume of a liquid is demonstrated. For example, the liquid is water, which can be applied to a water meter.

図7(A)では、液体の流路104に羽根車100が設置されている。液体が矢印X1の方向に流れる場合、羽根車100は矢印X2のように時計回りに回転する。回転数を測定することで液体の流量がわかる。ここで、羽根車100の軸には磁石102が取り付けられており、羽根車100が回転することで磁気が変化する。   In FIG. 7A, the impeller 100 is installed in the liquid flow path 104. When the liquid flows in the direction of the arrow X1, the impeller 100 rotates clockwise as indicated by the arrow X2. The liquid flow rate can be determined by measuring the number of rotations. Here, a magnet 102 is attached to the shaft of the impeller 100, and the magnetism changes as the impeller 100 rotates.

図7(B)は図7(A)の液体の流路104の断面図である。羽根車100の近くに、磁気センサー106が基板108に取り付けられて設置されている。このとき、磁気センサー106は羽根車100とは非接触である。磁気センサー106は、羽根車100が回転すると磁石102によって変化する磁気を検出する。そして、検出結果に基づいて電気信号を出力し、例えば基板108に取り付けられたMCU(図外)がその信号を受け取って回転数を計算する。また、MCUは回転数に基づいて液体の流量を計算する。   FIG. 7B is a cross-sectional view of the liquid flow path 104 in FIG. Near the impeller 100, a magnetic sensor 106 is attached to the substrate 108 and installed. At this time, the magnetic sensor 106 is not in contact with the impeller 100. The magnetic sensor 106 detects magnetism that is changed by the magnet 102 when the impeller 100 rotates. Then, an electric signal is output based on the detection result, and for example, an MCU (not shown) attached to the substrate 108 receives the signal and calculates the rotation speed. The MCU also calculates the liquid flow rate based on the number of rotations.

ここで、羽根車100が時計回りに回転することを正回転、反時計回りに回転することを逆回転とよぶ。逆回転は、液体が矢印X1とは逆の方向に流れることを示している。磁気センサー106は逆回転を検出できてもよい。このとき、MCUは逆回転を示す電気信号を受け取って回転数、液体の流量を調整してもよい。   Here, the rotation of the impeller 100 clockwise is called forward rotation, and the rotation of the impeller 100 counterclockwise is called reverse rotation. The reverse rotation indicates that the liquid flows in the direction opposite to the arrow X1. The magnetic sensor 106 may be able to detect reverse rotation. At this time, the MCU may receive an electrical signal indicating reverse rotation and adjust the rotational speed and the liquid flow rate.

図8(A)は、図7(B)の磁気センサー106が磁気を検出する様子を示すものである。磁気センサー106は、磁気により電気抵抗が変化する磁気抵抗素子R1〜R4で構成されるホイートストンブリッジ型の磁気検出回路70Aを含む。   FIG. 8A shows how the magnetic sensor 106 in FIG. 7B detects magnetism. The magnetic sensor 106 includes a Wheatstone bridge type magnetic detection circuit 70 </ b> A configured by magnetoresistive elements R <b> 1 to R <b> 4 whose electric resistance changes due to magnetism.

例えば、図8(A)では磁気抵抗素子R2とR3とを横切るように磁気が発生しているとする(図8(A)のX3)。このとき、例えば磁気抵抗素子R2とR3の抵抗値は“r”から“r+Δr”へと変化するが、磁気抵抗素子R1とR4の抵抗値は“r”のまま変化しない。その結果、信号A+の電位は上昇し、信号A−の電位は低下するので、コンパレーター72Aから出力される信号SRはローレベル(以下“0”とする)になる。逆に、磁気抵抗素子R1とR4とを横切るように磁気が発生した場合には、信号SRはハイレベル(以下“1”とする)になる。 For example, in FIG. 8A, it is assumed that magnetism is generated across the magnetoresistive elements R2 and R3 (X3 in FIG. 8A). At this time, for example, the resistance values of the magnetoresistive elements R2 and R3 change from “r” to “r + Δr”, but the resistance values of the magnetoresistive elements R1 and R4 remain “r”. As a result, the signal A + potential rises, the signal A- is the potential decreases, the signal SR A output from the comparator 72A is at a low level (hereinafter referred to as "0"). Conversely, when the magnetic is generated across the magneto-resistive element R1 and R4, the signal SR A becomes high level (hereinafter referred to as "1").

ここで、羽根車100が回転すると磁石102によって発生する磁気も回転する。つまり、図8(A)のθが時間とともに変化する。例えば、信号SRは図8(C)の上側の波形図のようにθの値に応じて変化する。磁気センサー106は、磁気検出回路70Aによって、磁気の回転に応じた信号SRを出力できる。 Here, when the impeller 100 rotates, the magnetism generated by the magnet 102 also rotates. That is, θ in FIG. 8A changes with time. For example, the signal SR A varies according to the value of θ as the upper waveform diagram of FIG. 8 (C). The magnetic sensor 106, the magnetic detection circuit 70A, it outputs a signal SR A corresponding to the rotation of the magnetic.

ただし、磁気検出回路70Aは磁気の向きが180°反転しても同じように検出を行う。つまり、磁気検出回路70Aは磁気の向きまでは区別できない。そのため、1つの磁気検出回路70Aだけでは、正回転と逆回転の区別がつかない。従って、磁気センサー106は複数の磁気検出回路を含む必要がある。   However, the magnetic detection circuit 70A performs the same detection even if the magnetic direction is reversed by 180 °. That is, the magnetic detection circuit 70A cannot distinguish even the direction of magnetism. Therefore, it is not possible to distinguish between forward rotation and reverse rotation with only one magnetic detection circuit 70A. Therefore, the magnetic sensor 106 needs to include a plurality of magnetic detection circuits.

図8(B)は、磁気検出回路70Aと45°の狭角をもって設置される磁気検出回路70Bを表す。磁気検出回路70Bの磁気抵抗素子R5〜R8は磁気検出回路70Aと同じようにホイートストンブリッジを構成する。   FIG. 8B shows the magnetic detection circuit 70A and the magnetic detection circuit 70B installed with a narrow angle of 45 °. The magnetoresistive elements R5 to R8 of the magnetic detection circuit 70B constitute a Wheatstone bridge in the same manner as the magnetic detection circuit 70A.

磁気検出回路70Bは磁気検出回路70Aと同じ磁気を検出するが、コンパレーター72Bから出力される信号SRは信号SRと位相が異なる。45°の狭角によって、図8(C)の下側の波形図のように、信号SRとは位相がずれた信号SRが出力されることになる。 Magnetic detection circuit 70B is to detect the same magnetic magnetic detection circuit 70A, the signal SR B outputted from the comparator 72B is signal SR A and phase are different. The narrow angle of 45 °, as in the lower waveform diagram of FIG. 8 (C), the results in which the signal SR B whose phases are shifted are output from the signal SR A.

そのため、信号SRと信号SRとを組み合わせることで、正回転と逆回転の区別が可能になる。例えば信号SRを1ビット目、信号SRを2ビット目とする2ビットの信号であるセンサーサンプリング値を生成する。このとき、正回転であれば図8(C)のように1、0、2、3、1、0、2、3、…の順番でセンサーサンプリング値が変化する。逆回転であれば3、2、0、1、3、2、0、1、…の順番でセンサーサンプリング値が変化する。磁気センサー106は、2ビットのセンサーサンプリング値の変化によって正回転と逆回転とを区別することが可能である。そして、図8(C)が示すように、センサーサンプリング値の変化は45°の回転に対応する。 Therefore, it is possible to distinguish between forward rotation and reverse rotation by combining the signal SR A and the signal SR B. For example 1 bit signal SR A, generates a sensor sampling value a 2-bit signal and the second bit signals SR B. At this time, if the rotation is positive, the sensor sampling value changes in the order of 1, 0, 2, 3, 1, 0, 2, 3,... As shown in FIG. If the rotation is reverse, the sensor sampling value changes in the order of 3, 2, 0, 1, 3, 2, 0, 1,. The magnetic sensor 106 can distinguish between forward rotation and reverse rotation by changing a 2-bit sensor sampling value. And as FIG.8 (C) shows, the change of a sensor sampling value respond | corresponds to rotation of 45 degrees.

なお、2つの磁気検出回路によって正回転、逆回転の区別は可能であるが、磁気センサー106は3つ以上の磁気検出回路を含んでいてもよい。このとき回転の検出精度を更に高めることができる。   Note that although the two magnetic detection circuits can distinguish between forward rotation and reverse rotation, the magnetic sensor 106 may include three or more magnetic detection circuits. At this time, the rotation detection accuracy can be further increased.

1.2.本実施形態の集積回路の構成
図1は本実施形態の集積回路10のブロック図である。集積回路10は、第1の回路11、第2の回路12、第3の回路13を含む。また、本実施形態のように、集積回路10は、タイマー21、電源供給制御回路22、発振回路23を含んでいてもよい。なお、本実施形態の集積回路10は、水の流量を測定する回転検出装置の一部として用いられ、正回転数をカウントするMCUが存在することを想定している。
1.2. Configuration of Integrated Circuit of this Embodiment FIG. 1 is a block diagram of an integrated circuit 10 of this embodiment. The integrated circuit 10 includes a first circuit 11, a second circuit 12, and a third circuit 13. Further, as in the present embodiment, the integrated circuit 10 may include a timer 21, a power supply control circuit 22, and an oscillation circuit 23. Note that the integrated circuit 10 of this embodiment is used as a part of a rotation detection device that measures the flow rate of water, and assumes that there is an MCU that counts the number of positive rotations.

集積回路10は、第1のサンプリング値200A、第2のサンプリング値200Bを受け取り、これらの信号は第1の回路11、第2の回路12、第3の回路13に入力される。第1のサンプリング値200A、第2のサンプリング値200Bは、それぞれ前記の信号SR、SRに対応する(図8(A)〜図8(B)参照)。第1のサンプリング値200A、第2のサンプリング値200Bによって前記のセンサーサンプリング値を生成する。センサーサンプリング値の変化から回転の有無がわかり、正回転と逆回転との区別もできる。 The integrated circuit 10 receives the first sampling value 200 </ b> A and the second sampling value 200 </ b> B, and these signals are input to the first circuit 11, the second circuit 12, and the third circuit 13. The first sampling value 200A and the second sampling value 200B correspond to the signals SR A and SR B , respectively (see FIGS. 8A to 8B). The sensor sampling value is generated by the first sampling value 200A and the second sampling value 200B. From the change in sensor sampling value, the presence or absence of rotation can be determined, and it is possible to distinguish between forward rotation and reverse rotation.

第1の回路11は正回転の検出(正回転検出)を行い、第2の回路12は逆回転の検出(逆回転検出)を行う。正回転検出により正回転が有ったと判断された場合には、第1の回路11から第1の割り込み信号211が出力される。逆回転検出により逆回転が有ったと判断された場合には、第2の回路12から第2の割り込み信号212が出力される。検出された回転を割り込み信号として出力することで、MCUを間欠駆動させることができるため、集積回路10を含むシステムの消費電力を小さくできる。   The first circuit 11 performs forward rotation detection (forward rotation detection), and the second circuit 12 performs reverse rotation detection (reverse rotation detection). When it is determined that there is a normal rotation by detecting the normal rotation, the first interrupt signal 211 is output from the first circuit 11. If it is determined by the reverse rotation detection that the reverse rotation has occurred, the second interrupt signal 212 is output from the second circuit 12. By outputting the detected rotation as an interrupt signal, the MCU can be intermittently driven, so that the power consumption of the system including the integrated circuit 10 can be reduced.

なお、水道メーター等において水の流れる方向は決まっている。そのため、異常がない場合に水の流れによって羽根車が回転する方向を正回転の方向とする(図7(A)参照)。逆回転が生じるのは、例えば設置工事において接続を誤った場合や、異常が生じた場合である。逆回転が生じた場合には、例えばMCUは正回転数を減じる調整を行ってもよいし、しなくてもよい。また、逆回転が生じた場合には、例えばMCUは異常を表示等で知らせてもよい。   The direction in which water flows in a water meter or the like is determined. Therefore, the direction in which the impeller rotates due to the flow of water when there is no abnormality is defined as the direction of forward rotation (see FIG. 7A). The reverse rotation occurs when, for example, the connection is wrong in the installation work or when an abnormality occurs. When reverse rotation occurs, for example, the MCU may or may not adjust to reduce the normal rotation speed. Further, when reverse rotation occurs, for example, the MCU may notify the abnormality by display or the like.

第3の回路13は回転停止期間を示す信号を出力する。回転停止期間とは、センサー(図外)からの出力である第1のサンプリング値200A、第2のサンプリング値200Bが共に変化しない状態が続く期間である。第3の回路13は回転停止期間をカウントする。第3の回路13のカウンター(回転停止期間カウンター)は本実施形態のようにアップカウンターであってもよいし、ダウンカウンターであってもよい。   The third circuit 13 outputs a signal indicating the rotation stop period. The rotation stop period is a period during which both the first sampling value 200A and the second sampling value 200B, which are outputs from the sensor (not shown), remain unchanged. The third circuit 13 counts the rotation stop period. The counter (rotation stop period counter) of the third circuit 13 may be an up counter as in this embodiment or a down counter.

第3の回路13は、回転停止期間を示す信号として、回転停止期間が所定の間継続した場合に変化する第3の割り込み信号213を出力する。そのため、例えばMCUが定期的に回転停止期間を示すカウント値を読み出す必要はない。また、上記のようにMCUを間欠駆動させることができるため、集積回路10を含むシステムの消費電力を小さくできる。なお、MCUは第3の割り込み信号213を受け取ることで、センサーのサンプリング周期を現在よりも長く設定して、システムの消費電力をさらに小さくしてもよい。   The third circuit 13 outputs a third interrupt signal 213 that changes when the rotation stop period continues for a predetermined period as a signal indicating the rotation stop period. Therefore, for example, it is not necessary for the MCU to periodically read the count value indicating the rotation stop period. In addition, since the MCU can be intermittently driven as described above, the power consumption of the system including the integrated circuit 10 can be reduced. Note that the MCU may receive the third interrupt signal 213 to set the sensor sampling period longer than the current time, thereby further reducing the power consumption of the system.

本実施形態の集積回路10は、発振回路23、タイマー21、電源供給制御回路22も含む。発振回路23は、振動子74(例えば水晶振動子)と接続されて発振ループを生成しクロック223を出力してもよい。このとき、第3の回路13は、クロック223によって回転停止期間をカウントしてもよい。集積回路10に含まれる発振回路23のクロック223を用いることで、周波数等の情報を把握でき、回転停止期間を正確に測定することが可能である。   The integrated circuit 10 of this embodiment also includes an oscillation circuit 23, a timer 21, and a power supply control circuit 22. The oscillation circuit 23 may be connected to a vibrator 74 (for example, a crystal vibrator) to generate an oscillation loop and output the clock 223. At this time, the third circuit 13 may count the rotation stop period by the clock 223. By using the clock 223 of the oscillation circuit 23 included in the integrated circuit 10, information such as the frequency can be grasped, and the rotation stop period can be accurately measured.

タイマー21は、例えばMCUからの制御信号201によって設定される間隔で、周期的に発生するタイマー割り込み信号221を出力してもよい。例えばMCUは、タイマー割り込み信号221によって周期的に表示を更新することができる。   For example, the timer 21 may output a timer interrupt signal 221 periodically generated at an interval set by a control signal 201 from the MCU. For example, the MCU can update the display periodically by the timer interrupt signal 221.

電源供給制御回路22は、例えばMCUからの制御信号202によってセンサー等の電源をオン状態にするパルス信号の周期を選択する。センサー等は電源がオン状態のときに動作してデータをサンプリングする。つまり、電源供給制御回路22は、サンプリング周期を決定する。そして、電源供給制御回路22から出力される電源供給制御信号222は、このサンプリング周期をもつパルス信号であってもよい。   The power supply control circuit 22 selects a cycle of a pulse signal for turning on a power source of a sensor or the like by a control signal 202 from, for example, an MCU. Sensors and the like operate when the power is on to sample data. That is, the power supply control circuit 22 determines the sampling period. The power supply control signal 222 output from the power supply control circuit 22 may be a pulse signal having this sampling period.

例えば、MCUは第3の割り込み信号213により回転が停止していると判断できる。このとき、サンプリング周期を1/16秒とするモード(低速モード)の選択を、制御信号202によって電源供給制御回路22に指示してもよい。また、例えばMCUは第1の割り込み信号211により水が流れていると判断できる。このとき、低速モードからサンプリング周期を1/1024秒とするモード(高速モード)への変更を、制御信号202によって電源供給制御回路22に指示してもよい。適切なセンサーのサンプリング周期を選択することで、効果的な低消費電力化を図ることが可能になる。   For example, the MCU can determine that the rotation is stopped by the third interrupt signal 213. At this time, selection of a mode (low speed mode) in which the sampling period is 1/16 second may be instructed to the power supply control circuit 22 by the control signal 202. For example, the MCU can determine that water is flowing by the first interrupt signal 211. At this time, the power supply control circuit 22 may be instructed by the control signal 202 to change from the low speed mode to a mode (high speed mode) in which the sampling period is 1/1024 seconds. By selecting an appropriate sensor sampling period, it is possible to effectively reduce power consumption.

なお、発振回路23からのクロック223は、図外のモジュールなどに供給されてもよい。また、集積回路10における第3の回路13以外のブロックにもクロック223は供給されているが、図1では図示を省略しているものとする。   Note that the clock 223 from the oscillation circuit 23 may be supplied to a module outside the figure. Further, although the clock 223 is supplied to blocks other than the third circuit 13 in the integrated circuit 10, it is not shown in FIG.

また、本実施形態では、第1の割り込み信号211、第2の割り込み信号212、第3の割り込み信号213、タイマー割り込み信号221は、いずれも割り込みクリア信号によって割り込みフラグのクリアといったクリア処理がなされるものとする。割り込みクリア信号は、これらの割り込み信号に対応してそれぞれ存在するが、図1では図示を省略している。   In this embodiment, the first interrupt signal 211, the second interrupt signal 212, the third interrupt signal 213, and the timer interrupt signal 221 are all cleared by an interrupt clear signal to clear the interrupt flag. Shall. Interrupt clear signals exist corresponding to these interrupt signals, but are not shown in FIG.

1.3.集積回路装置、回転検出装置
図2は、本実施形態の集積回路10を含む集積回路装置2と回転検出装置1を表す。なお、図1、図7(A)〜図8(C)と同じ要素については同じ番号、符号を付しており説明は省略する。
1.3. Integrated Circuit Device, Rotation Detection Device FIG. 2 shows an integrated circuit device 2 including the integrated circuit 10 of this embodiment and the rotation detection device 1. In addition, the same number and code | symbol are attached | subjected about the same element as FIG. 1, FIG. 7 (A)-FIG.

図2のように、本実施形態の集積回路10は、回転検出装置1の一部として使用されてもよい。このとき、集積回路10は磁気検出回路70A、70B、コンパレーター72A、72B、スイッチ76とともに集積回路装置2として1チップ化されてもよい。磁気検出回路70A、70B、コンパレーター72A、72Bが磁気センサー106(図7(B参照)に相当する。以下、磁気検出回路70A、70B、コンパレーター72A、72Bをまとめてセンサーと表現する。   As shown in FIG. 2, the integrated circuit 10 of this embodiment may be used as a part of the rotation detection device 1. At this time, the integrated circuit 10 may be integrated into one chip as the integrated circuit device 2 together with the magnetic detection circuits 70A and 70B, the comparators 72A and 72B, and the switch 76. The magnetic detection circuits 70A and 70B and the comparators 72A and 72B correspond to the magnetic sensor 106 (see FIG. 7B) .Hereinafter, the magnetic detection circuits 70A and 70B and the comparators 72A and 72B are collectively expressed as sensors.

集積回路装置2は、電源供給制御信号222によってセンサーの電源供給を制御する。例えば電源供給制御信号222が1のときだけ、スイッチ76がオン状態となり、センサーによってサンプリングが実行される。それ以外にはセンサーは電力を消費しないので消費電力を小さくできる。   The integrated circuit device 2 controls the power supply of the sensor by the power supply control signal 222. For example, the switch 76 is turned on only when the power supply control signal 222 is 1, and sampling is performed by the sensor. Other than that, the sensor does not consume power, so power consumption can be reduced.

回転検出装置1において、MCU3は、制御信号202によって低速モード又は高速モードを指定して、サンプリング周期を選択してもよい。   In the rotation detection device 1, the MCU 3 may select the sampling period by specifying the low speed mode or the high speed mode by the control signal 202.

集積回路装置2は、割り込み信号211、212、213、221をMCU3に出力する。MCU3は、割り込み信号を受け取る場合以外は、通常動作のモード(第1の動作モード)よりも電力を消費しない第2の動作モードで動作していてもよい。これにより、低消費電力化を図ることができる。   The integrated circuit device 2 outputs interrupt signals 211, 212, 213, and 221 to the MCU 3. The MCU 3 may operate in the second operation mode that consumes less power than the normal operation mode (first operation mode) except when receiving an interrupt signal. Thereby, low power consumption can be achieved.

MCU3は、割り込み信号を受け取ると、まず第1の動作モードになる。MCU3は、例えば正回転数カウンターを有し、第1の割り込み信号、第2の割り込み信号を受け取った場合にそれぞれインクリメント、デクリメントを行ってもよい。正回転数カウンターの値は水の流量に対応する。また、第3の割り込み信号を受け取った場合に前記の制御信号202を変更してもよい。そして、タイマー割り込み信号221を受け取った場合に、図外の表示装置に表示する水の流量のデータを更新してもよい。   When receiving an interrupt signal, the MCU 3 first enters the first operation mode. The MCU 3 may have a positive rotation number counter, for example, and may increment and decrement when receiving the first interrupt signal and the second interrupt signal, respectively. The value of the positive rotation number counter corresponds to the flow rate of water. Further, when the third interrupt signal is received, the control signal 202 may be changed. Then, when the timer interrupt signal 221 is received, the water flow rate data displayed on the display device (not shown) may be updated.

なお、集積回路装置2では、コンパレーター72A、72Bは誤検出防止のためにヒステリシス機能を備えていてもよい。また、ヒステリシス機能は制御信号(図外)によってオンとオフが切り換えられてもよい。また、MCU3を含めて1チップ化して集積回路装置2としてもよい。   In the integrated circuit device 2, the comparators 72A and 72B may have a hysteresis function to prevent erroneous detection. The hysteresis function may be switched on and off by a control signal (not shown). Further, the integrated circuit device 2 may be formed as a single chip including the MCU 3.

1.4.波形図
図3(A)〜図3(B)は集積回路10の波形図である。なお、図1〜図2、図7(A)〜図8(C)と同じ要素には同じ番号、符号を付しており説明は省略する。
1.4. Waveform Diagram FIGS. 3A to 3B are waveform diagrams of the integrated circuit 10. In addition, the same number and code | symbol are attached | subjected to the same element as FIGS. 1-2, 7 (A) -8 (C), and description is abbreviate | omitted.

図3(A)は割り込み信号の発生タイミングを表す。センサーサンプリング値は、第1のサンプリング値200Aを1ビット目、第2のサンプリング値200Bを2ビット目とする2ビットの値である。   FIG. 3A shows the generation timing of the interrupt signal. The sensor sampling value is a 2-bit value in which the first sampling value 200A is the first bit and the second sampling value 200B is the second bit.

前記のように、電源供給制御信号222は、センサーをオン状態にするタイミングを与えるのでサンプリング周期を表す。本実施形態のサンプリング周期は、回転が停止している場合などに消費電力を抑える低速モードと、精度のよい検出を行う高速モードがある。   As described above, the power supply control signal 222 indicates the sampling period because it gives the timing to turn on the sensor. The sampling period of the present embodiment includes a low speed mode for reducing power consumption when rotation is stopped and a high speed mode for performing accurate detection.

低速モードの場合には、サンプリング周期は高速モードよりも長いTである。例えばTは1/16秒である。そして、高速モードの場合には、サンプリング周期はTである。例えばTは1/1024秒である。 In the case of low-speed mode, the sampling period is longer T S than the high-speed mode. For example, T S is 1/16 seconds. In the case of the high speed mode, the sampling period is TF . For example, TF is 1/1024 seconds.

図3(A)の例では、当初低速モードであり、正回転を表す第1の割り込み信号211が最初に発生した時刻tに高速モードに変化している。そして、所定の間、回転停止期間が続くことを示す第3の割り込み信号213が発生した時刻tに低速モードに変化している。低速モード、高速モードは、割り込み信号を受け取ったMCU3(図2参照)が制御信号202で指定する。 In the example of FIG. 3 (A), an initial low-speed mode, it is changed to the first time point t 0 to a high speed mode the interrupt signal 211 occurs first of which represents a positive rotation. Then, the changed predetermined between, the low-speed mode at the time t 8 the third interrupt signal 213 indicating that the rotation stop period continues occurs. The low speed mode and the high speed mode are designated by the control signal 202 by the MCU 3 (see FIG. 2) that has received the interrupt signal.

時刻tまでは、センサーサンプリング値は2、3、1、0、2、3、1と変化しており正回転していることがわかる(図8(C)参照)。そのため、第1の割り込み信号211がセンサーサンプリング値の変化に伴い発生している(時刻t、t、t、t)。MCU3は、第1の割り込み信号211を1度受け取ると、45°の正回転が生じたとして(図8(C)参照)正回転数カウンターをインクリメントする。 Until time t 4, the sensor sampling values it can be seen that the forward rotation is changing with 2,3,1,0,2,3,1 (see FIG. 8 (C)). Therefore, the first interrupt signal 211 is generated with a change in the sensor sampling value (time t 0 , t 1 , t 2 , t 3 ). Upon receiving the first interrupt signal 211 once, the MCU 3 increments the positive rotation number counter on the assumption that 45 ° forward rotation has occurred (see FIG. 8C).

時刻t以降時刻tまでは、センサーサンプリング値は1、3、2、0、1、3と変化しており逆回転していることがわかる(図8(C)参照)。そのため、第2の割り込み信号212がセンサーサンプリング値の変化に伴い発生している(時刻t、t、t、t)。MCU3は、第2の割り込み信号212を1度受け取ると、45°の逆回転が生じたとして(図8(C)参照)正回転数カウンターをデクリメントする。また、MCU3は、第2の割り込み信号212によっては正回転数カウンターを変化させないように設定可能であってもよい。 Until time t 4 after the time t 8, the sensor sampling values it can be seen that the reverse rotation is changing with 1,3,2,0,1,3 (see FIG. 8 (C)). Therefore, the second interrupt signal 212 is generated with the change in the sensor sampling value (time t 4 , t 5 , t 6 , t 7 ). Upon receiving the second interrupt signal 212 once, the MCU 3 decrements the normal rotation number counter on the assumption that 45 ° reverse rotation has occurred (see FIG. 8C). Further, the MCU 3 may be set so as not to change the positive rotation number counter depending on the second interrupt signal 212.

時刻tでは、第3の割り込み信号213が発生し、MCU3は回転停止期間が所定の間、続いていると判断できる。そこで、MCU3はサンプリング周期を低速モードに設定して、センサーのサンプリング間隔を長くして消費電力を抑える。 At time t 8, the third interrupt signal 213 is generated, MCU 3 may determine the rotation stopping period for a predetermined, followed by that with. Therefore, the MCU 3 sets the sampling cycle to the low-speed mode, lengthens the sampling interval of the sensor, and suppresses power consumption.

なお、タイマー割り込み信号221は、所定の時間間隔Tで他の割り込み信号とは無関係に発生してもよい。このとき、MCU3は時間間隔T毎に表示を更新してもよい。なお、MCU3は、時間間隔Tを制御信号201で変更することができる。 Incidentally, the timer interrupt signal 221 may be independently generated from other interrupt signals at a predetermined time interval T C. In this case, MCU 3 may update the display every time interval T C. Incidentally, MCU 3 may change the interval T C by the control signal 201 times.

図3(B)は図3(A)の一部を拡大して必要な信号を追加し、一部の信号を削除したものである。第1のサンプリング値200A、第2のサンプリング値200Bは、それぞれセンサーサンプリング値の1ビット目、2ビット目である。これらの信号は、電源供給制御信号222の立ち下がり、すなわちサンプリングデータが確定されるタイミングで変化する。電源供給制御信号222のパルス幅Tは例えば5μsである。図3(B)の例では、例えば時刻t10から5μsだけセンサーに電源が供給される。 FIG. 3B is an enlarged view of part of FIG. 3A in which necessary signals are added and some signals are deleted. The first sampling value 200A and the second sampling value 200B are the first bit and the second bit of the sensor sampling value, respectively. These signals change at the falling edge of the power supply control signal 222, that is, the timing at which sampling data is determined. Pulse width T A of the power supply control signal 222 is 5μs, for example. In the example of FIG. 3 (B), the power is supplied to the sensor, for example, from the time t 10 by 5 .mu.s.

回転停止期間カウンターは、第3の回路13(図1参照)に含まれており、クロック223に同期して回転停止期間をカウントする。回転停止期間カウンターは、第1の割り込み信号211や第2の割り込み信号212によってリセットされる(時刻t11)。なお、回転停止期間カウンターのリセットは、第1の割り込み信号211や第2の割り込み信号212を受け取ったMCU3が行ってもよい。なお、第1の割り込み信号211や第2の割り込み信号212は、センサーサンプリング値が変化してから数クロック後(図3(B)では4クロック後)に発生してもよい。 The rotation stop period counter is included in the third circuit 13 (see FIG. 1), and counts the rotation stop period in synchronization with the clock 223. The rotation stop period counter is reset by the first interrupt signal 211 and the second interrupt signal 212 (time t 11 ). The rotation stop period counter may be reset by the MCU 3 that has received the first interrupt signal 211 or the second interrupt signal 212. Note that the first interrupt signal 211 and the second interrupt signal 212 may be generated several clocks after the sensor sampling value changes (after 4 clocks in FIG. 3B).

割り込み信号のそれぞれは割り込み信号クリア信号によってクリアされる。図3(B)では、第1の割り込み信号211の発生後に、MCU3が第1の割り込みクリア信号を発生させる(時刻t12)。そして、例えば1クロック後に第1の割り込みクリア信号がクリアされる(時刻t13)。 Each of the interrupt signals is cleared by an interrupt signal clear signal. In FIG. 3B, after the first interrupt signal 211 is generated, the MCU 3 generates a first interrupt clear signal (time t 12 ). Then, for example, the first interrupt clear signal is cleared after one clock (time t 13 ).

なお、時刻t14〜t17はそれぞれ時刻t10〜t13における状態の繰り返しであり説明を省略する。時刻t18では、回転停止期間カウンターが所定の値である511となったために第3の割り込み信号213が発生している。 The time t 14 ~t 17 is a repeat of states at each time t 10 ~t 13 omitted. At time t 18 , the third interruption signal 213 is generated because the rotation stop period counter has reached a predetermined value 511.

1.5.フローチャート
本実施形態の集積回路10は、例えば水道メーターなどの水の流量を測定する回転検出装置の一部として用いられ、水の流量を正回転数カウンターでカウントして測るMCU3が存在することを想定している(図2参照)。そして、MCU3は集積回路10を制御する。ここでは、MCU3が割り込み信号を受け取ったときの制御について、図4(A)〜図5(B)のフローチャートを用いて説明する。本実施形態では、割り込み信号はそれぞれ独立しており、MCU3の割り込み処理も割り込み信号のそれぞれに対して独立に行われるとする。
1.5. Flowchart The integrated circuit 10 of the present embodiment is used as a part of a rotation detection device that measures the flow rate of water, such as a water meter, for example, and there is an MCU 3 that measures the flow rate of water with a positive rotation number counter. This is assumed (see FIG. 2). The MCU 3 controls the integrated circuit 10. Here, the control when the MCU 3 receives an interrupt signal will be described with reference to the flowcharts of FIGS. 4 (A) to 5 (B). In the present embodiment, it is assumed that the interrupt signals are independent of each other, and the interrupt processing of the MCU 3 is performed independently for each of the interrupt signals.

図4(A)は、MCU3が第1の割り込み信号211を受け取った場合に実行する第1の割り込み処理を表す。まず、MCU3は第1の割り込みクリア信号を発生させて、クリア処理を行う(S11)。そして、45°の正回転が生じたとして(図8(C)参照)正回転数カウンターをインクリメントする(S12)。そして、サンプリング周期を精度のよい検出を行う高速モードにする(S13)。高速モードでは1/1024秒毎にサンプリングが行われる。本実施形態では、低速モードと高速モードしか存在しない。そのため、既にサンプリング周期が高速モード設定の場合にはモードに変化はない。   FIG. 4A shows a first interrupt process that is executed when the MCU 3 receives the first interrupt signal 211. First, the MCU 3 generates a first interrupt clear signal and performs a clear process (S11). Then, assuming that 45 ° forward rotation has occurred (see FIG. 8C), the forward rotation number counter is incremented (S12). Then, the sampling cycle is set to a high-speed mode for performing accurate detection (S13). In the high speed mode, sampling is performed every 1/1024 seconds. In this embodiment, only the low speed mode and the high speed mode exist. Therefore, the mode does not change when the sampling period is already set to the high-speed mode.

しかし、別の実施形態として3以上のモードが用意されてもよい。この場合には、よりサンプリング周期が短くなるモードへと切り換えを行う。例えば、サンプリング周期が1/1024秒、1/512秒、1/256秒、1/128秒、1/64秒、1/32秒、1/16秒である第1〜第7のモードがあるとする。例えば、今の状態が第4のモード(1/128秒)であって第1の割り込み信号211を受け取った場合には、第5のモード(1/64秒)へと移行してもよい。また、更に第1の割り込み信号211を受け取った場合には、第6のモード(1/32秒)へと移行してもよい。このとき、サンプリング周期を段階的に切り換えることによって、急激な設定の変化を回避して、より正確な流量の測定を行うことができる。   However, three or more modes may be prepared as another embodiment. In this case, the mode is switched to a mode in which the sampling cycle becomes shorter. For example, there are first to seventh modes in which the sampling period is 1/1024 seconds, 1/512 seconds, 1/256 seconds, 1/128 seconds, 1/64 seconds, 1/32 seconds, and 1/16 seconds. And For example, when the current state is the fourth mode (1/128 seconds) and the first interrupt signal 211 is received, the mode may be shifted to the fifth mode (1/64 seconds). Further, when the first interrupt signal 211 is received, the mode may be shifted to the sixth mode (1/32 seconds). At this time, by switching the sampling cycle step by step, it is possible to avoid a sudden change in setting and perform more accurate flow rate measurement.

図4(B)は、MCU3が第2の割り込み信号212を受け取った場合に実行する第2の割り込み処理を表す。まず、MCU3は第2の割り込みクリア信号を発生させて、クリア処理を行う(S21)。このとき、45°の逆回転が生じたと判断できるが、設定によって処理が分かれてもよい。逆回転が生じた場合に正回転数カウンターに反映させる設定であれば(S22Y)、正回転数カウンターをデクリメントする(S23)。しかし、設定が異なる場合には(S22N)正回転数カウンターを変化させない。その後、第1の割り込み処理と同じように、サンプリング周期を精度のよい検出を行う高速モードにしてもよい(S24)。   FIG. 4B shows a second interrupt process that is executed when the MCU 3 receives the second interrupt signal 212. First, the MCU 3 generates a second interrupt clear signal and performs a clear process (S21). At this time, it can be determined that 45 ° reverse rotation has occurred, but the processing may be divided depending on the setting. If the setting is to be reflected in the forward rotation counter when reverse rotation occurs (S22Y), the forward rotation counter is decremented (S23). However, if the settings are different (S22N), the positive rotation number counter is not changed. Thereafter, as in the first interrupt process, the sampling period may be set to a high-speed mode in which accurate detection is performed (S24).

なお、逆回転が生じた場合には異常であると判断されるため、サンプリング周期を高速モードにするステップ(S24)は省略されてもよい。また、ステップS24を実行する場合であって3以上のモードが用意されている場合には、よりサンプリング周期が短くなるモードへと切り換えを行ってもよい。   In addition, since it is judged that it is abnormal when reverse rotation occurs, the step (S24) of setting the sampling cycle to the high speed mode may be omitted. Further, when step S24 is executed and three or more modes are prepared, the mode may be switched to a mode in which the sampling cycle is further shortened.

図5(A)は、MCU3が第3の割り込み信号213を受け取った場合に実行する第3の割り込み処理を表す。まず、MCU3は第3の割り込みクリア信号を発生させて、クリア処理を行う(S31)。そして、回転停止期間カウンターの動作を停止させる(S32)。そして、消費電力を抑えるために、サンプリング周期を低速モードにする(S33)。   FIG. 5A shows a third interrupt process that is executed when the MCU 3 receives the third interrupt signal 213. First, the MCU 3 generates a third interrupt clear signal and performs a clear process (S31). Then, the operation of the rotation stop period counter is stopped (S32). In order to reduce power consumption, the sampling cycle is set to the low speed mode (S33).

なお、3以上のモードが用意されている場合には、よりサンプリング周期が長くなるモードへと切り換えを行ってもよい。このとき、サンプリング周期が最も長いモードになるまでは、回転停止期間カウンターの動作を停止させる(S32)必要はない。   When three or more modes are prepared, the mode may be switched to a mode in which the sampling period is longer. At this time, it is not necessary to stop the operation of the rotation stop period counter until the mode with the longest sampling cycle is reached (S32).

図5(B)は、MCU3がタイマー割り込み信号221を受け取った場合に実行するタイマー割り込み処理を表す。まず、MCU3はタイマー割り込みクリア信号を発生させて、クリア処理を行う(S41)。そして、正回転数カウンターの値に基づいて、表示装置に正回転数を表示する(S42)。データが一定の間隔で更新されるので、ユーザーはいつも最新の情報を得ることができる。なお、表示されるデータは正回転数でなく計算によって求められた水の流量であってもよい。   FIG. 5B shows timer interrupt processing that is executed when the MCU 3 receives the timer interrupt signal 221. First, the MCU 3 generates a timer interrupt clear signal and performs a clear process (S41). Then, based on the value of the positive rotation number counter, the positive rotation number is displayed on the display device (S42). Since the data is updated at regular intervals, the user can always get the latest information. The displayed data may be the flow rate of water obtained by calculation instead of the normal rotation speed.

このように、MCU3は割り込みが生じたときにだけ、割り込み処理を実行すればよい。例えば、MCU3が通常動作のモード(第1の動作モード)と消費電力を通常動作時より小さくするモード(第2の動作モード)を有しているとする。このとき、MCUは、割り込みが発生しない間は第2の動作モードであってもよく、消費電力を低く抑えることができる。   Thus, the MCU 3 only needs to execute the interrupt process when an interrupt occurs. For example, it is assumed that the MCU 3 has a normal operation mode (first operation mode) and a mode (second operation mode) in which power consumption is made smaller than that during normal operation. At this time, the MCU may be in the second operation mode as long as no interrupt occurs, and power consumption can be kept low.

また、MCU3は、第3の割り込み処理でサンプリング周期を低速モードにする。つまり、回転が停止している状態に応じたセンサーのサンプリング周期を選択することでシステムの消費電力を小さくできる。   Further, the MCU 3 sets the sampling cycle to the low speed mode in the third interrupt processing. In other words, the power consumption of the system can be reduced by selecting the sampling period of the sensor according to the state where the rotation is stopped.

なお、本実施形態の集積回路はセンサーから出力される2つのパルス信号を入力して、45°という高い精度の回転検出を行うことができる。このとき、センサーとして磁気検出回路とコンパレーターとが2組必要なだけなので、例えばセンサーを含む集積回路装置においても面積が著しく増大することはない。   Note that the integrated circuit of this embodiment can detect rotation with high accuracy of 45 ° by inputting two pulse signals output from the sensor. At this time, since only two sets of magnetic detection circuits and comparators are required as sensors, the area does not increase significantly even in an integrated circuit device including the sensors, for example.

2.変形例
本実施形態の変形例について図6を用いて説明する。図1〜図5(B)、図7(A)〜図8(C)と同じ要素については同じ番号、符号を付しており説明を省略する。
2. Modification A modification of the present embodiment will be described with reference to FIG. The same elements as those in FIGS. 1 to 5B and FIGS. 7A to 8C are denoted by the same reference numerals and description thereof is omitted.

変形例におけるMCU3の割り込み処理は、発生頻度の高いタイマー割り込み処理に第1〜第3の割り込み処理を組み込んだ処理である。   The interrupt process of the MCU 3 in the modified example is a process in which the first to third interrupt processes are incorporated into the timer interrupt process with a high occurrence frequency.

図6のように、まずタイマー割り込み信号221の発生の有無が確認される(S1)。タイマー割り込み信号221の発生がない場合には何も実行されない(S1N)。タイマー割り込み信号221が発生すると(S1Y)、そのクリア処理が行われる(S41)。なお、ステップS41は図5(B)と同じである。   As shown in FIG. 6, first, it is confirmed whether or not the timer interrupt signal 221 is generated (S1). If the timer interrupt signal 221 is not generated, nothing is executed (S1N). When the timer interrupt signal 221 is generated (S1Y), the clear process is performed (S41). Note that step S41 is the same as FIG.

その後、第1の割り込み信号211、第2の割り込み信号212、第3の割り込み信号213の発生の有無が確認される(S2、S4、S6)。これらの割り込み信号の発生がない場合には何も実行されない(S2N、S4N、S6N)が、発生した場合には(S2Y、S4Y、S6Y)はそれぞれ第1の割り込み処理S3、第2の割り込み処理S5、第3の割り込み処理S7が実行される。   Thereafter, whether or not the first interrupt signal 211, the second interrupt signal 212, and the third interrupt signal 213 are generated is confirmed (S2, S4, S6). If these interrupt signals are not generated, nothing is executed (S2N, S4N, S6N). If they occur (S2Y, S4Y, S6Y), the first interrupt process S3 and the second interrupt process are performed. S5 and third interrupt processing S7 are executed.

ここで、第1の割り込み処理S3は図4(A)の処理が対応し、第2の割り込み処理S5は図4(B)の処理が対応する。そして、第3の割り込み処理S7は図5(A)の処理が対応する。   Here, the first interrupt process S3 corresponds to the process of FIG. 4A, and the second interrupt process S5 corresponds to the process of FIG. 4B. The third interrupt process S7 corresponds to the process of FIG.

その後、表示装置に正回転数が表示される(S42)。ステップS42は図5(B)と同じである。   Thereafter, the positive rotation speed is displayed on the display device (S42). Step S42 is the same as FIG.

この変形例は、第1〜第3の割り込み信号が、例えばレジスターにマッピングされた割り込みフラグとしてのみ得られる場合でも対応できる。そのため、MCUの割り込み入力ポート数に限りがあるような場合に用いられてもよい。   This modification can be applied even when the first to third interrupt signals are obtained only as interrupt flags mapped to, for example, a register. Therefore, it may be used when the number of interrupt input ports of the MCU is limited.

これらの例示に限らず、本発明は、実施の形態で説明した構成と実質的に同一の構成(例えば、機能、方法および結果が同一の構成、あるいは目的および効果が同一の構成)を含む。   The present invention is not limited to these exemplifications, and includes configurations that are substantially the same as the configurations described in the embodiments (for example, configurations that have the same functions, methods, and results, or configurations that have the same objects and effects).

例えば、本実施形態や変形例では磁気センサーを用いて説明したが、磁気センサーに限らず、圧力センサー、照度センサー、温度センサーを用いてもよい。例えば、圧力、照度、温度の上昇と低下をそれぞれ正回転と逆回転とに対応させることでこれらのセンサーへの置き換えが可能である。   For example, although the present embodiment and the modification have been described using the magnetic sensor, the pressure sensor, the illuminance sensor, and the temperature sensor may be used instead of the magnetic sensor. For example, these sensors can be replaced by corresponding to the forward and reverse rotations of pressure, illuminance, and temperature, respectively.

また、本発明は、実施の形態で説明した構成の本質的でない部分を置き換えた構成を含む。また、本発明は、実施の形態で説明した構成と同一の作用効果を奏する構成又は同一の目的を達成することができる構成を含む。また、本発明は、実施の形態で説明した構成に公知技術を付加した構成を含む。   In addition, the invention includes a configuration in which a non-essential part of the configuration described in the embodiment is replaced. In addition, the present invention includes a configuration that exhibits the same operational effects as the configuration described in the embodiment or a configuration that can achieve the same object. Further, the invention includes a configuration in which a known technique is added to the configuration described in the embodiment.

1…回転検出装置、2…集積回路装置、3…MCU、10…集積回路、11…第1の回路、12…第2の回路、13…第3の回路、21…タイマー、22…電源供給制御回路、23…発振回路、70A…磁気検出回路、70B…磁気検出回路、72A…コンパレーター、72B…コンパレーター、74…振動子、76…スイッチ、100…羽根車、102…磁石、104…流路、106…磁気センサー、108…基板、200A…第1のサンプリング値、200B…第2のサンプリング値、201…制御信号、202…制御信号、211…第1の割り込み信号、212…第2の割り込み信号、213…第3の割り込み信号、221…タイマー割り込み信号、222…電源供給制御信号、223…クロック DESCRIPTION OF SYMBOLS 1 ... Rotation detection apparatus, 2 ... Integrated circuit apparatus, 3 ... MCU, 10 ... Integrated circuit, 11 ... 1st circuit, 12 ... 2nd circuit, 13 ... 3rd circuit, 21 ... Timer, 22 ... Power supply Control circuit 23 ... Oscillation circuit 70A ... Magnetic detection circuit 70B ... Magnetic detection circuit 72A ... Comparator 72B ... Comparator 74 ... Vibrator 76 ... Switch 100 ... Impeller 102 ... Magnet 104 ... Flow path, 106 ... magnetic sensor, 108 ... substrate, 200A ... first sampling value, 200B ... second sampling value, 201 ... control signal, 202 ... control signal, 211 ... first interrupt signal, 212 ... second 213 ... third interrupt signal, 221 ... timer interrupt signal, 222 ... power supply control signal, 223 ... clock

Claims (6)

センサーから出力される第1のパルスと第2のパルスを用いて回転を検出する集積回路であって、
前記第1のパルスと前記第2のパルスに基づいて、正回転検出を行う第1の回路および逆回転検出を行う第2の回路の少なくとも一方と、
前記第1のパルスと前記第2のパルスに基づいて回転停止期間をカウントする第3の回路と、を含み、
前記第1の回路は、第1の割り込み信号を出力し、
前記第2の回路は、第2の割り込み信号を出力し、
前記第3の回路は、前記回転停止期間を示す信号を出力する集積回路。
An integrated circuit that detects rotation using a first pulse and a second pulse output from a sensor,
At least one of a first circuit that performs forward rotation detection and a second circuit that performs reverse rotation detection based on the first pulse and the second pulse;
A third circuit for counting a rotation stop period based on the first pulse and the second pulse,
The first circuit outputs a first interrupt signal;
The second circuit outputs a second interrupt signal;
The third circuit is an integrated circuit that outputs a signal indicating the rotation stop period.
請求項1に記載の集積回路において、
発振回路を含み、
前記第3の回路は、
前記発振回路から出力されるクロックに基づいてカウントする集積回路。
The integrated circuit of claim 1, wherein
Including an oscillation circuit,
The third circuit includes:
An integrated circuit that counts based on a clock output from the oscillation circuit.
請求項1乃至2のいずれかに記載の集積回路において、
前記第3の回路は、
カウント値が所定の値になった場合に、前記回転停止期間を示す信号として第3の割り込み信号を出力する集積回路。
The integrated circuit according to claim 1,
The third circuit includes:
An integrated circuit that outputs a third interrupt signal as a signal indicating the rotation stop period when the count value reaches a predetermined value.
請求項1乃至3のいずれかに記載の集積回路において、
前記センサーの電源供給を制御する電源供給制御信号を出力する集積回路。
The integrated circuit according to any one of claims 1 to 3,
An integrated circuit for outputting a power supply control signal for controlling power supply of the sensor.
請求項1乃至4のいずれかに記載の集積回路を含む集積回路装置。   An integrated circuit device comprising the integrated circuit according to claim 1. 請求項1乃至4のいずれかに記載の集積回路と、
前記集積回路から割り込み信号を受け取るMCUと、を含み、
前記MCUは、
第1の動作モードにおいて回転量を算出し、
第2の動作モードにおいて前記第1の動作モードより低消費電力で動作し、
前記割り込み信号を受け取った場合に、前記第2の動作モードから前記第1の動作モードに遷移する回転検出装置。
An integrated circuit according to any one of claims 1 to 4;
Receiving an interrupt signal from the integrated circuit,
The MCU
Calculating the amount of rotation in the first operation mode;
Operate in the second operation mode with lower power consumption than in the first operation mode;
A rotation detection device that transitions from the second operation mode to the first operation mode when the interrupt signal is received.
JP2011012963A 2011-01-25 2011-01-25 Integrated circuit, integrated circuit device, rotation detection device Expired - Fee Related JP5725284B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011012963A JP5725284B2 (en) 2011-01-25 2011-01-25 Integrated circuit, integrated circuit device, rotation detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011012963A JP5725284B2 (en) 2011-01-25 2011-01-25 Integrated circuit, integrated circuit device, rotation detection device

Publications (2)

Publication Number Publication Date
JP2012154722A true JP2012154722A (en) 2012-08-16
JP5725284B2 JP5725284B2 (en) 2015-05-27

Family

ID=46836609

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011012963A Expired - Fee Related JP5725284B2 (en) 2011-01-25 2011-01-25 Integrated circuit, integrated circuit device, rotation detection device

Country Status (1)

Country Link
JP (1) JP5725284B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020193942A (en) * 2019-05-30 2020-12-03 日本電産株式会社 Rotational position detection device, rotational position detection method, and rotational position detection program
JP7491807B2 (en) 2020-10-20 2024-05-28 オークマ株式会社 Encoder abnormality diagnosis device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04158215A (en) * 1990-10-22 1992-06-01 Nitto Seiko Co Ltd Discriminating method of abnormality of flowmeter
JPH07306219A (en) * 1994-05-10 1995-11-21 Aichi Tokei Denki Co Ltd Rotational direction detecting circuit and electronic city water meter
JP2002221439A (en) * 2001-01-25 2002-08-09 Toyo Keiki Co Ltd Electronic water service meter system
JP2006250780A (en) * 2005-03-11 2006-09-21 Toshiba Corp Fluid usage amount meter and metering method of fluid usage
JP2008304335A (en) * 2007-06-07 2008-12-18 Tokiko Techno Kk Measurement control system and measuring quantity receiver

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04158215A (en) * 1990-10-22 1992-06-01 Nitto Seiko Co Ltd Discriminating method of abnormality of flowmeter
JPH07306219A (en) * 1994-05-10 1995-11-21 Aichi Tokei Denki Co Ltd Rotational direction detecting circuit and electronic city water meter
JP2002221439A (en) * 2001-01-25 2002-08-09 Toyo Keiki Co Ltd Electronic water service meter system
JP2006250780A (en) * 2005-03-11 2006-09-21 Toshiba Corp Fluid usage amount meter and metering method of fluid usage
JP2008304335A (en) * 2007-06-07 2008-12-18 Tokiko Techno Kk Measurement control system and measuring quantity receiver

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020193942A (en) * 2019-05-30 2020-12-03 日本電産株式会社 Rotational position detection device, rotational position detection method, and rotational position detection program
JP7491807B2 (en) 2020-10-20 2024-05-28 オークマ株式会社 Encoder abnormality diagnosis device

Also Published As

Publication number Publication date
JP5725284B2 (en) 2015-05-27

Similar Documents

Publication Publication Date Title
US9671254B2 (en) Magnetic sensing to detect tampering with a utility meter
KR101748188B1 (en) Method for detecting a step loss condition
JP4859903B2 (en) Moving direction detection device
US8671773B2 (en) Electronic flow meter
JP2009079925A (en) Encoder for motor
JP5725284B2 (en) Integrated circuit, integrated circuit device, rotation detection device
JP6180830B2 (en) Stepping motor control circuit, movement and analog electronic timepiece
US9897468B2 (en) Position detection device
JP2013005535A (en) Drive circuit of single-phase brushless motor
US8335135B2 (en) Stepping motor control circuit and analogue electronic timepiece
JP2020016531A (en) Motor drive circuit, semiconductor device, movement, electronic timepiece, and motor drive control method
JP2018155545A (en) Detection device and detection method
JP2020067411A (en) Flowmeter
JP2010220408A (en) Stepping motor control circuit and analog electronic clock
US8497674B2 (en) Magnetic detection apparatus
EP2762841B1 (en) Wireless device
JP5513341B2 (en) Flowmeter
JP5509132B2 (en) Electromagnetic flow meter
JP2005300178A (en) Water meter
JP2000221069A (en) Flow rate detection device
JP6322378B2 (en) Detection device
JP4971658B2 (en) Flow measuring device
CN214951545U (en) Single-flow water meter with state detection function
JP2014181956A (en) Stepping motor control circuit, movement and analog electronic clock
JPH1183563A (en) Flowmeter

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140107

RD07 Notification of extinguishment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7427

Effective date: 20140619

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140707

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140730

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140926

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150317

R150 Certificate of patent or registration of utility model

Ref document number: 5725284

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees