JP2011070309A - Switch state detection device and processing system - Google Patents

Switch state detection device and processing system Download PDF

Info

Publication number
JP2011070309A
JP2011070309A JP2009219417A JP2009219417A JP2011070309A JP 2011070309 A JP2011070309 A JP 2011070309A JP 2009219417 A JP2009219417 A JP 2009219417A JP 2009219417 A JP2009219417 A JP 2009219417A JP 2011070309 A JP2011070309 A JP 2011070309A
Authority
JP
Japan
Prior art keywords
switch
state
detection device
processing
switch state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009219417A
Other languages
Japanese (ja)
Inventor
Masashi Watabe
正志 渡部
Jun Okada
潤 岡田
Shigeyuki Fujii
滋之 藤井
Shinsuke Tsutsui
信介 筒井
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.)
Sumitomo Wiring Systems Ltd
AutoNetworks Technologies Ltd
Sumitomo Electric Industries Ltd
Original Assignee
Sumitomo Wiring Systems Ltd
AutoNetworks Technologies Ltd
Sumitomo Electric Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sumitomo Wiring Systems Ltd, AutoNetworks Technologies Ltd, Sumitomo Electric Industries Ltd filed Critical Sumitomo Wiring Systems Ltd
Priority to JP2009219417A priority Critical patent/JP2011070309A/en
Publication of JP2011070309A publication Critical patent/JP2011070309A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Power Sources (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a switch state detection device and processing system with high versatility, capable of reducing power consumption of a processing device without returning the processing device from a sleep state needlessly, and capable of properly setting conditions for reporting to the processing device every switch. <P>SOLUTION: The switch state detection device 1 detects an on/off-state of a switch 5, and outputs a trigger signal to a microcomputer 3 from the switch state detection device 1 in response to change in a switch state meeting the trigger conditions which are set. The microcomputer 3 sets conditions for output of a trigger signal to the switch state detection device 1 by switch 5. The microcomputer 3 returns to a normal state from a sleep state on receiving the trigger signal from the switch state detection device 1, and receives a state of each switch 5 from the switch state detection device 1 to perform processing corresponding to the switch state. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、複数のスイッチの状態を検出して処理装置などの他の装置へ送信するスイッチ状態検出装置、及びこのスイッチ状態検出装置を用いた処理システムに関する。   The present invention relates to a switch state detection device that detects a state of a plurality of switches and transmits the detected state to another device such as a processing device, and a processing system using the switch state detection device.

従来、電子機器にはユーザの操作を受け付けるために複数のスイッチが設けられており、電子機器に搭載されたCPU(Central Processing Unit)又はMPU(Micro Processing Unit)等の処理装置は、スイッチの状態を検出してユーザの操作に応じた処理を行っている。車輌に搭載されたECU(Electronic Control Unit)などの電子機器(以下、車載機器という)も同様であり、車輌内に設けられた複数のスイッチの状態を検出して処理を行っている。ただし、車載機器は車輌(のエンジン)が停止している状態であってもスイッチの状態を検出する必要があり、この場合にはバッテリの電力を消費するため、バッテリ上がりが生じないように消費電力を抑制することが望まれる。   2. Description of the Related Art Conventionally, electronic devices have been provided with a plurality of switches for accepting user operations, and a processing device such as a CPU (Central Processing Unit) or MPU (Micro Processing Unit) mounted on the electronic device is in the state of the switch. And processing according to the user's operation. The same applies to electronic devices (hereinafter referred to as in-vehicle devices) such as an ECU (Electronic Control Unit) mounted on the vehicle, and the processing is performed by detecting the states of a plurality of switches provided in the vehicle. However, it is necessary for the in-vehicle device to detect the switch state even when the vehicle (engine) is stopped. In this case, the battery power is consumed so that the battery does not run out. It is desirable to suppress power.

そこで、スイッチの状態検出をCPU又はMPU等の処理装置とは異なる装置(スイッチ状態検出装置)に行わせ、車輌の停止中には処理装置をスリープ状態として動作させない構成とすることが考えられる。スイッチ状態検出装置は、例えばカスタムIC(Integrated Circuit)などとして実現することができ、CPU又はMPU等の処理装置と比較して消費電力を低減し易い。このため、車輌の停止中には可能な限り処理装置をスリープ状態に維持し、スイッチ状態の検出をスイッチ状態検出装置のみで行うことで、バッテリの電力消費を低減することができる。   Therefore, it is conceivable that the switch state detection is performed by a device (switch state detection device) different from the processing device such as the CPU or MPU, and the processing device is not operated in the sleep state while the vehicle is stopped. The switch state detection device can be realized as a custom IC (Integrated Circuit), for example, and can easily reduce power consumption compared to a processing device such as a CPU or MPU. For this reason, the power consumption of the battery can be reduced by maintaining the processing device in the sleep state as much as possible while the vehicle is stopped and detecting the switch state only by the switch state detection device.

特許文献1においては、サンプリング処理に伴うCPU(Central Processing Unit)の負担を軽減することができるポートサンプリング回路装置が提案されている。このポートサンプリング回路装置は、CPUによりレジスタに設定されたサンプリング周期に基づいて出力ポートの出力レベルを周期的に変化させると共に、この出力レベルの変化を起点としたタイミング信号に基づいて入力ポートに与えられるデータをラッチしてデータレジスタに格納する。これによりCPUは、サンプリングに係る処理を行う必要がなく、適当なタイミングでデータレジスタからデータの読み出しを行えばよい。   Patent Document 1 proposes a port sampling circuit device that can reduce a burden on a CPU (Central Processing Unit) accompanying sampling processing. The port sampling circuit device periodically changes the output level of the output port based on the sampling period set in the register by the CPU, and applies it to the input port based on the timing signal starting from the change of the output level. Data to be latched and stored in the data register. Thus, the CPU does not need to perform processing related to sampling, and can read data from the data register at an appropriate timing.

特許文献2においては、消費電力を極力低減しつつ、マイコンの外部に設けたA/D変換器を用いてA/D変換データを入力するA/D変換データ入力システムが提案されている。このシステムでは、マイコン内に設けられたポートサンプリング回路が、CPUに代わってA/D変換器を制御する。またポートサンプリング回路は、サンプリングしてデータレジスタに格納したデータと、予め設定された期待値データとを比較し、両データが不一致となった場合にウェイクアップ信号をCPUへ出力する。これらにより、CPUはA/D変換器の制御及び入力サンプリング処理のために周期的にウェイクアップする必要がない。   Patent Document 2 proposes an A / D conversion data input system that inputs A / D conversion data using an A / D converter provided outside a microcomputer while reducing power consumption as much as possible. In this system, a port sampling circuit provided in the microcomputer controls the A / D converter instead of the CPU. The port sampling circuit compares the data sampled and stored in the data register with preset expected value data, and outputs a wakeup signal to the CPU when the two data do not match. As a result, the CPU does not need to wake up periodically for control of the A / D converter and input sampling processing.

特開2003−296292号公報JP 2003-296292 A 特開2004−234463号公報JP 2004-234463 A

上述のように、スイッチ状態検出装置がスイッチのオン/オフ状態を検出することによって、処理装置はスイッチ状態の検出を行う必要がなく、スリープ状態を維持することができる。このとき、スイッチ状態検出装置は、スイッチ状態の変化の有無を判定し、スイッチ状態が変化した場合に処理装置へ割込信号などによる通知を行う構成とすることによって、処理装置はスリープ状態から復帰し、スイッチ状態の変化に応じた処理を行うことができる。   As described above, when the switch state detection device detects the on / off state of the switch, the processing device does not need to detect the switch state and can maintain the sleep state. At this time, the switch state detection device determines whether or not the switch state has changed, and notifies the processing device by an interrupt signal or the like when the switch state changes, so that the processing device returns from the sleep state. In addition, it is possible to perform processing according to changes in the switch state.

しかしながら、スイッチの種別又はスイッチ操作に対して行われる処理内容等は、スイッチ毎に異なる。このためスイッチによっては、スイッチ状態が変化した場合であっても処理装置が処理を行う必要がない、即ちスリープ状態から復帰する必要がないものもある。またスイッチによっては、特定の条件でのみ(例えばオフ状態からオン状態に変化した場合のみ、また例えばオン状態からオフ状態に変化した場合のみ)処理装置が処理を行い、それ以外の条件では処理を行う必要がないものもある。このため、スイッチ状態検出装置が全てのスイッチについて、スイッチ状態の変化を処理装置へ一様に通知する構成とした場合、処理装置が不要にスリープ状態から復帰するという問題があった。この問題により、CPUの消費電力低減が妨げられ、ECUなどの電子機器の消費電力を増大させる虞があった。   However, the type of switch or the processing content performed for the switch operation is different for each switch. For this reason, some switches do not require the processing device to perform processing even when the switch state changes, that is, it is not necessary to return from the sleep state. In addition, depending on the switch, the processing device performs processing only under specific conditions (for example, only when the state changes from the off state to the on state, or only when the state changes from the on state to the off state). Some do not need to be done. Therefore, when the switch state detection device is configured to uniformly notify the processing device of changes in the switch state for all switches, there is a problem that the processing device unnecessarily returns from the sleep state. Due to this problem, the power consumption of the CPU is hindered, which may increase the power consumption of an electronic device such as an ECU.

特許文献1に記載のポートサンプリング回路は、サンプリングされたデータをCPUが自ら適当なタイミングで読み出す構成であり、データの変化をポートサンプリング回路がCPUへ通知する機能を有しておらず、サンプリングされたデータの変化の有無はCPUが判定する必要があるため、CPUはスリープ状態へ移行することはできない。よって、特許文献1のポートサンプリング回路は、処理装置が不要にスリープ状態から復帰する上記の問題を解決し得るものではない。   The port sampling circuit described in Patent Document 1 is a configuration in which the CPU reads sampled data at an appropriate timing by itself, and does not have a function for the port sampling circuit to notify the CPU of data changes, and is sampled. Since it is necessary for the CPU to determine whether the data has changed, the CPU cannot enter the sleep state. Therefore, the port sampling circuit of Patent Document 1 cannot solve the above-described problem that the processing device unnecessarily returns from the sleep state.

特許文献2に記載のA/D変換データ入力システムは、サンプリングしたデータと期待値データとが不一致の場合にポートサンプリング回路がCPUへウェイクアップ信号を出力する構成であり、入力ポート毎に期待値データを設定することができる。しかし、ポートサンプリング回路は両データが不一致の場合にのみウェイクアップ信号を出力する構成であるため、例えばサンプリングデータが期待値データと不一致の状態から一致する状態へ変化した場合などにはウェイクアップ信号を出力することはできない。よって、特許文献2のA/D変換データ入力システムは、ウェイクアップ信号の出力を両データの不一致が発生したときにしか行うことができず、汎用性が低いという問題がある。   The A / D conversion data input system described in Patent Document 2 has a configuration in which the port sampling circuit outputs a wake-up signal to the CPU when the sampled data and the expected value data do not match, and the expected value for each input port. Data can be set. However, since the port sampling circuit is configured to output a wakeup signal only when both data do not match, for example, when the sampling data changes from a state that does not match the expected value data to a state that matches, the wakeup signal Cannot be output. Therefore, the A / D conversion data input system of Patent Document 2 has a problem that the output of the wakeup signal can be performed only when a mismatch between the two data occurs, and the versatility is low.

本発明は、斯かる事情に鑑みてなされたものであって、その目的とするところは、処理装置を不要にスリープ状態から復帰させることなく、処理装置による消費電力を低減することができ、スイッチ毎に処理装置への通知を行う条件を適切に設定することができる汎用性の高いスイッチ状態検出装置及び処理システムを提供することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to reduce power consumption by the processing device without unnecessarily returning the processing device from the sleep state, and to switch It is an object of the present invention to provide a highly versatile switch state detection device and processing system capable of appropriately setting conditions for notifying the processing device every time.

本発明に係るスイッチ状態検出装置は、複数のスイッチの状態をそれぞれ検出する検出手段と、該検出手段が検出した各スイッチの状態を他の装置へ送信する送信手段と、各スイッチの状態の変化の有無を判定する判定手段と、スイッチの状態が変化した場合に、前記他の装置へ通知する通知手段と、該通知手段が通知を行うスイッチ状態の変化の条件を、スイッチ毎に記憶する条件記憶手段と、前記条件を前記他の装置から受信する受信手段とを備えることを特徴とする。   The switch state detection device according to the present invention includes a detection unit that detects the states of a plurality of switches, a transmission unit that transmits the state of each switch detected by the detection unit to another device, and a change in the state of each switch. A determination unit for determining the presence or absence of a switch, a notification unit for notifying the other device when a switch state is changed, and a condition for storing a switch state change condition for notification by the notification unit for each switch It is characterized by comprising storage means and receiving means for receiving the condition from the other device.

また、本発明に係るスイッチ状態検出装置は、前記条件は、対象のスイッチがオン状態からオフ状態へ変化した場合にのみ通知を行う条件、又は、対象のスイッチがオフ状態からオン状態へ変化した場合にのみ通知を行う条件であることを特徴とする。   In the switch state detection device according to the present invention, the condition is a condition for notifying only when a target switch changes from an on state to an off state, or the target switch changes from an off state to an on state. It is a condition that a notification is made only in a case.

また、本発明に係るスイッチ状態検出装置は、前記条件が、対象のスイッチがオン状態からオフ状態へ変化した場合若しくはオフ状態からオン状態へ変化した場合の両場合に通知を行う条件、又は、対象のスイッチが変化した場合であっても通知を行わない条件であることを特徴とする。   In the switch state detection device according to the present invention, the condition is a condition for performing notification in both cases where the target switch changes from an on state to an off state or when the target switch changes from an off state to an on state, or It is a condition that notification is not performed even when the target switch changes.

また、本発明に係るスイッチ状態検出装置は、前記送信手段及び前記受信手段が、シリアル通信により前記他の装置との間で情報の送受信を行うようにしてあることを特徴とする。   The switch state detection apparatus according to the present invention is characterized in that the transmission means and the reception means transmit and receive information to and from the other apparatus by serial communication.

また、本発明に係るスイッチ状態検出装置は、前記検出手段が検出した各スイッチの状態を記憶するスイッチ状態記憶手段を備え、前記送信手段は、前記スイッチ状態記憶手段に記憶された状態を読み出して、前記他の装置へ送信するようにしてあることを特徴とする。   The switch state detection device according to the present invention further includes switch state storage means for storing the state of each switch detected by the detection means, and the transmission means reads out the state stored in the switch state storage means. And transmitting to the other apparatus.

また、本発明に係るスイッチ状態検出装置は、前記条件記憶手段及び前記スイッチ状態記憶手段が、共通の記憶素子にて構成してあることを特徴とする。   The switch state detection device according to the present invention is characterized in that the condition storage means and the switch state storage means are constituted by a common storage element.

また、本発明に係る処理システムは、複数のスイッチの状態に応じて処理を行う処理装置と、前記スイッチの状態を検出して前記処理装置へ送信するスイッチ状態検出装置とを備える処理システムであって、前記スイッチ状態検出装置は、各スイッチの状態をそれぞれ検出する検出手段と、該検出手段が検出した各スイッチの状態を前記処理装置へ送信する送信手段と、各スイッチの状態の変化の有無を判定する判定手段と、スイッチの状態が変化した場合に、前記処理装置へ通知する通知手段と、該通知手段が通知を行うスイッチ状態の変化の条件を、スイッチ毎に記憶する条件記憶手段と、前記条件を前記処理装置から受信する受信手段とを有し、前記処理装置は、前記スイッチの状態に応じた処理を行う処理動作状態、又は、該処理を行わず、前記処理動作状態より電力消費量が少ない低消費電力状態にて動作し、前記条件を前記スイッチ状態検出装置へ送信する送信手段と、前記スイッチ状態検出装置からの通知に応じて、前記処理動作状態から前記低消費電力状態へ状態を切り替える切替手段と、前記処理動作状態にて、前記スイッチ状態検出装置が送信する各スイッチの状態を受信する受信手段と、該受信手段が受信した各スイッチの状態に応じて処理を行う処理手段とを有することを特徴とする。   The processing system according to the present invention is a processing system including a processing device that performs processing according to a plurality of switch states, and a switch state detection device that detects the state of the switch and transmits the detected state to the processing device. The switch state detection device includes a detection unit that detects the state of each switch, a transmission unit that transmits the state of each switch detected by the detection unit to the processing device, and whether there is a change in the state of each switch. Determining means for determining whether the switch state has changed, a notifying means for notifying the processing device, and a condition storage means for storing, for each switch, a condition for changing the switch state to be notified by the notifying means. Receiving means for receiving the condition from the processing device, wherein the processing device performs processing according to the state of the switch, or performs the processing. Rather, operating in a low power consumption state with less power consumption than the processing operation state, and according to the notification from the switch state detection device, the transmission means for transmitting the condition to the switch state detection device, Switching means for switching the state from the processing operation state to the low power consumption state, receiving means for receiving the state of each switch transmitted by the switch state detection device in the processing operation state, and each of the reception means received And processing means for performing processing according to the state of the switch.

本発明においては、複数のスイッチのオン/オフの状態をスイッチ状態検出装置が検出し、各スイッチの状態を処理装置へ送信する構成とすると共に、スイッチの状態が変化した場合には処理装置への通知を行う。これにより処理装置は、スイッチ状態の検出を行う必要がなく、スイッチ状態が変化した場合にはスイッチ状態検出装置からの通知に応じて低消費電力状態(スリープ状態)からスイッチ操作に対する処理を行う処理動作状態(通常状態)へ移行し、スイッチ状態検出装置からスイッチの状態を受信して処理を行うことができる。
またスイッチ状態検出装置は、スイッチ状態の変化の通知を行う条件をスイッチ毎に記憶しておく。スイッチ状態が変化した場合であっても、記憶した条件に該当しなければ、スイッチ状態検出装置は処理装置への通知を行わず、条件に該当した場合にのみ通知を行う。スイッチ毎の条件は、処理装置からスイッチ状態検出装置へ送信することにより設定可能である。
これにより、各スイッチの種別又は処理内容等に応じて、スイッチ状態検出装置から処理装置へのスイッチ状態の変化に係る通知を異なる条件で行うことができる。よって、処理システムの汎用性が向上すると共に、処理装置への不要な通知が発生せず、処理装置がスリープ状態を維持して消費電力を低減することができる。
In the present invention, the switch state detection device detects the on / off states of a plurality of switches, and transmits the state of each switch to the processing device. When the switch state changes, the processing device returns to the processing device. Notification of. Thereby, the processing device does not need to detect the switch state, and when the switch state is changed, the processing is performed for the switch operation from the low power consumption state (sleep state) according to the notification from the switch state detection device. The operation state (normal state) can be entered, and the switch state can be received and processed from the switch state detection device.
Further, the switch state detection device stores a condition for notifying a change in the switch state for each switch. Even when the switch state changes, if the stored condition is not met, the switch state detection device does not notify the processing device, but only notifies when the condition is met. The conditions for each switch can be set by transmitting from the processing device to the switch state detection device.
Thereby, according to the type or processing content of each switch, the notification regarding the change of the switch state from the switch state detection device to the processing device can be performed under different conditions. Therefore, the versatility of the processing system is improved, unnecessary notification to the processing device does not occur, and the processing device can maintain the sleep state and reduce power consumption.

また、本発明においては、スイッチがオン状態からオフ状態へ変化した場合にのみ通知を行う条件、又は、スイッチがオフ状態からオン状態へ変化した場合にのみ通知を行う条件を、スイッチ状態検出装置に対して設定することができる。これにより、オフ状態からオン状態へ、又は、オン状態からオフ状態への一方向の状態変化に対してのみスイッチ状態検出装置から処理装置への通知が行われ、処理装置への不要な通知が発生することを防止できる。   Further, in the present invention, a switch state detection device is provided with a condition for notifying only when the switch changes from the on state to the off state, or a condition for notifying only when the switch changes from the off state to the on state. Can be set. As a result, notification from the switch state detection device to the processing device is performed only for a unidirectional state change from the off state to the on state, or from the on state to the off state, and unnecessary notification to the processing device. It can be prevented from occurring.

また、本発明においては、スイッチがオン状態又はオフ状態のいずれの状態変化した場合でもう通知を行う条件、又は、スイッチ状態の変化に対して全く通知を行わない条件を、スイッチ状態検出装置に対して設定することができる。これにより、スイッチ状態の変化に対して常に処理装置が処理を行うことができ、また、不要なスイッチの状態の変化に対して全く処理装置が処理を行わない構成とすることができるため、処理システムの汎用性を向上することができる。   Further, in the present invention, the switch state detection device is provided with a condition for notifying the switch state change at any time when the switch changes to the on state or the off state. Can be set. As a result, the processing device can always perform processing in response to a change in the switch state, and the processing device can be configured to perform no processing in response to an unnecessary change in the switch state. The versatility of the system can be improved.

また、本発明においては、スイッチ状態検出装置から処理装置へのスイッチ状態の送信と、処理装置からスイッチ状態検出装置への通知条件の送信とを、シリアル通信により行う。なお、スイッチ状態検出装置が処理装置へスイッチ状態の変化を通知する場合には、これらとは別の通信方法により通知を行えばよい。これによりスイッチ状態検出装置及び処理装置の間のデータ送受信を効率よく行うことができ、配線数を低減することができる。   In the present invention, transmission of the switch state from the switch state detection device to the processing device and transmission of the notification condition from the processing device to the switch state detection device are performed by serial communication. Note that when the switch state detection device notifies the processing device of a change in the switch state, the notification may be performed by a communication method different from these. Thereby, data transmission / reception between the switch state detection device and the processing device can be performed efficiently, and the number of wirings can be reduced.

また、本発明においては、検出した各スイッチの状態をスイッチ状態検出装置がメモリなどに記憶し、処理装置との通信を行う際にメモリから各スイッチの状態を読み出して送信する。これにより、処理装置がスリープ状態などの場合に検出したスイッチ状態を記憶しておき、処理装置がスリープ状態から通常状態へ復帰した後にスイッチ状態の送信を行うことができる。   Also, in the present invention, the switch state detection device stores the detected state of each switch in a memory or the like, and reads and transmits the state of each switch from the memory when communicating with the processing device. Thereby, the switch state detected when the processing device is in the sleep state or the like is stored, and the switch state can be transmitted after the processing device returns from the sleep state to the normal state.

また、本発明においては、処理装置から受信したスイッチ状態の変化を通知する条件と、検出した各スイッチの状態とを、共通の記憶素子に記憶する。これによりスイッチ状態検出装置及び処理装置の間で送受信するデータを共通の記憶素子に記憶できるため、スイッチ状態検出装置内の通信回路がデータの読み書きを行いやすく、また、記憶素子を有効活用することができる。   In the present invention, the condition for notifying the switch state change received from the processing device and the detected state of each switch are stored in a common storage element. As a result, data transmitted and received between the switch state detection device and the processing device can be stored in a common storage element, so that the communication circuit in the switch state detection device can easily read and write data, and effectively use the storage element. Can do.

本発明による場合は、スイッチ状態検出装置が、スイッチ状態の変化を処理装置へ通知する条件をスイッチ毎に記憶し、スイッチ状態が変化し、且つ、この変化が通知の条件に該当する場合にのみ通知を行う構成とすることにより、各スイッチの種別又は処理内容等に応じて、各スイッチの状態の変化に係る通知をそれぞれ異なる条件で行うことができるため、処理システムの汎用性が向上すると共に、処理装置への不要な通知が発生しない。よって、処理装置を不要にスリープ状態から復帰させることないため、処理装置がスリープ状態を維持して消費電力を低減することができる。また、スイッチ毎に処理装置への通知を行う条件を適切に設定することができるため、処理システムの汎用性を高めることができる。   In the case of the present invention, the switch state detection device stores the condition for notifying the processing device of the change of the switch state for each switch, and only when the switch state is changed and this change corresponds to the notification condition. By adopting a configuration for performing notification, notification regarding changes in the state of each switch can be performed under different conditions according to the type or processing content of each switch, thereby improving the versatility of the processing system. Unnecessary notification to the processing device does not occur. Therefore, since the processing device is not unnecessarily restored from the sleep state, the processing device can maintain the sleep state and reduce power consumption. Moreover, since the conditions for notifying the processing device for each switch can be set appropriately, the versatility of the processing system can be improved.

本発明に係る処理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the processing system which concerns on this invention. 本発明に係る処理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the processing system which concerns on this invention. トリガ条件設定を説明するための模式図である。It is a schematic diagram for demonstrating trigger condition setting. 本発明に係る処理システムのスイッチ状態検出装置が行うスイッチ状態検出処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the switch state detection process which the switch state detection apparatus of the processing system which concerns on this invention performs. 本発明に係る処理システムのマイコンが行うトリガ条件設定処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the trigger condition setting process which the microcomputer of the processing system which concerns on this invention performs. 本発明に係る処理システムのスイッチ状態検出装置が行うトリガ条件受信処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the trigger condition reception process which the switch state detection apparatus of the processing system which concerns on this invention performs. 本発明に係る処理システムのマイコンが行うスイッチ状態に応じた制御処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the control processing according to the switch state which the microcomputer of the processing system which concerns on this invention performs.

以下、本発明をその実施の形態を示す図面に基づき具体的に説明する。図1及び図2は、本発明に係る処理システムの構成を示すブロック図であり、図1にスイッチ状態検出装置1の詳細を示し、図2にマイコン(処理装置)3の詳細を示してある。図示の処理システムは、複数(図1においては3つ)のスイッチ5に対する操作をスイッチ状態検出装置1が検出し、この検出結果に応じてマイコン3が被制御機器9の制御処理を行うものである。例えば被制御機器9がオーディオ装置の場合、スイッチ5は音量設定又は選曲等の操作を受け付けるスイッチである。   Hereinafter, the present invention will be specifically described with reference to the drawings showing embodiments thereof. 1 and 2 are block diagrams showing the configuration of a processing system according to the present invention. FIG. 1 shows details of the switch state detection device 1 and FIG. 2 shows details of a microcomputer (processing device) 3. . In the illustrated processing system, the switch state detection device 1 detects an operation on a plurality of (three in FIG. 1) switches 5, and the microcomputer 3 performs control processing of the controlled device 9 according to the detection result. is there. For example, when the controlled device 9 is an audio device, the switch 5 is a switch that receives operations such as volume setting or music selection.

本実施の形態においてスイッチ5は、例えばプッシュスイッチなどの一接点のスイッチであり、オン状態又はオフ状態のいずれかのスイッチ状態となる。各スイッチ5は、自らのスイッチ状態を示す信号をスイッチ状態検出装置へ与える。   In the present embodiment, the switch 5 is a one-contact switch such as a push switch, for example, and is in an on state or an off state. Each switch 5 gives a signal indicating its own switch state to the switch state detection device.

スイッチ状態検出装置1は、複数の検出部11及び判定部12と、トリガ信号発生部13と、記憶部14と、シリアル通信部15とを備えて構成されている。各スイッチ5のスイッチ状態を示す信号は、スイッチ状態検出装置1の複数の検出部11へそれぞれ入力されている。検出部11は、スイッチ状態検出装置1内にスイッチ5と同数又はそれ以上の数だけ設けられており、1つの検出部11へ1つのスイッチ5からの信号が入力される。各検出部11は、各スイッチ5からの入力信号を常時又は周期的に監視しており、入力信号の信号レベルに応じて各スイッチ5のスイッチ状態を検出する。例えば検出部11は、入力信号がハイレベル(閾値以上の信号レベル)であればスイッチ5がオフ状態であると判断し、入力信号がローレベル(閾値以下の信号レベル)であればスイッチ5がオン状態であると判断することができる。各検出部11は、検出した各スイッチ5のスイッチ状態を判定部12へ出力すると共に、デジタルデータとして記憶部14に記憶する。   The switch state detection device 1 includes a plurality of detection units 11 and a determination unit 12, a trigger signal generation unit 13, a storage unit 14, and a serial communication unit 15. A signal indicating the switch state of each switch 5 is input to each of the plurality of detection units 11 of the switch state detection device 1. The detection unit 11 is provided in the switch state detection device 1 in the same number as or more than the number of the switches 5, and a signal from one switch 5 is input to one detection unit 11. Each detection unit 11 constantly or periodically monitors the input signal from each switch 5 and detects the switch state of each switch 5 according to the signal level of the input signal. For example, the detection unit 11 determines that the switch 5 is in an off state if the input signal is at a high level (signal level equal to or higher than the threshold value), and if the input signal is at a low level (signal level equal to or lower than the threshold value), the switch 5 It can be determined that the state is on. Each detection unit 11 outputs the detected switch state of each switch 5 to the determination unit 12 and stores it in the storage unit 14 as digital data.

判定部12は、スイッチ状態検出装置1内に検出部11と同数設けられており、1つの検出部11と1つの判定部12とが対応付けられている。判定部12は、検出部11から与えられたスイッチ5のスイッチ状態に基づいて、このスイッチ5のスイッチ状態に変化が生じたか否かを判定する。例えば判定部12は、検出部11から入力されたスイッチ状態と、以前(直前)に入力されたスイッチ状態を比較することによって、スイッチ状態の変化の有無を判定する構成とすることができる。また例えば判定部12は、検出部11から入力される入力信号の立ち上がりエッジ又は立ち下がりエッジを検出することによって、スイッチ状態の変化の有無を判定する構成とすることができる。   The same number of determination units 12 as the detection units 11 are provided in the switch state detection device 1, and one detection unit 11 and one determination unit 12 are associated with each other. The determination unit 12 determines whether a change has occurred in the switch state of the switch 5 based on the switch state of the switch 5 given from the detection unit 11. For example, the determination unit 12 may be configured to determine whether there is a change in the switch state by comparing the switch state input from the detection unit 11 with the switch state input before (immediately before). Further, for example, the determination unit 12 can be configured to determine whether there is a change in the switch state by detecting a rising edge or a falling edge of the input signal input from the detection unit 11.

また判定部12は、記憶部14に記憶されたトリガ条件設定が与えられており、スイッチ状態の変化が設定されたトリガ条件に該当する場合には、トリガ信号発生部13へトリガ信号の出力命令を与える。図3は、トリガ条件設定を説明するための模式図である。トリガ条件は、スイッチ5の状態が変化した場合にスイッチ状態検出装置1がトリガ信号を出力してマイコン3への通知を行うか否かを判定するための条件である。本実施の形態に係る処理システムでは、トリガ条件として図示の4つの条件をマイコン3がスイッチ状態検出装置1に対して設定することができる。各トリガ条件は、2ビットのデジタルデータとして、各スイッチ5に対応付けて個別に設定される。   In addition, the determination unit 12 is given the trigger condition setting stored in the storage unit 14, and when the change of the switch state corresponds to the set trigger condition, the trigger signal generation unit 13 is instructed to output a trigger signal. give. FIG. 3 is a schematic diagram for explaining the trigger condition setting. The trigger condition is a condition for determining whether or not the switch state detection device 1 outputs a trigger signal to notify the microcomputer 3 when the state of the switch 5 changes. In the processing system according to the present embodiment, the microcomputer 3 can set four illustrated conditions as trigger conditions for the switch state detection device 1. Each trigger condition is individually set in association with each switch 5 as 2-bit digital data.

トリガ条件”00”は、スイッチ5がオン状態からオフ状態へ変化した場合、又は、オフ状態からオン状態へ変化した場合の両方について、トリガ信号を出力する設定である。判定部12は、トリガ条件”00”が与えられた場合、スイッチ状態が変化したと判定したときには、常にトリガ信号発生部13へトリガ信号の出力命令を与える。   The trigger condition “00” is a setting for outputting a trigger signal both when the switch 5 changes from the on state to the off state or when the switch 5 changes from the off state to the on state. The determination unit 12 always gives a trigger signal output command to the trigger signal generation unit 13 when it is determined that the switch state has changed when the trigger condition “00” is given.

トリガ条件”01”は、スイッチ5がオフ状態からオン状態へ変化した場合にのみ、トリガ信号を出力する設定である。判定部12は、トリガ条件”01”が与えられた場合に、スイッチ状態が変化したと判定したときには、更にスイッチ状態の変化がオフ状態からオン状態への変化であるか否かを判定することで、スイッチ状態の変化がトリガ条件を満たすか否かを判定する。スイッチ状態の変化がトリガ条件を満たす場合、判定部12は、トリガ信号発生部13へトリガ信号の出力命令を与える。   The trigger condition “01” is a setting for outputting a trigger signal only when the switch 5 changes from the off state to the on state. When the determination unit 12 determines that the switch state has changed when the trigger condition “01” is given, the determination unit 12 further determines whether the change in the switch state is a change from the off state to the on state. Then, it is determined whether or not the switch state change satisfies the trigger condition. When the switch state change satisfies the trigger condition, the determination unit 12 gives a trigger signal output command to the trigger signal generation unit 13.

トリガ条件”10”は、スイッチ5がオン状態からオフ状態へ変化した場合にのみ、トリガ信号を出力する設定である。判定部12は、トリガ条件”10”が与えられた場合に、スイッチ状態が変化したと判定したときには、更にスイッチ状態の変化がオン状態からオフ状態への変化であるか否かを判定することで、スイッチ状態の変化がトリガ条件を満たすか否かを判定する。スイッチ状態の変化がトリガ条件を満たす場合、判定部12は、トリガ信号発生部13へトリガ信号の出力命令を与える。   The trigger condition “10” is a setting for outputting a trigger signal only when the switch 5 changes from the on state to the off state. When the determination unit 12 determines that the switch state has changed when the trigger condition “10” is given, the determination unit 12 further determines whether the change in the switch state is a change from the on state to the off state. Then, it is determined whether or not the switch state change satisfies the trigger condition. When the switch state change satisfies the trigger condition, the determination unit 12 gives a trigger signal output command to the trigger signal generation unit 13.

トリガ条件”11”は、スイッチ5の状態が変化した場合であっても、トリガ信号を出力しない設定である。判定部12は、トリガ条件”11”が与えられた場合には、スイッチ状態の変化を判定せず、トリガ信号発生部13へトリガ信号の出力命令を与えることはない。このトリガ条件”11”は、例えばスイッチ状態検出装置1が状態検出することができるスイッチ数に対して、スイッチ状態検出装置1に接続されたスイッチ数が少ない場合、即ちスイッチ状態検出装置1の入力ポートに空きが存在する場合などに、この入力ポートからの入力を無効化するなどの目的で用いることができる。また例えば、スイッチ5が接続されている場合であっても、被制御機器9の動作状態などに応じて操作を受け付ける必要がないスイッチ5に対して、トリガ条件”11”を設定することができる。   The trigger condition “11” is a setting that does not output a trigger signal even when the state of the switch 5 changes. When the trigger condition “11” is given, the determination unit 12 does not determine a change in the switch state and does not give a trigger signal output command to the trigger signal generation unit 13. The trigger condition “11” is, for example, when the number of switches connected to the switch state detection device 1 is smaller than the number of switches that can be detected by the switch state detection device 1, that is, the input of the switch state detection device 1 It can be used for the purpose of invalidating the input from this input port when there is a vacancy in the port. For example, even when the switch 5 is connected, the trigger condition “11” can be set for the switch 5 that does not need to accept an operation according to the operation state of the controlled device 9. .

このように、各判定部12は、スイッチ5の状態の変化を判定すると共に、スイッチ状態の変化がトリガ条件を満たすか否かを更に判定し、トリガ条件を満たす場合にトリガ信号発生部13へトリガ信号の出力命令を与える。トリガ信号発生部13は、複数の判定部12からそれぞれトリガ信号の出力命令が与えられる。トリガ信号発生部13は、いずれかの判定部12からトリガ信号の出力命令が与えられた場合、例えば所定のパルス幅のパルス信号をトリガ信号として生成し、マイコン3に対して出力する。   As described above, each determination unit 12 determines the change in the state of the switch 5 and further determines whether or not the change in the switch state satisfies the trigger condition. When the trigger condition is satisfied, the determination unit 12 proceeds to the trigger signal generation unit 13. Gives a trigger signal output command. The trigger signal generation unit 13 is given a trigger signal output command from each of the plurality of determination units 12. When a trigger signal output command is given from any of the determination units 12, the trigger signal generation unit 13 generates, for example, a pulse signal having a predetermined pulse width as a trigger signal and outputs it to the microcomputer 3.

記憶部14は、例えばレジスタ、SRAM(Static Random Access Memory)又はDRAM(Dynamic Random Access Memory)等のデータ書き換え可能なメモリ素子により構成されている。記憶部14は、複数の検出部11からそれぞれ与えられるスイッチ5の状態を記憶する。記憶部14は、シリアル通信部15からの要求に応じて、記憶したスイッチ状態をシリアル通信部15へ与える。   The storage unit 14 is configured by a data rewritable memory element such as a register, SRAM (Static Random Access Memory), or DRAM (Dynamic Random Access Memory). The storage unit 14 stores the state of the switch 5 provided from each of the plurality of detection units 11. The storage unit 14 gives the stored switch state to the serial communication unit 15 in response to a request from the serial communication unit 15.

また記憶部14は、マイコン3からシリアル通信部15を介して与えられた上述のトリガ条件設定を記憶する。マイコン4から与えられるトリガ条件はスイッチ5毎に設定されており、記憶部14は、スイッチ5毎に予め定められた記憶領域に対応するトリガ条件を記憶する。記憶部14は、各スイッチ5の状態変化を判定する判定部12へ、対応するトリガ条件を与える。このように記憶部14は、検出部11から与えられたスイッチ状態と、シリアル通信部15から与えられたトリガ条件設定とを記憶することができる。これらの種類の異なるデータを記憶するために、記憶部14はアドレス範囲などで適宜にデータ毎の記憶領域が定められている。   The storage unit 14 also stores the above-described trigger condition setting given from the microcomputer 3 via the serial communication unit 15. The trigger condition given from the microcomputer 4 is set for each switch 5, and the storage unit 14 stores a trigger condition corresponding to a storage area predetermined for each switch 5. The storage unit 14 gives a corresponding trigger condition to the determination unit 12 that determines the state change of each switch 5. As described above, the storage unit 14 can store the switch state given from the detection unit 11 and the trigger condition setting given from the serial communication unit 15. In order to store these different types of data, the storage unit 14 has an appropriate storage area for each data, such as an address range.

シリアル通信部15は、マイコン3との間でシリアルのデータ送受信を行うものである。スイッチ状態検出装置1とマイコン3との間のシリアル通信は、共通の通信線を用いてデータの送受信を行う構成であってもよく、スイッチ状態検出装置1からマイコン3へのデータ送信と、マイコン3からスイッチ状態検出装置1へのデータ送信とを異なる通信線で行う構成であってもよい。シリアル通信部15は、マイコン3からトリガ条件設定を受信した場合、記憶部14の所定の記憶領域に受信したトリガ条件設定を記憶する。またシリアル通信部15は、マイコン3からの要求に応じて、記憶部14からスイッチ状態を読み出し、読み出したスイッチ状態をマイコン3へ送信する。   The serial communication unit 15 performs serial data transmission / reception with the microcomputer 3. The serial communication between the switch state detection device 1 and the microcomputer 3 may be configured to transmit and receive data using a common communication line. Data transmission from the switch state detection device 1 to the microcomputer 3 and the microcomputer 3 may be configured to perform data transmission from 3 to the switch state detection device 1 using different communication lines. When receiving the trigger condition setting from the microcomputer 3, the serial communication unit 15 stores the received trigger condition setting in a predetermined storage area of the storage unit 14. In response to a request from the microcomputer 3, the serial communication unit 15 reads the switch state from the storage unit 14 and transmits the read switch state to the microcomputer 3.

また、マイコン3は、制御部31、ROM(Read Only Memory)32、RAM(Random Access Memory)33、シリアル通信部34及びI/F(インタフェース)部35等を備えて構成されている。制御部31は、具体的にはCPU又はMPU等の処理装置で構成されており、各種の演算処理及び各部の制御処理等を行う。ROM32は、マスクROM又はEEPROM等で構成されるものであり、制御部31の動作に必要な各種のプログラム及びデータ等が予め記憶されている。またROM32には、スイッチ状態検出装置1へ送信するためのトリガ条件設定の初期値が記憶されている。RAM33は、SRAM又はDRAM等のデータ書き換え可能なメモリ素子により構成されている。例えば、制御部31はROM32に記憶されたプログラムを実行して処理を行い、この処理の演算過程などで発生したデータをRAM33に記憶する。   The microcomputer 3 includes a control unit 31, a ROM (Read Only Memory) 32, a RAM (Random Access Memory) 33, a serial communication unit 34, an I / F (interface) unit 35, and the like. Specifically, the control unit 31 includes a processing device such as a CPU or an MPU, and performs various types of arithmetic processing, control processing of each unit, and the like. The ROM 32 is configured by a mask ROM, an EEPROM, or the like, and stores various programs and data necessary for the operation of the control unit 31 in advance. The ROM 32 stores an initial value of trigger condition setting for transmission to the switch state detection device 1. The RAM 33 is configured by a data rewritable memory element such as SRAM or DRAM. For example, the control unit 31 performs processing by executing a program stored in the ROM 32, and stores data generated in the calculation process of this processing in the RAM 33.

シリアル通信部34は、スイッチ状態検出装置1との間でシリアルのデータ送受信を行うものである。シリアル通信部34は、制御部31から与えられたトリガ条件設定をスイッチ状態検出装置1へ送信する。またシリアル通信部34は、制御部31の制御により、スイッチ状態検出装置1へスイッチ状態の送信要求を送信し、この送信要求に対する応答としてスイッチ状態検出装置1が送信したスイッチ状態を受信し、受信したスイッチ状態を制御部31へ与える。   The serial communication unit 34 performs serial data transmission / reception with the switch state detection device 1. The serial communication unit 34 transmits the trigger condition setting given from the control unit 31 to the switch state detection device 1. Further, the serial communication unit 34 transmits a switch state transmission request to the switch state detection device 1 under the control of the control unit 31, receives the switch state transmitted by the switch state detection device 1 as a response to the transmission request, and receives the switch state. The switched state is given to the control unit 31.

I/F部35は、被制御機器9との間で信号入出力又はデータ送受信を行うためのものであり、通信線などを介して被制御機器9に接続される。I/F部35は、制御部31から与えられた制御命令を被制御機器9に適した信号又はデータに変換して出力すると共に、被制御機器9から入力される信号又はデータを制御部31へ与える。これによりマイコン3は、被制御機器9の動作を制御することができ、動作に伴うフィードバックの情報を取得することができる。   The I / F unit 35 is for performing signal input / output or data transmission / reception with the controlled device 9, and is connected to the controlled device 9 via a communication line or the like. The I / F unit 35 converts the control command given from the control unit 31 into a signal or data suitable for the controlled device 9 and outputs the signal or data, and outputs the signal or data input from the controlled device 9 to the control unit 31. Give to. Thereby, the microcomputer 3 can control the operation of the controlled device 9 and can acquire feedback information accompanying the operation.

また、マイコン3は、スイッチ5の操作に対する被制御機器9の制御処理を行う通常状態(処理動作状態)と、被制御機器9の制御処理を行わずに消費電力を低減するスリープ状態(低消費電力状態)とを切り替えることができる。マイコン3の制御部31は、通常状態において、スイッチ状態検出装置1とのシリアル通信を行ってスイッチ状態を受信し、受信したスイッチ状態に応じて被制御機器9の制御処理を行う。この制御処理が完了した後、制御部31は、マイコン3を通常状態からスリープ状態へ切り替える。   Further, the microcomputer 3 is in a normal state (processing operation state) in which the controlled device 9 is controlled in response to the operation of the switch 5 and a sleep state (low power consumption) in which the controlled device 9 is not controlled. Power state). In the normal state, the control unit 31 of the microcomputer 3 performs serial communication with the switch state detection device 1 to receive the switch state, and performs control processing of the controlled device 9 according to the received switch state. After this control process is completed, the control unit 31 switches the microcomputer 3 from the normal state to the sleep state.

スリープ状態においては、マイコン3のクロックの停止などにより各部の動作が停止し、制御部31がスイッチ状態検出装置1からのトリガ信号のみを受け付ける状態となる。予め設定されたトリガ条件を満たすスイッチ状態の変化が発生したとスイッチ状態検出装置1が判定した場合、スイッチ状態検出装置1からマイコン3の制御部31へトリガ信号が出力される。制御部31は、スイッチ状態検出装置1からのトリガ信号によりマイコン3をスリープ状態から通常状態へ切り替えて処理を開始し、スイッチ状態検出装置1とのシリアル通信を行ってスイッチ状態を取得し、スイッチ状態に応じた被制御機器9の制御処理を行う。   In the sleep state, the operation of each unit is stopped by the stop of the clock of the microcomputer 3 and the control unit 31 is in a state of receiving only the trigger signal from the switch state detection device 1. When the switch state detection device 1 determines that a switch state change that satisfies a preset trigger condition has occurred, a trigger signal is output from the switch state detection device 1 to the control unit 31 of the microcomputer 3. The control unit 31 starts processing by switching the microcomputer 3 from the sleep state to the normal state in response to a trigger signal from the switch state detection device 1, performs serial communication with the switch state detection device 1, acquires the switch state, and Control processing of the controlled device 9 according to the state is performed.

このように、マイコン3はスイッチ状態検出装置1からトリガ信号が与えられた場合にスリープ状態から通常状態へ復帰して処理を行い、処理の完了後には通常状態からスリープ状態へ移行して消費電力を低減する。マイコン3がスリープ状態であってもスイッチ状態検出装置1はスイッチ5の状態検出処理を行っているため、ユーザによるスイッチ5への操作を確実に検出してマイコン3へのトリガ信号を出力し、マイコン3をスリープ状態から通常状態へ復帰させてスイッチ操作に応じた処理を行わせることができる。   In this way, the microcomputer 3 performs processing by returning from the sleep state to the normal state when the trigger signal is given from the switch state detection device 1, and after the processing is completed, the microcomputer 3 shifts from the normal state to the sleep state to consume power. Reduce. Even if the microcomputer 3 is in the sleep state, the switch state detection device 1 performs the state detection process of the switch 5, so that the operation of the switch 5 by the user is reliably detected and a trigger signal is output to the microcomputer 3. The microcomputer 3 can be returned from the sleep state to the normal state, and processing corresponding to the switch operation can be performed.

図4は、本発明に係る処理システムのスイッチ状態検出装置1が行うスイッチ状態検出処理の手順を示すフローチャートである。スイッチ状態検出装置1は、各検出部11にて、対応するスイッチ5からの入力信号が閾値を超えるか否かに応じて、各スイッチ5がオン状態であるか又はオフ状態であるかの検出、即ちスイッチ状態の検出を行う(ステップS1)。各検出部11にてスイッチ状態を検出した後、スイッチ状態検出装置1は、検出したスイッチ状態を記憶部14に記憶する(ステップS2)。スイッチ状態検出装置1は、各判定部12にて、各検出部11が検出したスイッチ状態が以前の状態と比較して変化したか否かを判定し(ステップS3)、スイッチ状態が変化していない場合には(S3:NO)、ステップS1へ処理を戻し、上述のステップS1〜S3の処理を繰り返し行う。   FIG. 4 is a flowchart showing the procedure of the switch state detection process performed by the switch state detection device 1 of the processing system according to the present invention. The switch state detection device 1 detects whether each switch 5 is in an on state or an off state in each detection unit 11 depending on whether the input signal from the corresponding switch 5 exceeds a threshold value. That is, the switch state is detected (step S1). After the switch state is detected by each detection unit 11, the switch state detection device 1 stores the detected switch state in the storage unit 14 (step S2). In the switch state detection device 1, each determination unit 12 determines whether or not the switch state detected by each detection unit 11 has changed compared to the previous state (step S3), and the switch state has changed. If not (S3: NO), the process returns to step S1, and the above-described steps S1 to S3 are repeated.

スイッチ状態が変化した場合(S3:YES)、スイッチ状態検出装置1は、該当の判定部12にて、スイッチ状態の変化と、記憶部14から与えられたトリガ条件との比較を行って(ステップS4)、スイッチ状態の変化が設定されたトリガ条件を満たすか否かを判定する(ステップS5)。スイッチ状態の変化がトリガ条件を満たす場合(S5:YES)、スイッチ状態検出装置1は、トリガ信号発生部13にて、マイコン3へのトリガ信号を出力し(ステップS6)、処理を終了する。またスイッチ状態の変化がトリガ条件を満たさない場合(S5:NO)、スイッチ状態検出装置1は、トリガ信号を出力することなく、処理を終了する。なお、スイッチ状態検出装置1は、図示のフローチャートの処理を周期的に繰り返し行っている。   When the switch state is changed (S3: YES), the switch state detection device 1 compares the change of the switch state with the trigger condition given from the storage unit 14 in the corresponding determination unit 12 (Step S1). S4), it is determined whether or not the change of the switch state satisfies the set trigger condition (step S5). If the change in the switch state satisfies the trigger condition (S5: YES), the switch state detection device 1 outputs a trigger signal to the microcomputer 3 in the trigger signal generation unit 13 (step S6), and ends the process. If the change in the switch state does not satisfy the trigger condition (S5: NO), the switch state detection device 1 ends the process without outputting the trigger signal. Note that the switch state detection apparatus 1 periodically repeats the processing of the illustrated flowchart.

図5は、本発明に係る処理システムのマイコン3が行うトリガ条件設定処理の手順を示すフローチャートであり、マイコン3の制御部31が行う処理である。なお、図5においては、マイコン3の電源投入後の起動時にトリガ条件の設定を行う例を示してあるが、トリガ条件の設定を行うタイミングはこれに限るものではない。   FIG. 5 is a flowchart showing the procedure of the trigger condition setting process performed by the microcomputer 3 of the processing system according to the present invention, which is a process performed by the control unit 31 of the microcomputer 3. Although FIG. 5 shows an example in which the trigger condition is set when the microcomputer 3 is activated after the power is turned on, the timing for setting the trigger condition is not limited to this.

マイコン3の制御部31は、電源投入後に、内部のレジスタなどの値を初期化するパワーオンリセット処理を行い(ステップS21)、この処理の終了後にROM12に記憶されたトリガ条件の読み出しを行う(ステップS22)。次いで、制御部31は、読み出したトリガ条件をシリアル通信部34へ与え、スイッチ状態検出装置1へトリガ条件を送信する(ステップS23)。必要な処理を全て終了した後、制御部31は、マイコン3をスリープ状態へ移行させて(ステップS24)、処理を終了する。   The control unit 31 of the microcomputer 3 performs a power-on reset process for initializing values of internal registers after power-on (step S21), and reads the trigger condition stored in the ROM 12 after the completion of the process (step S21). Step S22). Next, the control unit 31 gives the read trigger condition to the serial communication unit 34, and transmits the trigger condition to the switch state detection device 1 (step S23). After completing all necessary processes, the control unit 31 shifts the microcomputer 3 to the sleep state (step S24) and ends the process.

図6は、本発明に係る処理システムのスイッチ状態検出装置1が行うトリガ条件受信処理の手順を示すフローチャートである。スイッチ状態検出装置1は、シリアル通信部15にて、マイコン3から送信されるトリガ条件を受信したか否かを判定し(ステップS31)、トリガ条件を受信していない場合には(S31:NO)、トリガ条件を受信するまで待機する。   FIG. 6 is a flowchart showing a procedure of trigger condition reception processing performed by the switch state detection device 1 of the processing system according to the present invention. The switch state detection apparatus 1 determines whether or not the trigger condition transmitted from the microcomputer 3 has been received by the serial communication unit 15 (step S31), and when the trigger condition has not been received (S31: NO) ), Wait until the trigger condition is received.

マイコン3からのトリガ条件を受信した場合(S31:YES)、スイッチ状態検出装置1は、受信したトリガ条件を記憶部14に記憶する(ステップS32)。このときスイッチ状態検出装置1は、各スイッチ5に対するトリガ条件を、各スイッチ5に対してそれぞれ定められた記憶部14の記憶領域に記憶する。次いでスイッチ状態検出装置1は、記憶部14に記憶したトリガ条件を、対応する判定部12へ与えることにより、マイコン3から受信したトリガ条件を反映させて(ステップS33)、処理を終了する。   When the trigger condition is received from the microcomputer 3 (S31: YES), the switch state detection device 1 stores the received trigger condition in the storage unit 14 (step S32). At this time, the switch state detection device 1 stores the trigger condition for each switch 5 in the storage area of the storage unit 14 determined for each switch 5. Next, the switch state detection device 1 applies the trigger condition stored in the storage unit 14 to the corresponding determination unit 12 to reflect the trigger condition received from the microcomputer 3 (step S33), and ends the process.

図7は、本発明に係る処理システムのマイコン3が行うスイッチ状態に応じた制御処理の手順を示すフローチャートであり、マイコン3がスリープ状態の際にスイッチ5に対する操作がなされた場合の処理を示してある。マイコン3の制御部31は、スイッチ状態検出装置1からトリガ信号が与えられたか否かを判定し(ステップS41)、トリガ信号が与えられていない場合には(S41:NO)、トリガ信号が与えられるまでスリープ状態を維持して待機する。   FIG. 7 is a flowchart showing the procedure of the control processing according to the switch state performed by the microcomputer 3 of the processing system according to the present invention, and shows the processing when the switch 5 is operated when the microcomputer 3 is in the sleep state. It is. The control unit 31 of the microcomputer 3 determines whether or not a trigger signal is given from the switch state detection device 1 (step S41). When the trigger signal is not given (S41: NO), the trigger signal is given. Wait until you are in sleep.

スイッチ状態検出装置1からのトリガ信号が与えられた場合(S41:YES)、制御部31は、マイコン3をスリープ状態から通常状態へ切り替えて(ステップS42)、シリアル通信部34にてスイッチ状態検出装置1へスイッチ状態の送信要求を送信する(ステップS43)。   When the trigger signal is given from the switch state detection device 1 (S41: YES), the control unit 31 switches the microcomputer 3 from the sleep state to the normal state (step S42), and the serial communication unit 34 detects the switch state. A switch state transmission request is transmitted to the apparatus 1 (step S43).

その後、制御部31は、スイッチ状態の送信要求に対して送信されるスイッチ状態検出装置1からのスイッチ状態をシリアル通信部34にて受信したか否かを判定し(ステップS44)、スイッチ状態を受信していない場合には(S44:NO)、スイッチ状態を受信するまで待機する。スイッチ状態検出装置1からのスイッチ状態を受信した場合(S44:YES)、制御部31は、受信したスイッチ状態に応じて、各スイッチ5に対してなされたスイッチ操作の内容を判定し(ステップS45)、スイッチ操作に応じた処理(被制御機器9に対する制御処理など)を行う(ステップS46)。この処理が終了した後、制御部31は、マイコン3を通常状態からスリープ状態へ切り替えて(ステップS47)、処理を終了する。   Thereafter, the control unit 31 determines whether or not the serial communication unit 34 has received the switch state from the switch state detection device 1 transmitted in response to the switch state transmission request (step S44), and determines the switch state. If not received (S44: NO), it waits until the switch state is received. When the switch state is received from the switch state detection device 1 (S44: YES), the control unit 31 determines the content of the switch operation performed on each switch 5 according to the received switch state (step S45). ), Processing according to the switch operation (control processing for the controlled device 9) is performed (step S46). After this process is completed, the control unit 31 switches the microcomputer 3 from the normal state to the sleep state (step S47) and ends the process.

以上の構成の処理システムにおいては、複数のスイッチ5のオン/オフの状態をスイッチ状態検出装置1が検出し、設定されたトリガ条件を満たすスイッチ状態の変化が発生した場合に、スイッチ状態検出装置1からマイコン3へトリガ信号を出力して通知を行う構成とすることにより、マイコン3はスイッチ状態の検出に係る処理を行うためにスリープ状態から通常状態へ切り替えを行う必要がなく、スリープ状態を維持して消費電力を低減することができる。またスイッチ5毎にトリガ信号を出力する条件(トリガ条件)をマイコン3がスイッチ状態検出装置1に対して設定することができる構成とすることにより、処理システムの汎用性が向上すると共に、マイコン3に対する不要な通知の発生を防止することができるため、マイコン3がより確実にスリープ状態を維持して消費電力を低減することができる。   In the processing system configured as described above, when the switch state detection device 1 detects the on / off state of the plurality of switches 5 and a change in the switch state that satisfies the set trigger condition occurs, the switch state detection device. By adopting a configuration in which the trigger signal is output from 1 to the microcomputer 3 and the notification is made, the microcomputer 3 does not need to switch from the sleep state to the normal state in order to perform processing related to the detection of the switch state. It is possible to maintain and reduce power consumption. Further, by adopting a configuration in which the microcomputer 3 can set a condition for outputting a trigger signal for each switch 5 (trigger condition) for the switch state detection device 1, the versatility of the processing system is improved and the microcomputer 3 Therefore, the microcomputer 3 can more reliably maintain the sleep state and reduce power consumption.

また、スイッチ5がオン状態からオフ状態へ変化した場合、又は、オフ状態からオン状態へ変化した場合にトリガ信号を出力するトリガ条件を設定可能とすることにより、スイッチ5の一方向の状態変化に対してのみスイッチ状態検出装置1からマイコン3へトリガ信号の出力を行わせることができ、マイコン3への不要な通知が発生することを防止できる。また、スイッチ5がオフ状態からオン状態へ変化した場合、及び、オン状態からオフ状態へ変化した場合の両場合についてトリガ信号を出力するトリガ条件を設定可能とすることにより、スイッチ状態検出装置1はスイッチ5の状態変化に対して常にトリガ信号をマイコン3へ出力することができ、スイッチ状態5の状態変化に対してマイコン3に常に処理を行わせることができる。また、スイッチ5が状態変化した場合であってもトリガ信号を出力しないトリガ条件を設定可能とすることにより、不要なスイッチ5の状態変化などに対しては、マイコン3がスリープ状態から復帰せず、被制御機器9に対する処理を行わない構成とすることができる。これらのように、複数のトリガ設定をマイコン3がスイッチ状態検出装置1に対して行うことができる構成とすることにより、処理システムの汎用性を向上することができる。   In addition, by making it possible to set a trigger condition for outputting a trigger signal when the switch 5 changes from the on state to the off state, or when the switch 5 changes from the off state to the on state, the state change in one direction of the switch 5 can be set. As a result, a trigger signal can be output from the switch state detection device 1 to the microcomputer 3 only for the above, and unnecessary notification to the microcomputer 3 can be prevented. Further, the switch state detection device 1 can be set by setting a trigger condition for outputting a trigger signal in both cases where the switch 5 changes from the off state to the on state and when the switch 5 changes from the on state to the off state. Can always output a trigger signal to the microcomputer 3 in response to a change in the state of the switch 5, and can cause the microcomputer 3 to always perform processing in response to a change in the state of the switch 5. Moreover, even if the switch 5 changes state, a trigger condition that does not output a trigger signal can be set, so that the microcomputer 3 does not return from the sleep state for an unnecessary change in the state of the switch 5 or the like. Thus, a configuration can be adopted in which the process for the controlled device 9 is not performed. Thus, the versatility of the processing system can be improved by adopting a configuration in which the microcomputer 3 can perform a plurality of trigger settings on the switch state detection device 1.

スイッチ状態検出装置1は、検出部11にて検出した各スイッチ5の状態を記憶部14に記憶すると共に、マイコン3から受信したトリガ設定を記憶部14に記憶する。これにより、シリアル通信部15がマイコン3との間で送受信するデータを記憶部14に記憶することができるため、シリアル通信部15がデータの読み書きを行いやすく、また、メモリ素子などを有効活用して記憶部14を構成することができる。   The switch state detection device 1 stores the state of each switch 5 detected by the detection unit 11 in the storage unit 14 and stores the trigger setting received from the microcomputer 3 in the storage unit 14. Thereby, since the data which the serial communication part 15 transmits / receives between the microcomputers 3 can be memorize | stored in the memory | storage part 14, it is easy for the serial communication part 15 to read / write data, and also utilizes a memory element etc. effectively. Thus, the storage unit 14 can be configured.

なお、本実施の形態においては、スイッチ5を一接点のプッシュスイッチとしたが、これに限るものではなく、スイッチ状態検出装置1がその他の種々のスイッチのスイッチ状態を検出する構成としてもよい。また、トリガ条件は図3に示した4つの条件に限るものではなく、スイッチ状態検出装置1に接続されるスイッチの種別に応じて種々の条件を設定することができる。また、図1においてはスイッチ状態検出装置1が3つのスイッチ5のスイッチ状態を検出する構成を図示してあるが、これに限るものではなく、スイッチ状態検出装置1が2つ以下又は4つ以上のスイッチ5のスイッチ状態を検出する構成としてもよい。また、スイッチ状態検出装置1が備える検出部11及び判定部12の数は、スイッチ5の数と同じでなくてもよく、スイッチ5の数より多ければよい。また、マイコン3が電源投入時にスイッチ状態検出装置1にトリガ条件の設定を行う構成としたが、これに限るものではなく、その他のタイミングにてトリガ条件の設定を行う構成であってもよい。   In the present embodiment, the switch 5 is a one-contact push switch. However, the present invention is not limited to this, and the switch state detection device 1 may be configured to detect the switch states of other various switches. Further, the trigger conditions are not limited to the four conditions shown in FIG. 3, and various conditions can be set according to the type of switch connected to the switch state detection device 1. 1 shows a configuration in which the switch state detection device 1 detects the switch states of the three switches 5. However, the present invention is not limited to this, and the number of switch state detection devices 1 is two or less or four or more. The switch state of the switch 5 may be detected. Further, the number of detection units 11 and determination units 12 included in the switch state detection device 1 may not be the same as the number of switches 5, as long as it is larger than the number of switches 5. Further, although the microcomputer 3 is configured to set the trigger condition in the switch state detection device 1 when the power is turned on, the present invention is not limited to this, and the trigger condition may be set at other timings.

1 スイッチ状態検出装置
3 マイコン(処理装置)
5 スイッチ
9 被制御機器
11 検出部(検出手段)
12 判定部(判定手段)
13 トリガ信号発生部(通知手段)
14 記憶部(条件記憶手段、スイッチ状態記憶手段)
15 シリアル通信部(送信手段、受信手段)
31 制御部(切替手段、処理手段)
34 シリアル通信部(送信手段、受信手段)
1 Switch status detection device 3 Microcomputer (processing device)
5 Switch 9 Controlled device 11 Detection unit (detection means)
12. Determination unit (determination means)
13 Trigger signal generator (notification means)
14 Storage unit (condition storage means, switch state storage means)
15 Serial communication unit (transmission means, reception means)
31 Control unit (switching means, processing means)
34 Serial communication unit (transmission means, reception means)

Claims (7)

複数のスイッチの状態をそれぞれ検出する検出手段と、
該検出手段が検出した各スイッチの状態を他の装置へ送信する送信手段と、
各スイッチの状態の変化の有無を判定する判定手段と、
スイッチの状態が変化した場合に、前記他の装置へ通知する通知手段と、
該通知手段が通知を行うスイッチ状態の変化の条件を、スイッチ毎に記憶する条件記憶手段と、
前記条件を前記他の装置から受信する受信手段と
を備えること
を特徴とするスイッチ状態検出装置。
Detection means for detecting the state of each of the plurality of switches;
Transmitting means for transmitting the state of each switch detected by the detecting means to another device;
Determining means for determining the presence or absence of a change in the state of each switch;
A notification means for notifying the other device when the state of the switch changes;
A condition storage means for storing, for each switch, a condition of a switch state change to which the notification means notifies;
A switch state detection device comprising: a receiving unit configured to receive the condition from the other device.
前記条件は、
対象のスイッチがオン状態からオフ状態へ変化した場合にのみ通知を行う条件、
又は、
対象のスイッチがオフ状態からオン状態へ変化した場合にのみ通知を行う条件
であること
を特徴とする請求項1に記載のスイッチ状態検出装置。
The condition is
A condition to notify only when the target switch changes from on to off,
Or
The switch state detection device according to claim 1, wherein a notification is made only when a target switch changes from an off state to an on state.
前記条件は、
対象のスイッチがオン状態からオフ状態へ変化した場合若しくはオフ状態からオン状態へ変化した場合の両場合に通知を行う条件、
又は、
対象のスイッチが変化した場合であっても通知を行わない条件
であること
を特徴とする請求項1又は請求項2に記載のスイッチ状態検出装置。
The condition is
Conditions for notification in both cases when the target switch changes from on to off or from off to on,
Or
The switch state detection device according to claim 1 or 2, wherein a notification is not made even if the target switch changes.
前記送信手段及び前記受信手段は、シリアル通信により前記他の装置との間で情報の送受信を行うようにしてあること
を特徴とする請求項1乃至請求項3のいずれか1つに記載のスイッチ状態検出装置。
The switch according to any one of claims 1 to 3, wherein the transmission unit and the reception unit transmit and receive information to and from the other device by serial communication. State detection device.
前記検出手段が検出した各スイッチの状態を記憶するスイッチ状態記憶手段を備え、
前記送信手段は、前記スイッチ状態記憶手段に記憶された状態を読み出して、前記他の装置へ送信するようにしてあること
を特徴とする請求項1乃至請求項4のいずれか1つに記載のスイッチ状態検出装置。
Comprising switch state storage means for storing the state of each switch detected by the detection means;
The said transmission means reads the state memorize | stored in the said switch state memory | storage means, It is made to transmit to said other apparatus, The one of Claim 1 thru | or 4 characterized by the above-mentioned. Switch state detection device.
前記条件記憶手段及び前記スイッチ状態記憶手段は、共通の記憶素子にて構成してあること
を特徴とする請求項5に記載のスイッチ状態検出装置。
The switch state detection device according to claim 5, wherein the condition storage unit and the switch state storage unit are configured by a common storage element.
複数のスイッチの状態に応じて処理を行う処理装置と、前記スイッチの状態を検出して前記処理装置へ送信するスイッチ状態検出装置とを備える処理システムであって、
前記スイッチ状態検出装置は、
各スイッチの状態をそれぞれ検出する検出手段と、
該検出手段が検出した各スイッチの状態を前記処理装置へ送信する送信手段と、
各スイッチの状態の変化の有無を判定する判定手段と、
スイッチの状態が変化した場合に、前記処理装置へ通知する通知手段と、
該通知手段が通知を行うスイッチ状態の変化の条件を、スイッチ毎に記憶する条件記憶手段と、
前記条件を前記処理装置から受信する受信手段と
を有し、
前記処理装置は、
前記スイッチの状態に応じた処理を行う処理動作状態、又は、該処理を行わず、前記処理動作状態より電力消費量が少ない低消費電力状態にて動作し、
前記条件を前記スイッチ状態検出装置へ送信する送信手段と、
前記スイッチ状態検出装置からの通知に応じて、前記処理動作状態から前記低消費電力状態へ状態を切り替える切替手段と、
前記処理動作状態にて、前記スイッチ状態検出装置が送信する各スイッチの状態を受信する受信手段と、
該受信手段が受信した各スイッチの状態に応じて処理を行う処理手段と
を有すること
を特徴とする処理システム。
A processing system comprising: a processing device that performs processing according to a state of a plurality of switches; and a switch state detection device that detects the state of the switch and transmits the detected state to the processing device,
The switch state detection device includes:
Detecting means for detecting the state of each switch;
Transmitting means for transmitting the state of each switch detected by the detecting means to the processing device;
Determining means for determining the presence or absence of a change in the state of each switch;
A notification means for notifying the processing device when the state of the switch changes;
A condition storage means for storing, for each switch, a condition of a switch state change to which the notification means notifies;
Receiving means for receiving the condition from the processing device;
The processor is
A processing operation state in which processing according to the state of the switch is performed, or operation in a low power consumption state in which power consumption is less than that in the processing operation state without performing the processing;
Transmitting means for transmitting the condition to the switch state detection device;
Switching means for switching the state from the processing operation state to the low power consumption state in response to a notification from the switch state detection device;
In the processing operation state, receiving means for receiving the state of each switch transmitted by the switch state detection device;
And a processing unit that performs processing according to the state of each switch received by the receiving unit.
JP2009219417A 2009-09-24 2009-09-24 Switch state detection device and processing system Pending JP2011070309A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009219417A JP2011070309A (en) 2009-09-24 2009-09-24 Switch state detection device and processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009219417A JP2011070309A (en) 2009-09-24 2009-09-24 Switch state detection device and processing system

Publications (1)

Publication Number Publication Date
JP2011070309A true JP2011070309A (en) 2011-04-07

Family

ID=44015559

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009219417A Pending JP2011070309A (en) 2009-09-24 2009-09-24 Switch state detection device and processing system

Country Status (1)

Country Link
JP (1) JP2011070309A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150198666A1 (en) * 2014-01-10 2015-07-16 Freescale Semiconductor, Inc. Switch detection device and method of use
US9543084B2 (en) 2013-04-09 2017-01-10 Rohm Co., Ltd. Switch state detection circuit and switch system
WO2017115610A1 (en) * 2015-12-28 2017-07-06 ローム株式会社 Vehicle switch control device and switch state detection method
CN113238545A (en) * 2021-04-30 2021-08-10 珠海格力电器股份有限公司 Vehicle control unit activation signal detection device, vehicle control unit and vehicle
CN113390452A (en) * 2021-06-16 2021-09-14 北京康斯特仪表科技股份有限公司 Method and device for calibrating switch type instrument

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9543084B2 (en) 2013-04-09 2017-01-10 Rohm Co., Ltd. Switch state detection circuit and switch system
US20150198666A1 (en) * 2014-01-10 2015-07-16 Freescale Semiconductor, Inc. Switch detection device and method of use
US9329237B2 (en) * 2014-01-10 2016-05-03 Freescale Semiconductor, Inc. Switch detection device and method of use
WO2017115610A1 (en) * 2015-12-28 2017-07-06 ローム株式会社 Vehicle switch control device and switch state detection method
US10894519B2 (en) 2015-12-28 2021-01-19 Rohm Co., Ltd. Vehicle switch control device and switch state detection method
CN113238545A (en) * 2021-04-30 2021-08-10 珠海格力电器股份有限公司 Vehicle control unit activation signal detection device, vehicle control unit and vehicle
CN113238545B (en) * 2021-04-30 2022-12-20 珠海格力电器股份有限公司 Vehicle control unit activation signal detection device, vehicle control unit and vehicle
CN113390452A (en) * 2021-06-16 2021-09-14 北京康斯特仪表科技股份有限公司 Method and device for calibrating switch type instrument
CN113390452B (en) * 2021-06-16 2023-08-18 北京康斯特仪表科技股份有限公司 Method and device for calibrating switch type instrument

Similar Documents

Publication Publication Date Title
US20160320998A1 (en) Control device, control method, computer program product, and electronic device
JP4535170B2 (en) Microcomputer system
US20130067258A1 (en) Data processor and electronic control unit
JP2011070309A (en) Switch state detection device and processing system
JP2011098561A (en) Controller for image processor
JP2008003797A (en) Microcomputer and electronic control device
JP2008107914A (en) Microcomputer, program and electronic control device for vehicle
JP5678784B2 (en) Circuit, electronic device, and printing apparatus
JP2008052699A (en) Micro-computer and control system
US9733690B2 (en) Communication device which decreases power comsumption by powering off unused functions when device is inactive
JP2010097427A (en) Processing apparatus, processing method and computer program
JP6040952B2 (en) Communication system, electronic control device
JP2015132894A (en) Micro controller device and operation control method of the same
JP2007299367A (en) Data processing system and method for touch pad
JP6402798B2 (en) Control device for vehicle power window device
JP2006240130A (en) Controller of printing device
JP3711849B2 (en) Microcomputer
JP2008114571A (en) Controller and data processor
JP2010258635A (en) Control apparatus
JP2013154653A (en) Vehicle mounted communication apparatus
JP2006350930A (en) Control circuit and information processor
JP2011079176A (en) Controller for image processor
JP2011013914A (en) Power-saving controller and power-saving control method
JP5682783B2 (en) Signal input circuit
JP4605053B2 (en) Data processing device