JPH02299008A - Timer circuit - Google Patents

Timer circuit

Info

Publication number
JPH02299008A
JPH02299008A JP1119501A JP11950189A JPH02299008A JP H02299008 A JPH02299008 A JP H02299008A JP 1119501 A JP1119501 A JP 1119501A JP 11950189 A JP11950189 A JP 11950189A JP H02299008 A JPH02299008 A JP H02299008A
Authority
JP
Japan
Prior art keywords
timer
clock
timer data
time
data
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
JP1119501A
Other languages
Japanese (ja)
Inventor
Makoto Ozaki
眞 尾崎
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP1119501A priority Critical patent/JPH02299008A/en
Publication of JPH02299008A publication Critical patent/JPH02299008A/en
Pending legal-status Critical Current

Links

Landscapes

  • Electric Clocks (AREA)
  • Electronic Switches (AREA)

Abstract

PURPOSE:To prevent a software or hardware mode load from being applied by outputting a signal which inhibits timer data from being read out during carry operation. CONSTITUTION:This real-time clock inputs the clock T1Hz obtained by dividing the frequency of a reference clock CLK32kHz as the clock of an FF3 and a busy signal BTCBUSY goes up to an H level at the rise of this clock T1Hz to inhibit the timer data from being read out. At a point T2 of time after this point T1 of time, the output of the FF2, i.e. a timer clock RTC1Hz goes up to the H level, so that a timer counter 4 enters carry operation. Further, reset outputs of respective stages of a frequency divider 1 go up to the H level respectively 1/16ms after the point T2 of time and an FF3 is cleared. The timer data is therefore allowed to be read out. Thus, this simple constitution inhibits the timer data from being read out during the carry operation.

Description

【発明の詳細な説明】 発明の目的 (産業上の利用分野) 本発明は、例えばリアルタイムクロックなどに適用され
、計時動作を行なうタイマ回路に関する。
DETAILED DESCRIPTION OF THE INVENTION Object of the Invention (Field of Industrial Application) The present invention relates to a timer circuit that is applied to, for example, a real-time clock and performs a timekeeping operation.

従来の技術 リアルタイムクロックでは、タイマ回路によって生成さ
れる年2月1日、曜日2時間9分1秒等のタイマデータ
を順次読み出すものとなっているおり、タイマデータ読
出し中にタイマデータの桁上げがなされると、読出した
タイマデータが誤ったものとなってしまうおそれがある
In conventional real-time clocks, timer data such as February 1st, day of the week, 2 hours, 9 minutes, 1 second, etc., generated by a timer circuit is read out sequentially, and the timer data is not carried up while reading the timer data. If this is done, there is a risk that the read timer data will be incorrect.

そこで、このように誤ったタイマデータを得てしまうこ
とを防止するために従来は、読出したタイマデータを前
回に読出したタイマデータと比較し、異なっている場合
には最初から再びタイマデータの読出しを行なういわゆ
る二度読みをおこなっている。
Therefore, in order to prevent such incorrect timer data being obtained, conventionally, the read timer data is compared with the previously read timer data, and if they are different, the timer data is read again from the beginning. We are doing so-called double reading.

この二度読みは、例えば第4図に示すような処理によっ
て行われる。すなわち、制御部はタイマデータの読出し
処理に入ると、まずステップ4aにおいて読出しを行な
う桁(以下、読出し桁と称する)を「1秒」の桁に決定
し、次にステップ4bにおいて読出し桁のタイマデータ
(n)を読出す。そして次にステップ4cにおいて、ス
テップ4dで読出したタイマデータnと、前回に読出し
たタイマデータ(m)とを比較する。
This double reading is performed, for example, by the process shown in FIG. That is, when the control unit enters the timer data reading process, first, in step 4a, the digit to be read (hereinafter referred to as the read digit) is determined to be the "1 second" digit, and then in step 4b, the timer data of the read digit is determined. Read data (n). Then, in step 4c, the timer data n read out in step 4d is compared with the timer data (m) read out last time.

ここで、タイマデータnとタイマデータmとが一致した
ら、ステップ4dにおいて全タイマデータの読出しが終
了したか否かの判断を行なう。
Here, if timer data n and timer data m match, it is determined in step 4d whether reading of all timer data has been completed.

ここで、全タイマデータの読出しが終了していれば、処
理をメインルーチンに戻す。また、全タイマデータの読
出しが終了していなければ処理をステップ4eに移行し
、このステップ4eにおいて読出し桁を次の桁(例えば
、「1秒」桁=「10秒」桁=「1時間桁」桁=「10
時間」桁−・・・・・・「1年」桁→「10年」桁とい
う順番に設定されている)に変更し、ステップ4b以降
の処理を繰返す。
Here, if reading of all timer data has been completed, the process returns to the main routine. If reading of all timer data has not been completed, the process moves to step 4e, and in step 4e, the read digit is changed to the next digit (for example, "1 second" digit = "10 second" digit = "1 hour digit"). ” digit = “10
"time" digit (set in the order of "1 year" digit → "10 year" digit), and repeat the process from step 4b onward.

一方、ステップ4Cにおいてタイマデータnとタイマデ
ータmとが一致しなかった場合、当該読出し桁の桁上げ
があったので、処理をステップ4fに移行し、このステ
ップ4fにおいてタイマデータnをタイマデータmとし
、その後メインルーチンに戻る。
On the other hand, if timer data n and timer data m do not match in step 4C, there has been a carry of the read digit, so the process moves to step 4f, and in this step 4f, timer data n is changed to timer data m. and then return to the main routine.

このようにタイマデータ読出し中に桁上げが行われてタ
イマデータ読出しの処理を終了した場合、制御部はメイ
ンルーチンから再びタイマデータ読出し処理に入り、上
述した処理を行なう。
In this way, when a carry is performed during timer data reading and the timer data reading process is completed, the control section enters the timer data reading process again from the main routine and performs the above-mentioned process.

したがって、場合によっては第4図に示す処理を何度も
繰り返さなければならなく、処理のオーバヘッドが非常
に大きいものとなっている。
Therefore, in some cases, the process shown in FIG. 4 must be repeated many times, resulting in a very large processing overhead.

また、誤ったタイマデータを得てしまうことを防止する
別の手段として、タイマデータの読出し中にはタイマ回
路の動作をディゼーブルとして桁上げが生じないように
する方法や、クロック同期回路を設けてタイマクロック
(I Hz)の立ち上がりエツジを検出し、制御部に対
して割り込みをかける方法などがある。
Another method for preventing incorrect timer data is to disable the operation of the timer circuit to prevent carry from occurring while reading timer data, or to provide a clock synchronization circuit. There is a method of detecting the rising edge of a timer clock (I Hz) and issuing an interrupt to the control unit.

ところが、この方法のうちの前者の方法では、クロック
ホールド回路を必要とする上に、タイマ回路の計時に遅
れが生じるおそれがある。さらに、タイマ回路がディゼ
ープル状態であるときに電源がOFFとなると誤動作し
てしまうため、パワーダウンを検出してタイマ回路をイ
ネーブルにする手段を付加する必要がある。
However, the former method requires a clock hold circuit and may cause a delay in timing by the timer circuit. Furthermore, if the power is turned off while the timer circuit is in the disabled state, it will malfunction, so it is necessary to add means for detecting power-down and enabling the timer circuit.

また、前述した2つの方法のうちの後者の方法では、ク
ロック同期回路や割り込みコントローラなどを設けなけ
ればならなず、ハードウェア的に負荷が掛かる。
Furthermore, in the latter of the two methods described above, a clock synchronization circuit, an interrupt controller, and the like must be provided, which imposes a burden on the hardware.

(発明が解決しようとする課題) 以上のように従来のタイマ回路では、タイマデータ続出
し中にタイマデータの桁上げがなされることによって読
出したタイマデータが誤ったものとなってしまうことを
防止する手段を講じているために、処理のオーバヘッド
が大きくなったり、ハードウェア的に負荷が掛かったり
、更には計時に遅れが生じたりするといった不具合を有
していた。
(Problem to be Solved by the Invention) As described above, in the conventional timer circuit, it is possible to prevent the read timer data from becoming incorrect due to a carry of the timer data while the timer data is continuously being output. Because of this, there have been problems such as increased processing overhead, increased hardware load, and delays in time measurement.

本発明はこのような事情を考慮してなされたものであり
、その目的とするところは、簡易な構成でありながら桁
上げ中におけるタイマデータの読出しを禁止することが
でき、ソフトウェア的・ハードウェア的に負荷が掛かる
ことがなく、かつ計時に遅れが生じることのないタイマ
回路を提供することにある。
The present invention has been made in consideration of these circumstances, and its purpose is to be able to prohibit the reading of timer data during carry while having a simple configuration, and to provide a software and hardware-friendly To provide a timer circuit which is not subject to any physical load and which does not cause a delay in time measurement.

[発明の構成] (課題を解決するための手段) 本発明は、少なくとも桁上げ中はタイマデータ読出しを
禁止する信号(ビジィ信号)を出力するようにした。
[Structure of the Invention] (Means for Solving the Problems) In the present invention, a signal (busy signal) for inhibiting timer data reading is output at least during carry.

(作 用) このような手段を講じたことにより、少なくとも桁上げ
中はデータ読出しを禁止する信号が出力されるので、本
タイマ回路からタイマデータを読出す側において、上記
データ読出しを禁止する信号を監視し、上記データ読出
しを禁止する信号が出力されていない期間にタイマデー
タを読出せば、桁上げ中におけるタイマデータの読出し
を行なってしまうことがない。
(Function) By taking such measures, a signal that prohibits data reading is output at least during carry, so the side that reads timer data from this timer circuit outputs the signal that prohibits data reading. By monitoring the timer data and reading the timer data during a period when the signal prohibiting data reading is not output, the timer data will not be read out during carry.

(実施例) 以下、図面を参照して本発明の一実施例に係るタイマ回
路に付き説明する。
(Embodiment) Hereinafter, a timer circuit according to an embodiment of the present invention will be explained with reference to the drawings.

第1図は同タイマ回路を適用して構成されるリアルタイ
ムクロックの構成を示す図である。図中、1は15個の
D−フリップフロップ回路(以下、FFと称する)la
〜10により構成された周知の構成の分周器であり、第
1段のFF1aに入力されている基準クロックCLK3
2KHz(周波数32.788KHz )を15分周し
、IHzのクロックT I Hzを生成する。この分周
器1で生成されたクロックTIHzはFF2の入力端子
およびFF3のクロック端子に入力されており、FF2
では、FF1bのセット出力T8KHz(周波数8.1
9KHz )の立ち上がりに同期することによって1/
16+as分シフトされ、タイマクロックRTCIHz
とされる。このタイマクロックRTCIHzは周知の構
成のタイマカウンタ4に入力され、計時動作に供される
FIG. 1 is a diagram showing the configuration of a real-time clock constructed by applying the same timer circuit. In the figure, 1 indicates 15 D-flip-flop circuits (hereinafter referred to as FF) la
It is a frequency divider with a well-known configuration composed of 10 to 10, and the reference clock CLK3 is input to the first stage FF1a.
2 KHz (frequency 32.788 KHz) is divided by 15 to generate an IHz clock T I Hz. The clock TIHz generated by this frequency divider 1 is input to the input terminal of FF2 and the clock terminal of FF3, and
Now, set output of FF1b T8KHz (frequency 8.1
9KHz) by synchronizing with the rising edge of
Shifted by 16+as, timer clock RTCIHz
It is said that This timer clock RTCIHz is input to a timer counter 4 having a well-known configuration, and is used for timekeeping operation.

FF3はタイマデータの読出しを禁止する信号としての
ビジィ信号RTCBUSYを生成するものであり、クロ
ックTIHzの立ち上がりからクリアがなされるまでの
期間にrHJレベルの信号を出力する。このFF3から
出力されるビジィ信号RTCBUSYに応じて、ステー
タスレジスタ5中のどシイフラグが0N10FFされる
FF3 generates a busy signal RTCBUSY as a signal for inhibiting reading of timer data, and outputs a signal at rHJ level during the period from the rising edge of the clock TIHz until it is cleared. In response to the busy signal RTCBUSY output from the FF 3, the busy flag in the status register 5 is set to 0N10FF.

6はNANDゲートであり、分周器1の第1段のFF1
aのリセット出力T16KHz(周波数16.384K
Hz )および第2段のFF1bのリセット出力T8K
Hz、第3段のFF1cのセット出力T4KHz(周波
数4.098 KHz )がそれぞれ入力されている。
6 is a NAND gate, and FF1 of the first stage of frequency divider 1
a reset output T16KHz (frequency 16.384K
Hz) and reset output T8K of second stage FF1b
Hz, and the set output T4KHz (frequency 4.098 KHz) of the third stage FF1c are input, respectively.

このNANDゲート6の出力は、ANDゲート7を介し
てFF3のクリア端子に入力されている。なお、AND
ゲート7にはリセット信号RESETも入力されている
。ここでANDゲート7は負論理であり、NANDゲー
ト6の出力およびリセット信号RESETの論理和を取
り、その結果をFF3のクリア信号として出力する。
The output of this NAND gate 6 is input to the clear terminal of the FF 3 via an AND gate 7. In addition, AND
A reset signal RESET is also input to the gate 7. Here, the AND gate 7 is of negative logic, takes the logical sum of the output of the NAND gate 6 and the reset signal RESET, and outputs the result as a clear signal for the FF3.

次に以上のように構成されたリアルタイムクロックの動
作を第2図に示すタイムチャートを参照しながら説明す
る。
Next, the operation of the real-time clock configured as described above will be explained with reference to the time chart shown in FIG.

本リアルタイムクロックでは、基準クロックCL K 
32 KHzを15分周して得たIHzのクロックTI
HzをFF3のクロックとして入力し、このクロックT
IHzの立ち上がりでビジィ信号RTCBUSYがrH
Jレベルとなり、タイマデータの読出しが禁止される。
In this real-time clock, the reference clock CL K
IHz clock TI obtained by dividing 32 KHz by 15
Hz as the clock of FF3, and this clock T
The busy signal RTCBUSY becomes rH at the rising edge of IHz.
It becomes J level and reading of timer data is prohibited.

(T1時点)。(as of T1).

このT1時点から1/16isが経過し、12時点に至
ると、FF2の出力、すなわちタイマクロックRT C
111zがrHJレベルとなり、従ってタイマカウンタ
4は桁上げを行なう。
When 1/16 is passes from this time T1 and reaches time 12, the output of FF2, that is, the timer clock RT C
111z becomes the rHJ level, so the timer counter 4 performs a carry.

さらに、この12時点から1/16+asが経過すると
(T3時点)、分周器1の第1段のFF1aのリセット
出力T 16 KIIzおよび第2段のF F i b
のリセット出力T8KHz、第3段のF F 1 cの
セット出力T 4 KHzがそれぞれrHJレベルとな
り、NANDゲート6の出力がrLJレベルとなる。こ
れにより、ANDゲート7の出力も「L」レベルとなり
、FF3がクリアされる。従って、FF3の出力するビ
ジィ信号RTCBUSYは「L」レベルとなり、タイマ
データの読出しが許可される。
Furthermore, when 1/16+as has passed from this 12 time point (time point T3), the reset output T 16 KIIz of the first stage FF1a of the frequency divider 1 and the second stage F F i b
The reset output T8 KHz of the third stage F F 1 c and the set output T 4 KHz of the third stage F F 1 c are respectively at the rHJ level, and the output of the NAND gate 6 is at the rLJ level. As a result, the output of the AND gate 7 also becomes "L" level, and the FF3 is cleared. Therefore, the busy signal RTCBUSY output from FF3 becomes "L" level, and reading of timer data is permitted.

このように、タイマクロックRTCIHzの立ち上がり
時点T2、すなわち桁上げ時点の前後それぞれの1/1
6+msにわたってビジィ信号RTCBUSYがrHJ
レベルとなり、タイマデータの読出しが禁止される。
In this way, the rise time T2 of the timer clock RTCIHz, that is, 1/1 before and after the carry time, respectively.
Busy signal RTCBUSY is rHJ for 6+ms
level, and reading of timer data is prohibited.

したがって、本リアルタイムクロック制御部(図示せず
)は、例えば次のようにタイマデータ読出し処理を行な
う。すなわち、第3図に示すように、ステップ3aにお
いてステータスレジスタ5のビジィフラグをチェックし
、ステップ3bにおいてステータスレジスタ5のビジィ
フラグが「1」であるか否かの判断を行う。
Therefore, the present real-time clock control section (not shown) performs timer data read processing, for example, as follows. That is, as shown in FIG. 3, the busy flag of the status register 5 is checked in step 3a, and it is determined whether the busy flag of the status register 5 is "1" in step 3b.

ここで、ビジィフラグが「1」であれば、ステップ3a
でのとシイフラグのチェックを繰返し、ビジィフラグが
「0」になるのを待つ。
Here, if the busy flag is "1", step 3a
Repeat the check of the check flag and wait until the busy flag becomes "0".

そして、ステップ3bにおいてビジィフラグが「0」に
なったら、ステップ3Cにおいて、桁上げの有無のチェ
ックなどを行なうことなく、全タイマデータを一括的に
読出し、これを現在のタイマデータとする。
When the busy flag becomes "0" in step 3b, all timer data is read out at once in step 3C without checking whether there is a carry or not, and this is set as the current timer data.

このように本実施例によれば、桁上げ時点の前後それぞ
れの1/16IIlsにわたってビジィ信号RTCBU
SYがrHJレベルとなり、ステータスレジスタ5のビ
ジィフラグが「1」にセットされるので、本リアルタイ
ムクロックの制御部は上述したような非常に簡便な処理
によって正しいタイマデータを読出すことができ、ソフ
トウェア的およびハードウェア的な付加が生じない。ま
た、計時動作を停止させるようなことがないので、計時
に遅れが生じたりすることもない。
As described above, according to this embodiment, the busy signal RTCBU is output for 1/16 IIls before and after the carry time.
Since SY becomes rHJ level and the busy flag of status register 5 is set to "1", the control section of this real-time clock can read the correct timer data by the very simple processing described above, and the software and no additional hardware is required. Further, since there is no need to stop the timekeeping operation, there is no possibility that there will be a delay in timing.

なお、本発明は上記実施例に限定されるものではない。Note that the present invention is not limited to the above embodiments.

例えば、上記実施例ではビジィ信号RTCBUSYをr
HJレベルとする期間をタイマクロックRTCIHzの
立ち上がり時点の前後それぞれの1/16isにわたる
期間(1/8msの期間)としているが、この期間龜タ
イマクロックRTCIHzの立ち上がり時点を含んでい
ればいかなる時間であっても良い。また、上記実施例に
おいては本発明に係るタイマ回路をリアルタイムクロッ
クに適用しているが、例えばタイマカウンタサーキット
やプログラマブルインターバルタイマなどといった他の
装置に適用することも可能である。このほか、本発明の
要旨を逸脱しない範囲で種々の変形実施が可能である。
For example, in the above embodiment, the busy signal RTCBUSY is
The period when the HJ level is set is a period of 1/16 is (1/8 ms) before and after the rising time of the timer clock RTCIHz, but this period can be any length of time as long as it includes the rising time of the timer clock RTCIHz. It's okay. Further, in the above embodiments, the timer circuit according to the present invention is applied to a real-time clock, but it is also possible to apply it to other devices such as a timer counter circuit or a programmable interval timer. In addition, various modifications can be made without departing from the gist of the present invention.

[発明の効果] 本発明によれば、少なくとも桁上げ中はタイマデータ読
出しを禁止する信号を出力するようにしたので、簡易な
構成でありながら桁上げ中におけるタイマデータの読出
しを禁止することができ、ソフトウェア的・ハードウェ
ア的に負荷が掛かるこでがなく、かつ計時に遅れが生じ
ることのないタイマ回路となる。
[Effects of the Invention] According to the present invention, a signal for prohibiting reading of timer data at least during carry is output, so that it is possible to prohibit reading of timer data during carry despite the simple configuration. The present invention provides a timer circuit that does not impose any burden on software or hardware, and that does not cause time delays.

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

第1図乃至第3図は本発明の一実施例に係るタイマ回路
を説明する図であり、第1図は同タイマ回路を適用して
構成されたリアルタイムクロックの構成を示す図、第2
図は動作タイムチャート、第3図はタイマデータ読出し
処理の一例を示すフローチャート、第4図は従来技術を
説明する図である。 1・・・分周器、1a〜1o・・・D−フリップフロッ
プ回路(FF) 、2.3・・・D−フリップフロップ
回路(FF) 、4・・・タイマカウンタ、5・・・ス
テータスレジスタ、6・・・NANDゲート、7・・・
ANDゲート。
1 to 3 are diagrams for explaining a timer circuit according to an embodiment of the present invention, and FIG. 1 is a diagram showing the configuration of a real-time clock configured by applying the timer circuit, and
3 is an operation time chart, FIG. 3 is a flowchart showing an example of timer data read processing, and FIG. 4 is a diagram explaining a conventional technique. 1... Frequency divider, 1a to 1o... D-flip-flop circuit (FF), 2.3... D-flip-flop circuit (FF), 4... timer counter, 5... status Register, 6...NAND gate, 7...
AND gate.

Claims (1)

【特許請求の範囲】[Claims] 少なくとも桁上げ中はタイマデータの読出しを禁止する
信号を出力する手段を具備したことを特徴とするタイマ
回路。
A timer circuit comprising means for outputting a signal for inhibiting reading of timer data at least during carry.
JP1119501A 1989-05-12 1989-05-12 Timer circuit Pending JPH02299008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1119501A JPH02299008A (en) 1989-05-12 1989-05-12 Timer circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1119501A JPH02299008A (en) 1989-05-12 1989-05-12 Timer circuit

Publications (1)

Publication Number Publication Date
JPH02299008A true JPH02299008A (en) 1990-12-11

Family

ID=14762828

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1119501A Pending JPH02299008A (en) 1989-05-12 1989-05-12 Timer circuit

Country Status (1)

Country Link
JP (1) JPH02299008A (en)

Similar Documents

Publication Publication Date Title
JPS5983254A (en) Watchdog timer
JPH0212442A (en) Ic card with erroneous write preventing function
US5467354A (en) Test control circuit for controlling a setting and resetting of a flipflop
JPH0589261A (en) Microcomputer
JP3057538B2 (en) LSI tester
JPS58182924A (en) signal generation circuit
JPH0219869Y2 (en)
JPH02205940A (en) Watchdog timer device
SU1624532A1 (en) D flip-flop
JP2598547Y2 (en) Pattern generator for semiconductor test equipment
JPH0465407B2 (en)
JPS63282865A (en) Input/output circuit
JPS63141415A (en) Parallel serial conversion circuit
JP2981275B2 (en) Programmable controller
JPH02244355A (en) Pulse count system
JPH0544684B2 (en)
JPS603015A (en) Clock break detection system
JPH03274810A (en) Semiconductor integrated circuit
JPS64669B2 (en)
JPH0217518A (en) Data processor
JPS6378214A (en) Timer monitor system
JPS6273171A (en) Logical waveform forming circuit
JPS61160155A (en) Timer control system
JPS59154522A (en) Time setting circuit of digital time unit
JPS58178452A (en) Self-diagnosing system of microcomputer