JPH0524311A - Counting memory and compensation apparatus - Google Patents

Counting memory and compensation apparatus

Info

Publication number
JPH0524311A
JPH0524311A JP3179781A JP17978191A JPH0524311A JP H0524311 A JPH0524311 A JP H0524311A JP 3179781 A JP3179781 A JP 3179781A JP 17978191 A JP17978191 A JP 17978191A JP H0524311 A JPH0524311 A JP H0524311A
Authority
JP
Japan
Prior art keywords
count
count value
area
counting
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
JP3179781A
Other languages
Japanese (ja)
Inventor
Hiroyuki Kasai
宏之 河西
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.)
Seikosha KK
Original Assignee
Seikosha KK
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 Seikosha KK filed Critical Seikosha KK
Priority to JP3179781A priority Critical patent/JPH0524311A/en
Publication of JPH0524311A publication Critical patent/JPH0524311A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide the above apparatus extremely reduced in the deviation of a count value even when there is the counting mistake due to the cutting-off of a power supply. CONSTITUTION:A count data memory means 2 making an address incremental at every desired operation to store count data, first and second count means 3a, 3b renewing count values when data is stored in the respective different predetermined addresses of the count data memory means 2, a judging means 5 judging whether the count values of the first and second count means 3a, 3b are correct when power supply is closed and a correction means 6 correcting the count values when the error of the count values is judged by the judging means 5 are provided.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、計数記憶補償装置に関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a counting memory compensator.

【0002】[0002]

【従来の技術】例えばプリンタでは、総印字枚数を計数
し、消耗品の交換やメインテナンス時期の目安等に役立
てている。従来、このような計数を行なう装置は、記録
用紙の総印字枚数そのもののデータをEEPROM(El
ectrically Erasable and Programmable ROM)等の不揮
発性の記憶手段に記憶し、1枚の記録用紙の印字開始時
毎にそのデータを書き換えていくものであった。
2. Description of the Related Art In a printer, for example, the total number of printed sheets is counted, and is used for replacement of consumables, maintenance time, and the like. Conventionally, an apparatus for performing such counting uses the EEPROM (El
The data is stored in a non-volatile storage means such as an electrically erasable and programmable ROM) and the data is rewritten each time printing of one recording sheet is started.

【0003】[0003]

【発明が解決しようとする課題】上記従来の計数記憶装
置では、記憶手段のデータ書換え中に電源を切られる
と、枚数データが正しく記憶されないことがある。例え
ば、複数バイトの記憶手段に枚数データを書き込む場
合、1バイト単位でデータ書換えを行なっていくが、上
位バイトのデータ書換えの最中に電源を切られると計数
値の上位桁の値が狂うことになり、実際の印字枚数と計
数値とで例えば1000枚、10000枚というように
大幅な誤差が生じてしまう。
In the conventional count storage device described above, if the power is turned off while the data in the storage means is being rewritten, the number data may not be stored correctly. For example, when writing the number-of-sheets data to a storage means of a plurality of bytes, the data is rewritten in 1-byte units, but if the power is turned off during the rewriting of the upper byte data, the value of the upper digit of the count value may change. Therefore, a large error occurs between the actual number of printed sheets and the count value, for example, 1,000 sheets, 10,000 sheets.

【0004】本発明は、電源遮断等による計数ミスがあ
ってもその計数値の狂いが極めて少ない計数記憶補償装
置を提供することを目的としている。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a counting memory compensating device in which even if there is a counting error due to power interruption or the like, the deviation of the counting value is extremely small.

【0005】[0005]

【課題を解決するための手段】本発明は、所望動作毎に
アドレスをインクリメントして計数データを記憶してい
く計数データ記憶手段と、この計数データ記憶手段のそ
れぞれ異なった所定アドレスにデータが記憶されたとき
に計数値を更新する複数の計数手段と、電源投入時に上
記複数の計数手段の計数値の正誤判定を行なう判定手段
と、この判定手段で上記計数値の誤りが判定されたとき
に、その計数値を修正する修正手段とを設けることによ
り、上記課題を解決するものである。
SUMMARY OF THE INVENTION According to the present invention, count data storage means for incrementing an address for each desired operation to store count data, and data are stored at different predetermined addresses of the count data storage means. A plurality of counting means for updating the count value when the power is turned on, a determination means for determining whether the count values of the plurality of counting means are correct when the power is turned on, and when the determination means determines an error in the count value. By providing a correction means for correcting the count value, the above problem is solved.

【0006】[0006]

【実施例】以下、本発明による装置をプリンタに用いた
場合の一実施例を図面に基づいて説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment in which the apparatus according to the present invention is used in a printer will be described below with reference to the drawings.

【0007】図1において、1は1枚の記録用紙の印字
開始を検出する検出手段、2は印字枚数を計数するため
のチェックデータを記憶する計数データ記憶手段であ
り、本例ではEEPROMのアドレス“0”〜“25
5”の256個の記憶領域を用いている。以下、計数デ
ータ記憶手段2としての記憶領域を領域Aという。3a
は計数データ記憶手段2の真中のアドレス“127”の
チェックデータが書き換えられたときに記憶していた計
数値を1つインクリメントした値に書き換えて記憶する
第1の計数手段、3bは計数データ記憶手段2のアドレ
ス“255”のチェックデータが書き換えられたときに
記憶していた計数値を1つインクリメントした値に書き
換えて記憶する第2の計数手段であり、各計数手段は上
記EEPROMのそれぞれ4バイト分の記憶領域を用い
ている。以下、第1の計数手段3aとしての記憶領域を
領域B、第2の計数手段3bとしての記憶領域を領域C
という。4は上記チェックデータおよび上記各計数値の
書換えを行なう制御手段、5は電源投入時に第1の計数
手段3aの計数値および第2の計数手段3bの計数値の
正誤判定を行なう判定手段、6は判定手段5により上記
計数値に誤りがあることが判定されたときに計数値を修
正する修正手段である。
In FIG. 1, reference numeral 1 is a detection means for detecting the start of printing on one recording sheet, and 2 is a count data storage means for storing check data for counting the number of printed sheets. "0" to "25"
5 ″ of 256 storage areas are used. Hereinafter, the storage area as the count data storage means 2 is referred to as area A. 3a
Is a first counting means for rewriting and storing the count value stored when the check data of the central address “127” of the count data storing means 2 is rewritten to a value incremented by one, 3b is a count data storage The second counting means stores the count value stored when the check data at the address "255" of the means 2 is rewritten into a value obtained by incrementing the count value by one, and each count means is 4 of the EEPROM. The storage area for bytes is used. Hereinafter, the storage area as the first counting means 3a is the area B, and the storage area as the second counting means 3b is the area C.
Say. Reference numeral 4 is a control means for rewriting the check data and each count value, and 5 is a judgment means for judging whether the count value of the first count means 3a and the count value of the second count means 3b are correct or incorrect when the power is turned on. Is a correction means for correcting the count value when the determination means 5 determines that the count value has an error.

【0008】図2は、領域A、領域Bおよび領域Cの構
成を詳しく示したものである。本例では、領域Aに記憶
するチェックデータとして“55h”と“AAh”とを
用いる。
FIG. 2 shows in detail the structure of the areas A, B and C. In this example, “55h” and “AAh” are used as the check data stored in the area A.

【0009】つぎに、図3のフローチャートに沿って、
通常の印字枚数の計数動作について説明する。
Next, according to the flow chart of FIG.
A normal counting operation of the number of printed sheets will be described.

【0010】まず、1枚目の記録用紙に印字を開始した
ことが検出手段1で検出されると、制御手段4の制御に
より、領域Aに記憶されているチェックデータのうち
“55h”と“AAh”の境目アドレスの検索が行なわ
れる。すなわち、領域Aのアドレス“0”から順次アド
レスをインクリメントしていき、各アドレスのチェック
データの変化を検出する。そして、チェックデータの変
化したアドレスを境目アドレスとする。例えば、図2で
は領域Aのアドレス“0”〜“4”にチェックデータ
“AAh”が記憶され、アドレス“5”〜“255”に
チェックデータ“55h”が記憶されているので、この
場合の境目アドレスは“5”となる。
First, when the detection means 1 detects that printing has started on the first recording sheet, the control means 4 controls "55h" and "55h" among the check data stored in the area A. A boundary address of "AAh" is searched. That is, the address is sequentially incremented from the address "0" of the area A, and the change in the check data at each address is detected. Then, the address where the check data has changed is used as the boundary address. For example, in FIG. 2, the check data “AAh” is stored in the addresses “0” to “4” of the area A, and the check data “55h” is stored in the addresses “5” to “255”. The boundary address is "5".

【0011】本例では、初期状態において領域Aの各ア
ドレスにはチェックデータ“55h”が、領域Bおよび
領域Cにはどちらも計数値“0”が書き込まれているも
のとする。このように領域Aの全アドレスのチェックデ
ータが同じものである場合は境目アドレスを“0”とす
る。そして、この境目アドレスのチェックデータを“A
Ah”に書き換える(ステップA)。
In this example, it is assumed that the check data "55h" is written in each address of the area A and the count value "0" is written in each of the areas B and C in the initial state. In this way, when the check data of all addresses in the area A is the same, the boundary address is set to "0". Then, the check data of this border address is changed to "A
Rewrite as Ah "(step A).

【0012】つぎに、2枚目の記録用紙に印字を開始し
たことが検出されると、このとき領域Aのアドレス
“0”にはチェックデータ“AAh”が記憶されている
ので、境目アドレスは“1”となり、このアドレスのチ
ェックデータを“AAh”に書き換える。このようにし
て、1枚の記録用紙に印字を開始する毎に領域Aに記憶
されているチェックデータを順次書き換えていく。そし
て、128枚目の記録用紙に印字を開始し、境目アドレ
ス“127”のチェックデータを書き換えると、つづい
て領域Bに記憶されている計数値“0”を1つインクリ
メントして“1”に書き換える(ステップB)。
Next, when it is detected that printing has started on the second recording sheet, at this time, since the check data "AAh" is stored in the address "0" of the area A, the boundary address is It becomes "1" and the check data of this address is rewritten to "AAh". In this manner, the check data stored in the area A is sequentially rewritten each time printing is started on one recording sheet. Then, when printing is started on the 128th recording sheet and the check data at the boundary address “127” is rewritten, the count value “0” stored in the area B is incremented by 1 to “1”. Rewrite (step B).

【0013】さらに、印字枚数が増えていき256枚目
の記録用紙に印字を開始し、境目アドレス“255”の
チェックデータを書き換えると、つづいて領域Cに記憶
されている計数値“0”を1つインクリメントして
“1”に書き換える(ステップC)。
Further, when the number of printed sheets is increased and printing is started on the 256th recording sheet and the check data at the boundary address "255" is rewritten, the count value "0" stored in the area C is continuously changed. It is incremented by 1 and rewritten to "1" (step C).

【0014】こうしてアドレス“255”のチェックデ
ータが書き換えられると、領域Aの全アドレスのチェッ
クデータが“AAh”となるので、つぎの境目アドレス
は再び“0”となる。
When the check data of the address "255" is rewritten in this way, the check data of all the addresses in the area A becomes "AAh", so that the next boundary address becomes "0" again.

【0015】このように、1枚の記録用紙に印字を開始
する毎に領域Aのアドレスが1つづつインクリメントさ
れ、そのアドレスのチェックデータが書き換えられてい
き、印字枚数が128枚目毎に領域Bの計数値が1つづ
つインクリメントされ、256枚目毎に領域Cの計数値
が1つづつインクリメントされていく。したがって、境
目アドレスが“128”より小さい場合は“(領域Bの
計数値)×256+(境目アドレス)”によって、ま
た、境目アドレスが“128”以上の場合は“(領域B
の計数値−1)×256+(境目アドレス)”によって
総印字枚数が算出される。さらに、境目アドレスの値に
関係なく“(領域Cの計数値)×256+(境目アドレ
ス)”によって総印字枚数が算出される。
As described above, the address of the area A is incremented by one each time printing is started on one recording sheet, and the check data of the address is rewritten, and the area is printed every 128th sheet. The count value of B is incremented by 1, and the count value of the area C is incremented by 1 every 256th sheet. Therefore, when the boundary address is smaller than "128", "(count value of area B) x 256 + (boundary address)" is used. When the boundary address is "128" or more, "(area B
The total number of printed sheets is calculated by "count value-1) x 256 + (boundary address)". Further, the total number of printed sheets is calculated by "(count value of area C) x 256 + (boundary address)" regardless of the value of the border address. Is calculated.

【0016】このように、領域BとCの計数値のうちい
ずれか一方が正しい値であれば、正しい総印字枚数を算
出することができる。両方の計数値が狂うと正しい総印
字枚数は算出不可能となってしまうが、複数の計数手段
を設けておけば、一方の計数値が狂ったときに他方の計
数値に基づいて、狂った計数値を修正することができ
る。すなわち、所望のタイミングで各計数手段の計数値
の正誤判定および修正を行なうことにより、常に正しい
印字枚数を算出することができるのである。
As described above, if either one of the count values of the areas B and C is a correct value, the correct total print number can be calculated. If both count values are incorrect, the correct total number of printed sheets cannot be calculated, but if multiple counting means are provided, when one count value is incorrect, it will be incorrect based on the other count value. The count value can be modified. That is, it is possible to always calculate the correct number of printed sheets by performing correctness / incorrectness determination and correction of the count value of each counting means at a desired timing.

【0017】つぎに、図4のフローチャートに沿って、
印字枚数の正誤判定および修正動作について説明する。
本例では、これらの動作は電源投入時に行なわれるもの
とする。
Next, according to the flow chart of FIG.
The determination operation of the number of printed sheets and the correction operation will be described.
In this example, these operations are performed when the power is turned on.

【0018】まず、電源を投入すると、上記と同様に制
御手段4により境目アドレスを検出し、そのアドレスが
“128”より小さいか否か判定する(ステップD)。
First, when the power is turned on, the border address is detected by the control means 4 in the same manner as above, and it is determined whether or not the address is smaller than "128" (step D).

【0019】境目アドレスが“128”より小さい場合
は、つぎに判定手段5により領域Bの計数値と領域Cの
計数値が等しいか否かを判定する。正常動作においては
両者の値は等しいはずであるが、両者が等しくないこと
が検出されると、修正手段6により領域Cの計数値を領
域Bの計数値に修正する(ステップE)。
If the boundary address is smaller than "128", the judging means 5 judges whether the count value of the area B is equal to the count value of the area C. In normal operation, the two values should be equal, but when it is detected that they are not equal, the correction means 6 corrects the count value of the area C to the count value of the area B (step E).

【0020】一方、境目アドレスが“128”以上の場
合は、つぎに判定手段5により領域Bの計数値が領域C
の計数値+1であるか否かを判定する。正常動作におい
ては領域Bの計数値は領域Cの計数値+1のはずである
が、そうでないことが検出されると、修正手段6により
領域Bの計数値を領域Cの計数値+1に修正する(ステ
ップF)。
On the other hand, when the boundary address is "128" or more, the count value of the area B is then determined by the determining means 5 to the area C.
It is determined whether or not the count value of +1. In normal operation, the count value of the area B should be the count value of the area C + 1, but when it is detected that this is not the case, the correction means 6 corrects the count value of the area B to the count value of the area C + 1. (Step F).

【0021】上記正誤判定および修正動作を具体的に説
明すると、例えば、境目アドレスが“127”のときに
印字を行ない、同アドレスのチェックデータの書換えに
つづいて領域Bの計数値を書き換えている最中に電源が
切られて、領域Bの計数値が狂ってしまったとする。正
常に書込み動作が終了していれば、領域Bの計数値は領
域Cの計数値+1になっていたはずである。この場合、
再び電源を投入するとまず境目アドレスが検出される。
このとき境目アドレスは“128”である。つぎに、境
目アドレスが“128”より小さいか否かが判定され
る。いま、境目アドレスは“128”以上であり、この
場合はつぎに、領域Bの計数値が領域Cの計数値+1で
あるか否かが判定される。いま、領域Bの計数値は領域
Cの計数値+1でないので、ステップFにおいて、修正
手段6により領域Bの計数値は領域Cの計数値+1に修
正される。
The correctness determination and correction operation will be specifically described. For example, when the boundary address is "127", printing is performed, and the count value of the area B is rewritten following the rewriting of the check data of the same address. It is assumed that the power supply is turned off during the process and the count value of the area B goes wrong. If the writing operation was completed normally, the count value of the area B would have been the count value of the area C + 1. in this case,
When the power is turned on again, the boundary address is detected first.
At this time, the boundary address is "128". Next, it is determined whether the boundary address is smaller than "128". Now, the boundary address is "128" or more, and in this case, it is next determined whether or not the count value of the region B is the count value of the region C + 1. Now, since the count value of the area B is not the count value of the area C + 1, the count value of the area B is corrected to the count value of the area C + 1 by the correction means 6 in step F.

【0022】このようにして、領域Bおよび領域Cの計
数値の正誤判定および修正動作が行なわれる。
In this way, the correctness / incorrectness determination and correction operation of the count values of the areas B and C are performed.

【0023】ところで、領域Aのチェックデータが書き
換えられる前に電源が切られてチェックデータが書き換
えられなくても、実際の印字枚数と計数との差は僅か1
枚である。
By the way, even if the check data in the area A is turned off before the check data is rewritten and the check data is not rewritten, the difference between the actual number of printed sheets and the count is only one.
It is a sheet.

【0024】なお、上記実施例においては、本発明によ
る装置をプリンタに用いた場合について説明したが、こ
れに限らず、複写機の複写枚数あるいはそれ以外の計数
を行なう機器等のように所定動作を繰り返すものであれ
ば適用できる。
In the above embodiment, the case where the apparatus according to the present invention is used for the printer has been described, but the present invention is not limited to this, and a predetermined operation such as an apparatus for counting the number of copies of a copying machine or other counting is performed. It is applicable if it repeats.

【0025】また、上記実施例では、計数データ記憶手
段2、第1の計数手段3aおよび第2の計数手段3bと
してEEPROMを用いたが、これに限らず、例えばバ
ックアップ電源を有するRAMのように、データの書換
え可能な不揮発性の記憶手段であればよい。
Further, in the above embodiment, the EEPROM is used as the count data storage means 2, the first count means 3a and the second count means 3b, but the present invention is not limited to this and, for example, a RAM having a backup power source may be used. Any non-volatile storage means capable of rewriting data may be used.

【0026】また、上記実施例では、計数データ記憶手
段2のアドレスを“0”〜“255”としたが、このア
ドレス数は任意に設定してよいものである。
In the above embodiment, the addresses of the count data storage means 2 are "0" to "255", but the number of addresses may be set arbitrarily.

【0027】また、上記実施例では、計数手段を2個と
したが、この数も任意に設定してよいものである。
In the above embodiment, the number of counting means is two, but this number may be set arbitrarily.

【0028】[0028]

【発明の効果】本発明によれば、例えば計数動作中に電
源が切られても、諸機器の実際の所定動作回数を極めて
正確に計数することができる。
According to the present invention, for example, even when the power is turned off during the counting operation, it is possible to count the actual predetermined number of times of operation of various devices extremely accurately.

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

【図1】本発明の一実施例を示したブロック図FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】図1の要部の構成を示した説明図FIG. 2 is an explanatory diagram showing a configuration of a main part of FIG.

【図3】計数動作を説明するためのフローチャートFIG. 3 is a flowchart for explaining a counting operation.

【図4】計数値の正誤判定および修正動作を説明するた
めのフローチャート
FIG. 4 is a flowchart for explaining correctness / incorrectness determination and correction operation of a count value.

【符号の説明】 2 計数データ記憶手段 3a 第1の計数手段 3b 第2の計数手段 5 判定手段 6 修正手段[Explanation of Codes] 2 Counting Data Storage Means 3a First Counting Means 3b Second Counting Means 5 Judging Means 6 Modifying Means

Claims (1)

【特許請求の範囲】 【請求項1】 所望動作毎にアドレスをインクリメント
して計数データを記憶していく計数データ記憶手段と、 この計数データ記憶手段のそれぞれ異なった所定アドレ
スにデータが記憶されたときに計数値を更新する複数の
計数手段と、 電源投入時に上記複数の計数手段の計数値の正誤判定を
行なう判定手段と、 この判定手段で上記計数値の誤りが判定されたときに、
その計数値を修正する修正手段と、 を具備することを特徴とする計数記憶補償装置。
Claim: What is claimed is: 1. Counting data storage means for incrementing an address for each desired operation to store count data, and data is stored at different predetermined addresses of the count data storage means. A plurality of counting means for updating the count value, a determining means for determining whether the count values of the plurality of counting means are correct when the power is turned on, and a determination means for determining an error in the count value,
A counting memory compensating apparatus comprising: a correcting unit that corrects the count value.
JP3179781A 1991-07-19 1991-07-19 Counting memory and compensation apparatus Pending JPH0524311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3179781A JPH0524311A (en) 1991-07-19 1991-07-19 Counting memory and compensation apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3179781A JPH0524311A (en) 1991-07-19 1991-07-19 Counting memory and compensation apparatus

Publications (1)

Publication Number Publication Date
JPH0524311A true JPH0524311A (en) 1993-02-02

Family

ID=16071783

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3179781A Pending JPH0524311A (en) 1991-07-19 1991-07-19 Counting memory and compensation apparatus

Country Status (1)

Country Link
JP (1) JPH0524311A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1044567A (en) * 1996-08-05 1998-02-17 Seiko Epson Corp Printer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1044567A (en) * 1996-08-05 1998-02-17 Seiko Epson Corp Printer equipment

Similar Documents

Publication Publication Date Title
JP4722839B2 (en) MEMORY CONTROL CIRCUIT, NONVOLATILE MEMORY DEVICE, AND MEMORY CONTROL METHOD
JP2821278B2 (en) Semiconductor integrated circuit
US7412575B2 (en) Data management technique for improving data reliability
WO2018054261A1 (en) Storage medium, data processing method and cartridge chip using this method
JP2006227830A (en) Information processor and method for controlling information processor
US4598402A (en) System for treatment of single bit error in buffer storage unit
JPH0524311A (en) Counting memory and compensation apparatus
JP2007331356A (en) Image formation device
JPH09282237A (en) Storage device using eeprom
JP2007316814A (en) Updating method of nonvolatile memory
US20010023471A1 (en) Storage device, method of processing stored data, and image forming apparatus
JP2000339232A (en) Method for writing count value into nonvolatile memory
JP4190505B2 (en) Image forming apparatus
JPH0314054A (en) Electronic disk device
JPH03188541A (en) Counting device
KR100989246B1 (en) Method for updating timing controller in an liquid crystal display device and device using the same
JP2603005B2 (en) Counter using non-volatile memory
JPH07141264A (en) Memory controller
JP4592280B2 (en) Data storage
JP3342103B2 (en) Writing method to nonvolatile memory
JP3414892B2 (en) Image forming device
JPS63230370A (en) Printer device
JP2001072267A (en) Image forming device
JP2006039726A (en) Electrical apparatus
JPH0647996A (en) Printer apparatus