JPS60231226A - Detector of status of switch - Google Patents

Detector of status of switch

Info

Publication number
JPS60231226A
JPS60231226A JP59089047A JP8904784A JPS60231226A JP S60231226 A JPS60231226 A JP S60231226A JP 59089047 A JP59089047 A JP 59089047A JP 8904784 A JP8904784 A JP 8904784A JP S60231226 A JPS60231226 A JP S60231226A
Authority
JP
Japan
Prior art keywords
switch
state
register
timer
contents
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
JP59089047A
Other languages
Japanese (ja)
Inventor
Seiji Yaegashi
八重樫 誠次
Hideo Sakamoto
英夫 坂本
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.)
NIPPON DENKI KANJI SYST KK
NEC Corp
Original Assignee
NIPPON DENKI KANJI SYST KK
NEC Corp
Nippon Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NIPPON DENKI KANJI SYST KK, NEC Corp, Nippon Electric Co Ltd filed Critical NIPPON DENKI KANJI SYST KK
Priority to JP59089047A priority Critical patent/JPS60231226A/en
Publication of JPS60231226A publication Critical patent/JPS60231226A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To decide the ON/OFF state correctly even if there is a noise or the like by detecting the state of a switch at a fixed time interval and storing the detected result in the 1st and 2nd registers to decide the state of the switch. CONSTITUTION:The state of the switch 1 is detected at a time set in a timer 3, and when the state of the switch 1 is ON, the contents of the 1st register 4 is read out. When the state of the switch 1 is ON and the contents of the 2nd register 5 are OFF, and 2nd register 5 is turned on and the ON state of the 1st register 4 is recognized. If the 1st register 4 is ON, the 1st register 4 is turned OFF. When the 1st register 4 is OFF and the contents of the 2nd register are ON, the 2nd register 5 is turned off and the OFF status of the switch 1 is recognized.

Description

【発明の詳細な説明】 本発明はスイッチのON・OFF状態を正しく判断する
スイッチ状態検出装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a switch state detection device that correctly determines the ON/OFF state of a switch.

従来、情報処理装置等においては、処理動作の切換えな
どに使用されているスイッチ(一般に直流を開閉してい
る)のON・OFF状態を中央演算処理装置c以下CP
Uと称する)で検出して装置が正しく動作しているか否
かを判断するようにしているが、(例えばスイッチの状
態がONなら%1”、OFFなら′″O”と判断する)
スイッチの接点のチャタリングその他の雑音等がおると
、誤った検出をして装置が誤動作を起すことがあった。
Conventionally, in information processing equipment, etc., the ON/OFF state of switches (generally opening and closing direct current) used for switching processing operations, etc. is controlled by the central processing unit c or lower CP.
(referred to as U) to determine whether the device is operating correctly (for example, if the switch status is ON, it is determined as %1", and if it is OFF, it is determined as ``O'').
Chattering of the switch contacts and other noises could result in incorrect detection and malfunction of the device.

そこで本発明は雑音等があっても正しく判断するスイッ
チ状態検出装置を提供しようとするものである。
Therefore, the present invention aims to provide a switch state detection device that can correctly determine the state of a switch even in the presence of noise or the like.

即ち1本発明位タイマーを用いて一定時間間隔でスイッ
チのON@OFF状態を検出し、それをレジスタに例え
ばONならば11″、OFFならば′0”として記憶し
、そのレジスタの内容を検出することくよってスイッチ
のON・OFF状態を判別するようにしたものである。
In other words, a timer according to the present invention is used to detect the ON@OFF state of a switch at fixed time intervals, and this is stored in a register as, for example, 11" if it is ON, and '0' if it is OFF, and the contents of that register are detected. The ON/OFF state of the switch is determined based on what the switch does.

以下本発明の実施例について図面に基づき説明する。Embodiments of the present invention will be described below based on the drawings.

第1図は本発明の実施例のブロック図で、1はスイッチ
、2はスイッチのON・OFF状態を検出するCPU%
3はタイマー、4は第ルジスタ。
FIG. 1 is a block diagram of an embodiment of the present invention, where 1 is a switch and 2 is a CPU percentage that detects the ON/OFF state of the switch.
3 is the timer, 4 is the first Lujista.

5は第2レジスタである。5 is the second register.

なおCPU2は定められた時間間隔のタイマー割込みで
、第2図に示すようにサブルーチンプログラムにジャン
プしてくるように設定しておく。
Note that the CPU 2 is set to jump to a subroutine program as shown in FIG. 2 at a timer interrupt at a predetermined time interval.

さて、第2図に示すCPUにおけるフローチャートと、
第3図の動作のタイムチャートを参照し乍ら、動作を説
明すると、タイマー3に設定した時間でこのサブルーチ
ンプログラムにジャンプしてくると%まず、タイマー3
と割込みをリセットし、スイッチ1の状態を検出しその
開閉によってCPU2は次の動作を行う。
Now, the flowchart in the CPU shown in Fig. 2,
To explain the operation while referring to the operation time chart in Figure 3, when jumping to this subroutine program at the time set in timer 3, the timer 3
The CPU 2 resets the interrupt, detects the state of the switch 1, and performs the following operation depending on whether the switch 1 is opened or closed.

まずスイッチ1がONの場合、第ルジスタ4の内容(前
のスイッチの状態)を読み出し、その状態1例えばON
・OFF状態によってさらに次の判断を行う。
First, when the switch 1 is ON, the contents of the register 4 (the state of the previous switch) are read, and the state 1, for example, is ON.
・The next judgment is made depending on the OFF state.

第ルジスタ4がONの場合(第2図1の場合)g2レジ
スタ5の内容がOFFなら、第2レジスタ5をONにし
てタイマー及び割込みをセットして、メインプログラム
へもどる。
When the register 4 is ON (in the case of FIG. 2 1), if the contents of the g2 register 5 are OFF, the second register 5 is turned ON, a timer and an interrupt are set, and the process returns to the main program.

ここで、初めてスイッチがON状態であると認識する。At this point, it is recognized for the first time that the switch is in the ON state.

第3図では■の時点である。In Figure 3, this is the point ■.

第ルジスタ4がOFFの場合(第2図■の場合)は、第
ルジスタ4をONにし、タイマー及び割込みをセットし
て、メインプログラムへモトる。この場合スイッチ1の
状態を表わす第2レジスタ5のON(第3図■′の時点
)、OFF (第3図■の時点)はかわらない。
If the registor 4 is OFF (case (2) in FIG. 2), turn the registor 4 ON, set the timer and interrupt, and return to the main program. In this case, the ON state of the second register 5 representing the state of the switch 1 (at the time of ``2'' in FIG. 3) and OFF (at the time of ``2'' in FIG. 3) does not change.

次に、スイッチ1がOFFの場合もまた。第ルジスタ4
の内容のON・OFFによって更に次の判断を行う。
Next, also when switch 1 is OFF. No. 4
Further, the following judgment is made depending on whether the content of is ON or OFF.

第ルジスタ4がONの場合(第2図■の場合)第ルジス
タ4をOFFにして、タイマー及び割込みをセットして
、メインプログラムへもどる。
If the first register 4 is ON (in the case of ◯ in Fig. 2), turn the second register 4 OFF, set the timer and interrupt, and return to the main program.

この場合、第2レジスタ5のON(第3図■の時点)%
OFF (第3図■′の時点)はかわらない。
In this case, the second register 5 is ON (at the time of ■ in Figure 3)%
OFF (time point ■' in Figure 3) remains unchanged.

第ルジスタ4がOFFの場合(第2図■の場合)第2し
・ジスタ5の内容がONなら、第2レジスタ5をOFF
にしてタイマー及び割込みをセットして、メインプログ
ラムへもどる。ここで初めてスイッチ1がOFF状態で
あると認識する。第3図では■の時点である。
When the second register 4 is OFF (in the case of ■ in Figure 2), if the contents of the second register 5 are ON, the second register 5 is turned OFF.
Set the timer and interrupt and return to the main program. For the first time, it is recognized that switch 1 is in the OFF state. In Figure 3, this is the point ■.

要するに、本発明は連続した2回の検出タイ電ングに連
続的に雑音等が発生しない限シ、第2レジスタ5が誤動
作することはなく、そのような状態は確率的に殆んどな
いという考えによるもので、第2レジスタ5のON@O
FFが即ちスイッチ1のON・OFFを示すものとして
利用されるものである。
In short, in the present invention, the second register 5 will not malfunction as long as noise etc. do not occur continuously during two consecutive detection tie cycles, and such a situation is highly unlikely to occur. This is based on the idea, and the ON@O of the second register 5
The FF is used to indicate ON/OFF of the switch 1.

以上説明したように本発明は定められた時間間隔でスイ
ッチの状態を検出し、それを第1.第2のレジスタに記
憶し、これでスイッチの状態を判別することによって、
雑音に起因する誤判断を防止して装置の誤動作を防止す
る効果がある。
As explained above, the present invention detects the state of the switch at predetermined time intervals, and detects the state of the switch at the first . By storing it in the second register and determining the state of the switch with this,
This has the effect of preventing erroneous judgments caused by noise and preventing malfunctions of the device.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の実施例のブロック図、第2図は中央演
算処理装置において行なわれる演算のフローチャート、
第3図は実施例におけるスイッチの状態、タイマー割込
み、第1及び第2のレジスタの状態を示すタイムチャー
トである。 1・・・スイッチ、2・・・中央演算処理装置、3・・
・タイマー、4・・・第ルジスタ、5・・・第217ジ
スタ。 特許出願人 日本電気株式会社
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a flowchart of operations performed in the central processing unit,
FIG. 3 is a time chart showing the states of switches, timer interrupts, and states of the first and second registers in the embodiment. 1...Switch, 2...Central processing unit, 3...
・Timer, 4th... 217th jistar, 5... 217th jistar. Patent applicant: NEC Corporation

Claims (1)

【特許請求の範囲】 直流回路を開閉する接点を有するスイッチと。 定められた時間間隔でそのスイッチの開開によ?て現わ
れる電圧を検出して、その接点が開状態であれば第1の
状態を、閉状態であれば第2の状態を記憶する第ルジス
タと、スイッチの接点が開状態であって、前記の第ルジ
スタに第1の状態が記憶されていれば第1の状態を記憶
し、スイッチの接点が閉状態であって、第ルジスタに第
2の状態が記憶されていれば第2の状態を記憶し、また
上記以外の場合は前の状態を継続して記憶する第2レジ
スタとを具備したことを特徴とするスイッチ状態検出装
置。
[Claims] A switch having contacts for opening and closing a DC circuit. By opening and opening that switch at set time intervals? a first lujistor that detects the voltage appearing at the switch and stores the first state if the contact is open and the second state if the contact is closed; If the first state is stored in the first rugister, the first state is stored, and if the contact of the switch is in the closed state and the second state is stored in the second rugister, the second state is stored. and a second register that continues to store the previous state in cases other than the above.
JP59089047A 1984-05-02 1984-05-02 Detector of status of switch Pending JPS60231226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59089047A JPS60231226A (en) 1984-05-02 1984-05-02 Detector of status of switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59089047A JPS60231226A (en) 1984-05-02 1984-05-02 Detector of status of switch

Publications (1)

Publication Number Publication Date
JPS60231226A true JPS60231226A (en) 1985-11-16

Family

ID=13959968

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59089047A Pending JPS60231226A (en) 1984-05-02 1984-05-02 Detector of status of switch

Country Status (1)

Country Link
JP (1) JPS60231226A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5251828A (en) * 1975-10-23 1977-04-26 Omron Tateisi Electronics Co Key input discriminating unit
JPS55131837A (en) * 1979-04-03 1980-10-14 Nec Corp Key input discriminating circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5251828A (en) * 1975-10-23 1977-04-26 Omron Tateisi Electronics Co Key input discriminating unit
JPS55131837A (en) * 1979-04-03 1980-10-14 Nec Corp Key input discriminating circuit

Similar Documents

Publication Publication Date Title
JPS62239221A (en) Word processor
JPS60231226A (en) Detector of status of switch
JPH0540606Y2 (en)
JPH04354011A (en) Power source make and break controller
JP2553838Y2 (en) Switch operation input identification device
JPS6059552A (en) Power supply circuit
JPS6141132Y2 (en)
JPS63257832A (en) Personal computer
JPH03134928A (en) Relay driving circuit
JPH0968897A (en) Copying machine
JPH01298420A (en) Power off system for information processor
JPS5715257A (en) Auto cassette changer
JPS5982893A (en) Washer
JPS57106931A (en) Monitoring device for input and output controller
JPH04364544A (en) Abnormality processing circuit of controller
JPH04243435A (en) Trace circuit
JPH02278446A (en) Memory access control circuit
JPS58196349U (en) Elevator operating equipment
JPS59144938A (en) Contact type encoder switch reader
KR940004573A (en) High-speed driving control method of magnetic tape recording and reproducing apparatus
KR930014561A (en) Drum drying method
JPH0519884A (en) Electronic equipment
JPS6462701A (en) Programmable controller
JPH0553967A (en) State change detection control circuit
JPS5992430U (en) dubbing cassette tape recorder