JPH04369095A - Method for storing numerical data for electronic integrator - Google Patents

Method for storing numerical data for electronic integrator

Info

Publication number
JPH04369095A
JPH04369095A JP17044991A JP17044991A JPH04369095A JP H04369095 A JPH04369095 A JP H04369095A JP 17044991 A JP17044991 A JP 17044991A JP 17044991 A JP17044991 A JP 17044991A JP H04369095 A JPH04369095 A JP H04369095A
Authority
JP
Japan
Prior art keywords
data
area
stored
numerical data
counter
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
JP17044991A
Other languages
Japanese (ja)
Inventor
Atsuyoshi Hayashi
林 淳悦
Ryoji Sawada
澤田 良治
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.)
Moriyama Kogyo KK
Original Assignee
Moriyama Kogyo 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 Moriyama Kogyo KK filed Critical Moriyama Kogyo KK
Priority to JP17044991A priority Critical patent/JPH04369095A/en
Publication of JPH04369095A publication Critical patent/JPH04369095A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To suppress the writing of data in a defective position and to improve reliability by dividing a storage area in a non-volatile memory into a data area and a counter area, and in a specific condition, newly storing data in a unused area. CONSTITUTION:In a method for rewriting numerical data stored in the non- volatile memory to new numerical data and storing the new data, the storage area of the non-volatile memory is divided into a data area A for storing numerical data and a counter area B for storing the rewritten frequency of numerical data in the data area A. The area A is divided into a distance value area C for storing an integrated traveling distance value and a pulse number area D for storing the integrated number of pulses and the counter area B is divided into an area E for storing rewriting frequency in the area D and an area F for storing rewriting frequency in the area C. When the value of the area A reaches rewriting guarantee frequency or no data can be stored in the areas A, B, the numerical data are stored in an used storage area.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、車両の積算走行距離や
船舶用エンジンの累積作動時間等を不揮発性メモリに記
憶させて保存する電子式積算計の数値データ保存方法に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a numerical data storage method for an electronic totalizer that stores information such as cumulative mileage of a vehicle and cumulative operating time of a marine engine in a non-volatile memory.

【0002】0002

【従来の技術】従来、車両の積算走行距離を不揮発性メ
モリに記憶させて保存する方法を採った電子式走行距離
計としては、例えば特開平2−8713号公報に開示さ
れたものがある。この電子式走行距離計では、不揮発性
メモリの記憶領域を3つに区画し、各記憶領域に積算走
行距離数の上位桁,中位桁,下位桁の数値データをそれ
ぞれ記憶させていた。そして、不揮発性メモリで数値デ
ータを書き変えるにはその回数に限度がある関係から、
従来の電子式走行距離計では前記3つの記憶領域を定期
的に交換していた。すなわち、書き変え回数の比較的多
い下位桁用記憶領域と、書き変え回数の比較的少ない上
位桁用記憶領域とを交換するのである。
2. Description of the Related Art Conventionally, there is an electronic odometer that employs a method of storing the cumulative mileage of a vehicle in a non-volatile memory, as disclosed in, for example, Japanese Patent Laid-Open No. 2-8713. In this electronic odometer, the storage area of the nonvolatile memory is divided into three areas, and each storage area stores numerical data for the upper digit, middle digit, and lower digit of the cumulative mileage number. Since there is a limit to the number of times numerical data can be rewritten in non-volatile memory,
In conventional electronic odometers, the three storage areas are replaced periodically. That is, the storage area for lower digits, which has been rewritten relatively frequently, is replaced with the storage area for upper digits, which has been rewritten relatively few times.

【0003】0003

【発明が解決しようとする課題】しかるに、従来の電子
式走行距離計は、不揮発性メモリでの記憶領域を交換す
る構成を採ってはいるものの、不揮発性メモリでの書き
変え回数が保証回数に達したか否かを検出することがで
きないので、信頼性が低いものであった。また、記憶す
べき領域の一箇所でも不具合箇所があると、数値を正確
に記憶させることができないという問題もあった。
[Problems to be Solved by the Invention] However, although conventional electronic odometers are configured to replace the storage area in non-volatile memory, the number of rewrites in non-volatile memory exceeds the guaranteed number of times. Since it is not possible to detect whether or not the target has been reached, reliability is low. Furthermore, if there is a defect in even one part of the area to be stored, there is also the problem that numerical values cannot be stored accurately.

【0004】0004

【課題を解決するための手段】本発明に係る電子式積算
計の数値データ保存方法は、数値データを記憶するデー
タ領域と、このデータ領域で数値データを書き変えた回
数を記憶するカウンタ領域とに記憶領域が分けられた不
揮発性メモリに、数値データおよび数値データ書き変え
回数をそれぞれ記憶させ、カウンタ領域に記憶された数
値が書き変え保証回数値に達した時と、データ領域およ
びカウンタ領域のデータを一旦読み出してデータが確認
できなかった時に、数値データと、数値データの書き変
え回数とをそれぞれ記憶領域の未使用部分へ新たに記憶
させるものである。
[Means for Solving the Problems] The method for storing numerical data in an electronic totalizer according to the present invention includes a data area for storing numerical data, and a counter area for storing the number of times the numerical data has been rewritten in this data area. Numerical data and the number of times the numerical data has been rewritten are each stored in a non-volatile memory that has storage areas divided into two. When the data cannot be confirmed after being read once, the numerical data and the number of times the numerical data has been rewritten are newly stored in unused portions of the storage area.

【0005】[0005]

【作用】書き変え保証回数に達するまでデータ領域で数
値データが書き変えられ、データ領域およびカウンタ領
域で不良箇所を避けてデータが記憶される。
[Operation] Numerical data is rewritten in the data area until the guaranteed number of rewrites is reached, and data is stored in the data area and counter area while avoiding defective areas.

【0006】[0006]

【実施例】以下、本発明の一実施例を図1ないし図8に
よって詳細に説明する。図1は本発明に係る数値データ
保存方法を採用した電子式走行距離計が装着された自動
二輪車の側面図、図2は本発明の数値データ保存方法を
実施するに当たり用いる電子式走行距離計の構成を示す
ブロック図、図3は同じく電子式走行距離計に使用する
セルフパワーオフ回路の回路図、図4は本発明の数値デ
ータ保存方法を実施するに当たり用いる不揮発性メモリ
のアドレスマップを示す図、図5は図4に示したアドレ
スマップのデータ領域を拡大して示す図、図6は図4に
示したアドレスマップのカウンタ領域を拡大して示す図
、図7は本発明に係る電子式走行距離計の数値データ保
存方法を示すフローチャート、図8は不揮発性メモリに
走行距離データを記憶する時の動作を示すフローチャー
トである。これらの図において、1はオフロード用自動
二輪車、2はこの自動二輪車1のフレーム、3はエンジ
ン、4はフロントフォーク5を介して前記フレーム2に
操向自在に連結された前輪、6はリヤアーム7を介して
フレーム2に揺動自在に支持された後輪である。8はハ
ンドル、9は燃料タンク、10はシートである。なお、
11は車体前部を覆う構造のカウリングである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described in detail below with reference to FIGS. 1 to 8. Fig. 1 is a side view of a motorcycle equipped with an electronic odometer employing the numerical data storage method according to the present invention, and Fig. 2 is a side view of an electronic odometer used to implement the numerical data storage method of the present invention. A block diagram showing the configuration, FIG. 3 is a circuit diagram of a self-power-off circuit similarly used in an electronic odometer, and FIG. 4 is a diagram showing an address map of a nonvolatile memory used in carrying out the numerical data storage method of the present invention. , FIG. 5 is an enlarged view of the data area of the address map shown in FIG. 4, FIG. 6 is an enlarged view of the counter area of the address map shown in FIG. 4, and FIG. 7 is an enlarged view of the data area of the address map shown in FIG. A flowchart showing a method for storing numerical data of an odometer. FIG. 8 is a flowchart showing an operation when storing odometer data in a nonvolatile memory. In these figures, 1 is an off-road motorcycle, 2 is a frame of this motorcycle 1, 3 is an engine, 4 is a front wheel steerably connected to the frame 2 via a front fork 5, and 6 is a rear arm. The rear wheel is swingably supported by the frame 2 via 7. 8 is a handle, 9 is a fuel tank, and 10 is a seat. In addition,
11 is a cowling structured to cover the front part of the vehicle body.

【0007】12は本発明に係る電子式走行距離計で、
この走行距離計12は、ハンドル8の前方に設置された
デジタル表示器からなる表示部13と、シート10の下
方に設置され、前記表示部13に接続コード14を介し
て接続されたコントロールユニット15とから構成され
ている。前記表示部12は液晶式ディスプレイユニット
13aを内蔵し、カウリング11に取付け金具(図示せ
ず)を介して支持されている。ディスプレイユニット1
3aとしては、本実施例では速度を10進法で3桁分,
積算走行距離数を10進法で6桁分だけ表示するものが
採用されている。なお、積算走行距離数は、最小桁が0
.1kmとなるように表示される。また、液晶式ディス
プレイユニット13aには、液晶板を裏側から照らす面
発光素子が装着されている。この面発光素子を図2中E
Lで示す。前記コントロールユニット15は、シート下
方に位置づけられたバッテリー16に電源コード17を
介して接続されると共に、エンジン3の出力軸の回転数
を検出するスピードセンサ18にセンサコード19を介
して接続されている。なお、このスピードセンサ18は
、自動二輪車1が0.4m走行した時にパルス信号を1
パルス分コントロールユニット15に出力するものが採
用されている。
12 is an electronic odometer according to the present invention,
The odometer 12 includes a display section 13 that is a digital display installed in front of the steering wheel 8, and a control unit 15 that is installed below the seat 10 and connected to the display section 13 via a connection cord 14. It is composed of. The display section 12 includes a liquid crystal display unit 13a, and is supported by the cowling 11 via mounting hardware (not shown). Display unit 1
3a, in this example, the speed is expressed as 3 digits in decimal notation,
The system is designed to display the cumulative mileage in decimal notation using only 6 digits. In addition, the minimum digit of the cumulative mileage number is 0.
.. It is displayed as 1km. Further, the liquid crystal display unit 13a is equipped with a surface emitting element that illuminates the liquid crystal plate from the back side. This surface emitting element is shown as E in Figure 2.
Indicated by L. The control unit 15 is connected via a power cord 17 to a battery 16 located below the seat, and is also connected via a sensor cord 19 to a speed sensor 18 that detects the rotational speed of the output shaft of the engine 3. There is. Note that this speed sensor 18 outputs a pulse signal of 1 when the motorcycle 1 travels 0.4 m.
A device that outputs pulses to the control unit 15 is adopted.

【0008】次に、前記コントロールユニット15の構
成を図2および図3によって説明する。コントロールユ
ニット15は、図2および図3に示すように、CPU2
0および揮発性メモリ(以下、これをRAMという)2
1を有し記憶手段および確認手段を構成する制御ユニッ
ト22と、この制御ユニット22とバッテリー16との
間に介装された電源オフ手段としてのセルフパワーオフ
回路23と、数値データ(走行距離データ,積算パルス
数)を保存する不揮発性メモリ24等とから構成されて
いる。この不揮発性メモリ24としては、EEPROM
が使用される。なお、25は自動二輪車1のメインスイ
ッチ、26はセルフパワーオフ回路23に接続されて前
記制御ユニット22へ安定化電源を供給する電源回路で
ある。
Next, the configuration of the control unit 15 will be explained with reference to FIGS. 2 and 3. As shown in FIGS. 2 and 3, the control unit 15 includes a CPU 2
0 and volatile memory (hereinafter referred to as RAM) 2
1, a self-power-off circuit 23 as a power-off means interposed between the control unit 22 and the battery 16, and numerical data (mileage data). , the cumulative number of pulses), etc. This non-volatile memory 24 is an EEPROM.
is used. Note that 25 is a main switch of the motorcycle 1, and 26 is a power supply circuit connected to the self-power-off circuit 23 to supply stabilized power to the control unit 22.

【0009】27は前記CPU20を駆動するための発
振回路を構成する発振素子、28はCPU20が暴走し
た時にCPU20をリセットするウオッチドッグタイマ
からなるCPUりセット、29および30は前記ディス
プレイユニット13aを駆動して数値データを表示させ
るための液晶ドライバーと昇圧回路で、液晶ドライバー
29には発振回路29aが接続されている。31はCP
U20の作動条件を変更するためのジャンパ線で、本実
施例で使用するCPU20は、このジャンパ線31での
結線箇所を変えることにより自動二輪車の機種に応じて
メータ仕様を変えることができるように構成されている
。このような構造とすると、メータ(走行距離計)の仕
様変更を容易に行うことができるようになる。前記CP
U20は、メインスイッチ25が投入された状態(入力
状態)ではスピードセンサ18から発せられるパルス信
号のパルス数から自動二輪車1の速度と積算走行距離数
とを算出し、積算パルス数および積算走行距離数をRA
M21に記憶させると共に、速度および積算走行距離数
を表示部13にデジタル表示させるように構成されてい
る。なお、本実施例で使用するCPU20は、100m
走行する毎に積算走行距離数を不揮発性メモリ24に記
憶させるように構成されている。さらに、後述するセル
フパワーオフ回路23からスイッチオフ検出信号が入力
された時には、RAM21に記憶された積算パルス数お
よび積算走行距離数を不揮発性メモリ24に記憶させて
保存し、セルフパワーオフ回路23からスイッチオン検
出信号が入力された時には、不揮発性メモリ24に保存
してある前記各データをRAM21に書き込んだ後に上
述した入力状態になるように構成されている。そして、
このCPU20は、本実施例で使用するEEPROM等
の不揮発性メモリ24では数値データを書き変えること
ができる回数に限度があるため、不揮発性メモリ24で
の数値データ(積算走行距離数,積算パルス数)の書き
変え回数が書き変え保証回数に達した時にそれらの数値
データを不揮発性メモリ24の未使用記憶領域に記憶さ
せるように構成されている。なお、本実施例では書き変
え保証回数が約10万回のEEPROMを採用した。ま
た、書き変え回数の値(以下、この数値をカウンタデー
タという)は、後述する不揮発性メモリ24の記憶領域
に前記数値データとは別に記憶される。加えて、不揮発
性メモリ24の記憶領域に記憶不能箇所が存在する時に
は、その部分を避けてデータを記憶させるようにも構成
されている。記憶不能箇所を確認する手法としては、不
揮発性メモリ24にデータを記憶させてから一旦そのデ
ータを読み出す動作を行い、データが読み出せなかった
時と、RAM21のデータと不揮発性メモリ24のデー
タとが一致しなかった時に、そのデータの記憶部分が記
憶不能箇所であると判断する方法が採られる。この場合
のデータとしては、上述した積算走行距離数,積算パル
ス数の他に、不揮発性メモリ24での書き変え回数を示
すカウンタデータも含まれる。
Reference numeral 27 indicates an oscillation element constituting an oscillation circuit for driving the CPU 20, 28 indicates a CPU set consisting of a watchdog timer that resets the CPU 20 when the CPU 20 goes out of control, and 29 and 30 drive the display unit 13a. An oscillation circuit 29a is connected to the liquid crystal driver 29, which is a liquid crystal driver and a booster circuit for displaying numerical data. 31 is CP
This is a jumper wire for changing the operating conditions of U20, and the CPU 20 used in this embodiment can change the meter specifications depending on the model of the motorcycle by changing the connection point of this jumper wire 31. It is configured. With such a structure, the specifications of the meter (oddometer) can be easily changed. Said CP
When the main switch 25 is turned on (input state), the U20 calculates the speed and cumulative mileage of the motorcycle 1 from the number of pulses of the pulse signal emitted from the speed sensor 18, and calculates the cumulative number of pulses and the cumulative mileage. RA the number
It is configured to store the speed and cumulative mileage number in the M21, and to digitally display the speed and cumulative mileage number on the display unit 13. Note that the CPU 20 used in this example has a 100 m
The vehicle is configured to store the cumulative distance traveled in the nonvolatile memory 24 each time the vehicle travels. Furthermore, when a switch-off detection signal is input from the self-power-off circuit 23, which will be described later, the cumulative number of pulses and the cumulative mileage number stored in the RAM 21 are stored in the non-volatile memory 24, and the self-power-off circuit 23 When a switch-on detection signal is input from the non-volatile memory 24, the above-mentioned data stored in the non-volatile memory 24 are written into the RAM 21, and then the above-mentioned input state is established. and,
Since there is a limit to the number of times that numerical data can be rewritten in the non-volatile memory 24 such as an EEPROM used in this embodiment, the CPU 20 uses the numerical data (total distance traveled, cumulative pulse number) in the non-volatile memory 24. ) is configured to store the numerical data in an unused storage area of the nonvolatile memory 24 when the number of rewrites reaches the guaranteed number of rewrites. In this embodiment, an EEPROM with a guaranteed number of rewrites of approximately 100,000 times is used. Further, the value of the number of rewrites (hereinafter, this numerical value will be referred to as counter data) is stored separately from the numerical data in a storage area of the nonvolatile memory 24, which will be described later. In addition, when there is a location in the storage area of the non-volatile memory 24 where data cannot be stored, data is stored in such a way as to avoid that location. A method for checking the location where data cannot be stored is to store data in the non-volatile memory 24 and then read the data once, and then compare the data in the RAM 21 and the data in the non-volatile memory 24 when the data could not be read. When the data do not match, a method is adopted in which it is determined that the storage portion of the data is an unstorable portion. In this case, the data includes, in addition to the above-mentioned cumulative travel distance and cumulative pulse number, counter data indicating the number of times of rewriting in the nonvolatile memory 24.

【0010】前記セルフパワーオフ回路23は、接続点
aからメインスイッチ25に接続される主電源ラインと
、接続点bからメインスイッチ25をバイパスするバッ
クアップラインとを介してバッテリー16に接続され、
メインスイッチ25が切られても電源が供給される構造
とされている。そして、このセルフパワーオフ回路23
は、メインスイッチ25が切られた時にスイッチオフ検
出信号をCPU20に出力し、CPU20からのデータ
保存終了信号を入力した時にCPU20,不揮発性メモ
リ24等への電源供給を断つように構成されている。ま
た、メインスイッチ25が投入された時には、スイッチ
オン検出信号をCPU20へ出力する構造とされている
。なお、図2および図3において符号cはスイッチオフ
検出信号やスイッチオン検出信号が入出力される接続点
を、また、dはCPU20からのデータ保存終了信号が
入力される接続点を示す。なお、eおよびfは電源回路
26の入力側接続点と出力側接続点を示す。
The self-power-off circuit 23 is connected to the battery 16 via a main power line connected to the main switch 25 from a connection point a, and a backup line bypassing the main switch 25 from a connection point b.
The structure is such that power is supplied even if the main switch 25 is turned off. And this self power off circuit 23
is configured to output a switch-off detection signal to the CPU 20 when the main switch 25 is turned off, and cut off power supply to the CPU 20, nonvolatile memory 24, etc. when a data storage end signal from the CPU 20 is input. . Further, when the main switch 25 is turned on, a switch-on detection signal is output to the CPU 20. Note that in FIGS. 2 and 3, symbol c indicates a connection point to which a switch-off detection signal and switch-on detection signal are input/output, and d indicates a connection point to which a data storage end signal from the CPU 20 is input. Note that e and f indicate the input side connection point and the output side connection point of the power supply circuit 26.

【0011】前記不揮発性メモリ24は、図4〜図6に
示すように8ビット(1バイト)の記憶ブロックを多数
並べたものが使用されている。図4〜図6では一つの升
目が1ビット分の記憶領域を示し、前記記憶ブロックは
図において横1列に並んだ8個の升目で構成される。そ
して、この不揮発性メモリ24の記憶領域は、積算走行
距離数と積算パルス数をそれぞれ記憶するデータ領域A
と、このデータ領域Aでの書き変え回数を記憶するカウ
ンタ領域Bとに分けられている。また、前記データ領域
Aは、積算走行距離数を記憶する距離数領域Cと、積算
パルス数を記憶するパルス数領域Dとに区分けされてい
る。前記距離数領域Cでは、表示部13に表示される6
桁分の積算走行距離数が2桁づつ記憶ブロックに割り振
られて記憶される。すなわち、積算走行距離数を最初に
記憶させる時には、距離数領域Cに多数存在する記憶ブ
ロックのうち図4および図5において最も下側に位置す
る記憶ブロックに下位の2桁が、その上隣の記憶ブロッ
クに中位の2桁が、さらにその上隣の記憶ブロックに上
位の2桁がそれぞれ記憶される。なお、積算走行距離数
や後述する積算パルス数,カウンタデータ等を不揮発性
メモリ24に記憶させるに当たっては、10進数のデー
タを2進数に変換し、この2進数のデータを各記憶ブロ
ックに記憶させて行う。図4〜図6では、上位桁,中位
桁,下位桁の走行距離データを記憶する上位桁データ用
記憶ブロック,中位桁データ用記憶ブロック,下位桁デ
ータ用記憶ブロックの横にそれぞれ上,中,下と記した
The nonvolatile memory 24 uses a large number of 8-bit (1 byte) memory blocks arranged as shown in FIGS. 4 to 6. In FIGS. 4 to 6, one square indicates a storage area for one bit, and the storage block is composed of eight squares arranged in a horizontal row in the figures. The storage area of this non-volatile memory 24 is a data area A that stores the cumulative mileage number and the cumulative pulse number.
and a counter area B that stores the number of times the data area A has been rewritten. Further, the data area A is divided into a distance number area C that stores the cumulative number of traveled distances, and a pulse number area D that stores the cumulative number of pulses. In the distance number area C, 6 displayed on the display unit 13
The cumulative mileage number for the digits is allocated and stored in memory blocks two digits at a time. That is, when storing the cumulative mileage number for the first time, the lower two digits are stored in the lowest two digits in the lowest memory block in FIGS. 4 and 5 among the many memory blocks in the distance number area C. The middle two digits are stored in a storage block, and the upper two digits are stored in an adjacent storage block. In addition, in order to store the cumulative mileage number, the cumulative pulse number described later, counter data, etc. in the nonvolatile memory 24, the decimal data is converted into binary numbers, and this binary data is stored in each storage block. I will do it. In FIGS. 4 to 6, upper and lower digit data storage blocks, middle digit data storage blocks, and lower digit data storage blocks that store mileage data of upper digits, middle digits, and lower digits are respectively shown. Marked as middle and bottom.

【0012】前記パルス数領域Dでは、前記コントロー
ルユニット15内のRAM21に記憶されていた積算パ
ルス数が記憶される。積算パルス数を記憶させるに当た
っては、走行距離数のように桁毎に記憶させるのではな
く、全桁分一度に記憶させる。
In the pulse number area D, the cumulative number of pulses stored in the RAM 21 in the control unit 15 is stored. When storing the cumulative pulse number, all digits are stored at once, instead of being stored digit by digit like the mileage number.

【0013】前記カウンタ領域Bは、パルス数領域Dで
の書き変え回数を記憶するパルスカウンタデータ領域E
と、距離数領域Cでの書き変え回数を記憶する距離カウ
ンタデータ領域Fとに区分けされている。また、距離カ
ウンタデータ領域Fは、図6に示すように下位桁領域G
,中位桁領域H,上位桁領域Iからなる3つの領域にさ
らに細分化されている。この3つの領域のうち下位桁領
域Gには、前記距離数領域Cで積算走行距離数の下位の
2桁を記憶する記憶ブロックでの書き変え回数が記憶さ
れる。言い換えれば、下位桁領域Gでは図4および図5
で最も下側に位置する記憶ブロックでの書き変え回数が
記憶される。同様にして中位桁領域Hには積算走行距離
数の中位の2桁を記憶する記憶ブロックでの書き変え回
数が、上位桁領域Iには積算走行距離数の上位の2桁を
記憶する記憶ブロックでの書き変え回数がそれぞれ記憶
される。なお、パルスカウンタデータ領域Eは、前記パ
ルス数領域Dでの書き変え回数が記憶される。
The counter area B is a pulse counter data area E that stores the number of rewrites in the pulse number area D.
and a distance counter data area F that stores the number of rewrites in the distance number area C. Further, the distance counter data area F is a lower digit area G as shown in FIG.
, middle digit area H, and upper digit area I. Of these three areas, the lower digit area G stores the number of rewrites in the memory block that stores the lower two digits of the cumulative mileage number in the distance number area C. In other words, in the lower digit area G, FIGS.
The number of rewrites in the lowest memory block is stored. Similarly, the middle digit area H stores the number of rewrites in the memory block that stores the middle two digits of the cumulative mileage number, and the high-order digit area I stores the top two digits of the cumulative mileage number. The number of rewrites in each memory block is stored. In the pulse counter data area E, the number of rewrites in the pulse number area D is stored.

【0014】次に、本発明に係る電子式走行距離計の動
作を図7および図8によって説明する。先ず、メインス
イッチ25が投入されると、S1 で初期設定としてC
PU20のセットアップが行われる。次に、S2 で不
揮発性メモリ24に記憶されている数値データ(積算パ
ルス数,積算走行距離数)を読み出し、RAM21に書
き込む。そして、この状態で自動二輪車1が走行される
。走行中には、S3 でスピードセンサ18から発する
パルスをCPU20が計数し、その値から走行距離数を
算出する。この時に積算パルス数をRAM21に記憶さ
せる。 なお、パルスは、本実施例では0.4m走行した時に一
回発せられる。走行距離数のデータは、後述する距離デ
ータ加算ステップS4を経てからS5で液晶ドライバー
29へ送られ、S6でディスプレイユニット13aに表
示される。また、S6では、CPU20がパルス数から
算出する速度も同時にディスプレイユニット13aに表
示される。次に、S7 の判定ステップでメインスイッ
チ25が切られていないかを確認し、メインスイッチ2
5が切られていない時には前記S3へ戻る。すなわち、
メインスイッチ投入後は、メインスイッチ25が切られ
るまでは距離データ加算,表示ステップが繰り返される
ことになる。
Next, the operation of the electronic odometer according to the present invention will be explained with reference to FIGS. 7 and 8. First, when the main switch 25 is turned on, C is set as the initial setting in S1.
Setup of the PU 20 is performed. Next, in S2, the numerical data (accumulated pulse number, accumulated distance traveled) stored in the nonvolatile memory 24 is read out and written into the RAM 21. Then, the motorcycle 1 is driven in this state. While the vehicle is running, the CPU 20 counts pulses emitted from the speed sensor 18 in S3, and calculates the distance traveled from the counted values. At this time, the cumulative number of pulses is stored in the RAM 21. In this embodiment, the pulse is emitted once when the vehicle travels 0.4 m. The travel distance data is sent to the liquid crystal driver 29 in S5 after passing through a distance data addition step S4, which will be described later, and is displayed on the display unit 13a in S6. Further, in S6, the speed calculated by the CPU 20 from the number of pulses is also displayed on the display unit 13a at the same time. Next, in the determination step S7, it is checked whether the main switch 25 is turned off, and the main switch 25 is turned off.
If 5 is not cut off, the process returns to S3. That is,
After the main switch is turned on, the distance data addition and display steps are repeated until the main switch 25 is turned off.

【0015】ここで、距離データ加算ステップS4 を
図8によって詳述する。距離データ加算ステップS4 
では、自動二輪車1が100m走行する毎に積算走行距
離数が更新されてその都度不揮発性メモリ24に記憶さ
れる。図8中P1 は100m走行したのを判定するス
テップで、表示部13で表示される表示距離数の最下位
の数値が1(100mを示す)増えた時に次のP2ステ
ップへ進む。P2では、不揮発性メモリ24の距離数領
域Cの下位桁データ用記憶ブロックに表示距離数の下位
2桁分の走行距離データを記憶させる。この時には、図
4および図5において最も下側に位置する記憶ブロック
にデータが記憶される。次に、不揮発性メモリ24の下
位桁データ用記憶ブロックを一回書き変えたことをP3
 でRAM21に記憶させ、P4 で前記下位桁データ
用記憶ブロックに走行距離データが記憶されたか否かを
判定する。判定する時の手法としては、下位桁データ用
記憶ブロックのデータを一旦読み出し、データが存在し
ているか否か、また、データであればRAM21のデー
タと一致するか否かを確認することによって行う。
The distance data addition step S4 will now be described in detail with reference to FIG. Distance data addition step S4
In this case, the cumulative mileage number is updated every time the motorcycle 1 travels 100 m and is stored in the nonvolatile memory 24 each time. P1 in FIG. 8 is a step for determining whether the vehicle has traveled 100 m, and when the lowest numerical value of the displayed distance number displayed on the display unit 13 increases by 1 (indicating 100 m), the process advances to the next step P2. At P2, mileage data for the lower two digits of the displayed distance number is stored in the lower digit data storage block of the distance number area C of the nonvolatile memory 24. At this time, data is stored in the lowest storage block in FIGS. 4 and 5. Next, P3 indicates that the memory block for lower digit data of the non-volatile memory 24 has been rewritten once.
In step P4, it is determined whether the mileage data is stored in the storage block for lower digit data. The method of determination is to read the data in the storage block for lower digit data once and check whether the data exists or not, and if it is data, check whether it matches the data in the RAM 21. .

【0016】P4 で走行距離データが記憶されなかっ
たと判定された時には前記記憶ブロックが記憶不能であ
ると判断し、P5 で上,中,下位桁データ用記憶ブロ
ックを1バイトづつシフトさせる。言い換えれば、図5
において下位桁データ用記憶ブロックにC1で示す不良
箇所が存在していた場合、その不良箇所を含む1バイト
分の記憶ブロックを使用せずに、図5のアドレスマップ
の左側に(1)で示すように、それまで使用していた各
記憶ブロックの上隣の記憶ブロックを次回から使用する
ようにする。このように記憶ブロックをシフトさせた後
には、上,中,下位桁でそれぞれ使用する記憶ブロック
のカウンタデータをP6 において変更する。下位桁デ
ータ用記憶ブロックのカウンタデータは距離カウンタデ
ータ領域Fの下位桁領域Gに、中位桁データ用記憶ブロ
ックのカウンタデータは中位桁領域Hに、上位桁データ
用記憶ブロックのカウンタデータは上位桁領域Iにそれ
ぞれ記憶されるので、上述した場合には、下位桁領域G
に中位桁データ用記憶ブロック(図5において下から2
段目の記憶ブロック)でのカウンタデータを書き込む。 さらに、中位桁領域Hに上位桁データ用記憶ブロックで
のカウンタデータを、上位桁領域Iに上位桁データ用記
憶ブロックの上隣の記憶ブロックでのカウンタデータ(
この場合は未使用部分であるために0を記憶させる。)
をそれぞれ書き込む。なお、本実施例では書き変え保証
回数が10万回の不揮発性メモリ24を使用する関係か
ら、カウンタデータの値を2進数で最高10万まで記憶
できるように、カウンタ領域Bでは3バイトづつ分けら
れた記憶領域にカウンタデータが記憶される。この3バ
イトの記憶領域を図6の右側に括弧でくくって示す。な
お、距離数領域Cに不良箇所が一つも存在しない場合に
は、図5のアドレスマップの右側に示すように下位桁デ
ータ用記憶ブロックが所定の書き変え回数に達した時に
各記憶ブロックを1バイトづつシフトさせる。
When it is determined at P4 that the mileage data is not stored, it is determined that the storage block cannot be stored, and at P5 the storage blocks for upper, middle, and lower digit data are shifted one byte at a time. In other words, Figure 5
If there is a defective location indicated by C1 in the storage block for lower digit data in , the 1-byte memory block containing the defective location is not used, and the memory block indicated by (1) is placed on the left side of the address map in Figure 5. , the next storage block next to each storage block that has been used up to that point will be used from next time. After shifting the memory blocks in this manner, the counter data of the memory blocks used for the upper, middle, and lower digits is changed at P6. The counter data of the lower digit data storage block is stored in the lower digit area G of the distance counter data area F, the counter data of the middle digit data storage block is stored in the middle digit area H, and the counter data of the upper digit data storage block is stored in the lower digit area G of the distance counter data area F. Since they are stored in the upper digit area I, in the above case, the lower digit area G
storage block for middle digit data (2nd from the bottom in Figure 5)
Writes the counter data in the memory block (the first memory block). Furthermore, the counter data in the storage block for upper digit data is stored in the middle digit area H, and the counter data in the storage block next to the upper digit data storage block is stored in the upper digit area I (
In this case, since it is an unused portion, 0 is stored. )
Write each. In addition, in this embodiment, since the non-volatile memory 24 with a guaranteed number of rewrites of 100,000 times is used, the counter area B is divided into 3 bytes each so that the counter data value can be stored up to 100,000 in binary. Counter data is stored in the designated storage area. This 3-byte storage area is shown in parentheses on the right side of FIG. Note that if there is no defective location in the distance number area C, each memory block is rewritten once when the lower digit data memory block reaches a predetermined number of rewrites, as shown on the right side of the address map in FIG. Shift bytes.

【0017】そして、P6でカウンタデータを変更した
後はP2へ戻って下位桁記憶動作を再び行う。
After changing the counter data at P6, the process returns to P2 and the lower digit storage operation is performed again.

【0018】前記P4 でデータを確認できた時には(
不揮発性メモリ24に下位2桁分の走行距離データが記
憶された時には)、P7 で下位桁の走行距離データが
桁あふれしたか否かを判断し、桁あふれした時には、P
8 でRAM21に記憶されている走行距離データの中
位桁に1を加算する。桁あふれしていない時は入力待ち
状態へ戻る。
[0018] When the data can be confirmed in P4 above (
When the mileage data for the lower two digits is stored in the non-volatile memory 24), it is determined at P7 whether the mileage data for the lower digits has overflowed.
8, 1 is added to the middle digit of the mileage data stored in the RAM 21. If there is no overflow, the process returns to the input waiting state.

【0019】次に、P9 で不揮発性メモリ24の距離
数領域Cの中位桁データ用記憶ブロックに表示距離数の
中位2桁分の走行距離データを記憶させる。なお、上述
した下位桁記憶ステップで記憶ブロックがシフトされて
いない場合(前記P4 の判定ステップで書き込みOK
とされた場合)には、図5において下から2段目に位置
する記憶ブロックにデータが記憶され、図5中(1)で
示すように記憶ブロックが1バイトシフトされていた場
合には、下から3段目に位置する記憶ブロックにデータ
が記憶される。次に、不揮発性メモリ24の中位桁デー
タ用記憶ブロックを一回書き変えたことをP10でRA
M21に記憶させ、P11で前記中位桁データ用記憶ブ
ロックに走行距離データが記憶されたか否かを、前記P
4 と同様の手法によって確認する。P11の確認結果
がNOであった時には前記記憶ブロックが記憶不能であ
ると判断し、P12で上,中,下位桁データ用記憶ブロ
ックを2バイトづつシフトさせる。言い換えれば、図5
において中位桁データ用記憶ブロックにC2で示す不良
箇所が存在していた場合、その不良箇所を含む1バイト
分の記憶ブロックを使用せずに、図5のアドレスマップ
の左側に(2)で示すように、不良箇所より上側の記憶
ブロックを次回から使用するようにする。このように記
憶ブロックをシフトさせた後には、上,中,下位桁でそ
れぞれ使用する記憶ブロックのカウンタデータをP13
において変更する。この場合には、下位桁領域Gに上位
桁データ用記憶ブロック(図5において下から4段目の
記憶ブロック)でのカウンタデータを書き込む。さらに
、中位桁領域Hに前記上位桁データ用記憶ブロックの上
隣の記憶ブロックでのカウンタデータ(この場合は未使
用部分であるために0を記憶させる。)を、上位桁領域
Iにさらにその上隣の記憶ブロックでのカウンタデータ
(この場合も未使用部分であるために0を記憶させる。 )をそれぞれ書き込む。そして、P13でカウンタデー
タを変更した後はP9 へ戻って中位桁記憶動作を再び
行う。
Next, at P9, the mileage data for the middle two digits of the displayed distance number is stored in the middle digit data storage block of the distance number area C of the nonvolatile memory 24. Note that if the storage block has not been shifted in the lower digit storage step described above (writing is OK in the determination step P4)
), the data is stored in the storage block located in the second row from the bottom in FIG. 5, and if the storage block is shifted by 1 byte as shown in (1) in FIG. Data is stored in the storage block located in the third row from the bottom. Next, in P10, RA
M21, and in P11 it is determined whether the mileage data is stored in the middle digit data storage block.
Confirm using the same method as in 4. When the check result in P11 is NO, it is determined that the storage block cannot be stored, and the storage blocks for upper, middle, and lower digit data are shifted by 2 bytes at P12. In other words, Figure 5
If there is a defective location shown as C2 in the storage block for middle-order digit data in , the 1-byte storage block containing the defective location is not used, and the address map shown in (2) is placed on the left side of the address map in Figure 5. As shown, the memory blocks above the defective location will be used from next time onwards. After shifting the memory blocks in this way, the counter data of the memory blocks used for the upper, middle, and lower digits is set to P13.
Changes will be made in In this case, the counter data in the storage block for upper digit data (the fourth storage block from the bottom in FIG. 5) is written in the lower digit area G. Furthermore, the counter data in the storage block next to the above storage block for upper digit data is stored in the middle digit area H (in this case, 0 is stored because it is an unused portion), and the counter data is further stored in the upper digit area I. Furthermore, the counter data in the adjacent memory block (also in this case, 0 is stored since it is an unused portion) is written respectively. After changing the counter data in P13, the process returns to P9 and the middle digit storage operation is performed again.

【0020】P11での確認結果がOKであった時には
(不揮発性メモリ24に中位2桁分の走行距離データが
記憶された時には)、P14で中位桁の走行距離データ
が桁あふれしたか否かを判断し、桁あふれした時には、
P15でRAM21に記憶されている走行距離データの
上位桁に1を加算する。桁あふれしていない時は入力待
ち状態へ戻る。
When the confirmation result at P11 is OK (when the mileage data for the middle two digits is stored in the non-volatile memory 24), it is checked at P14 whether the mileage data for the middle digits has overflowed. When you judge whether or not, and the digits overflow,
At P15, 1 is added to the upper digit of the mileage data stored in the RAM 21. If there is no overflow, the process returns to the input waiting state.

【0021】次に、P16で不揮発性メモリ24の距離
数領域Cの上位桁データ用記憶ブロックに表示距離数の
上位2桁分の走行距離データを記憶させる。なお、上述
した中位桁記憶ステップで記憶ブロックがシフトされて
いない場合(前記P4 およびP11の判定ステップで
それぞれ書き込みOKとされた場合)には、図5におい
て下から3段目に位置する記憶ブロックにデータが記憶
され、図5中(1)で示すように記憶ブロックが1バイ
トシフトされていた場合には、下から4段目に位置する
記憶ブロックにデータが記憶される。同様にして、図5
中(2)示すようにシフトされていた場合には、下から
6段目の記憶ブロックにデータが記憶される。次に、不
揮発性メモリ24の上位桁データ用記憶ブロックを一回
書き変えたことをP17でRAM21に記憶させ、P1
8で前記上位桁データ用記憶ブロックに走行距離データ
が記憶されたか否かを、前記P4 と同様の手法によっ
て確認する。
Next, in P16, the mileage data for the upper two digits of the displayed distance number is stored in the upper digit data storage block of the distance number area C of the nonvolatile memory 24. Note that if the memory block is not shifted in the middle digit storage step described above (if writing is OK in the determination steps P4 and P11), the memory block located in the third row from the bottom in FIG. When data is stored in a block and the storage block is shifted by one byte as shown in (1) in FIG. 5, the data is stored in the storage block located at the fourth stage from the bottom. Similarly, Figure 5
If the data has been shifted as shown in (2), the data is stored in the sixth storage block from the bottom. Next, the fact that the storage block for upper digit data of the non-volatile memory 24 has been rewritten once is stored in the RAM 21 in P17, and P1
At step 8, it is confirmed whether or not the mileage data has been stored in the upper digit data storage block using the same method as at step P4.

【0022】P18の確認結果がNOであった時には前
記記憶ブロックが記憶不能であると判断し、P19で上
,中,下位桁データ用記憶ブロックを3バイトづつシフ
トさせる。言い換えれば、図5において上位桁データ用
記憶ブロックにC3で示す不良箇所が存在していた場合
、その不良箇所を含む1バイト分の記憶ブロックを使用
せずに、図5のアドレスマップの左側に(3)で示すよ
うに、不良箇所より上側の記憶ブロックを次回から使用
するようにする。このように記憶ブロックをシフトさせ
た後には、上,中,下位桁でそれぞれ使用する記憶ブロ
ックのカウンタデータをP20において変更する。この
場合には上位桁,中位桁,下位桁の全てのデータ用記憶
ブロックが未使用部分に変更される関係から、カウンタ
領域Bの下位桁領域G,中位桁領域H,上位桁領域Iに
それぞれ0を書き込む。そして、P20でカウンタデー
タを変更した後はP16へ戻って上位桁記憶動作を再び
行う。
When the check result at P18 is NO, it is determined that the storage block cannot be stored, and the storage blocks for upper, middle, and lower digit data are shifted by 3 bytes at P19. In other words, if there is a defective location indicated by C3 in the storage block for high-order digit data in FIG. As shown in (3), the memory blocks above the defective location will be used from next time onwards. After shifting the memory blocks in this manner, the counter data of the memory blocks used for the upper, middle, and lower digits is changed in P20. In this case, all data storage blocks for upper digits, middle digits, and lower digits are changed to unused areas, so lower digit area G, middle digit area H, and upper digit area I of counter area B are Write 0 to each. After changing the counter data in P20, the process returns to P16 and the upper digit storage operation is performed again.

【0023】P18での確認結果がOKであった時には
(不揮発性メモリ24に上位2桁分の走行距離データが
記憶された時には)、P21で下位桁データ用記憶ブロ
ックのカウンタデータが保証回数であるか否か判定する
。 この時の判定方法としては、カウンタ領域Bの下位桁領
域Gに書き込まれた数値が10万以下であるか否かを確
認することによって行う。保証回数に達していない時に
は入力待ち状態へ戻る。また、カウンタデータが10万
に達した時(保証回数に達した時)には、P22で距離
数領域Cでの各桁毎の記憶ブロックを1バイトづつシフ
トさせる。例えば、P4 ,P11およびP18でそれ
ぞれ書き込みOKとされた場合、言い換えれば距離数領
域Cに不良箇所が一つも存在しない場合には、図5のア
ドレスマップの右側に示すように各記憶ブロックを1バ
イトづつシフトさせる。そして、P22で記憶ブロック
をシフトさせて不揮発性メモリ24にデータを書き込ん
だ後にはP23で各記憶ブロックのカウンタデータを書
き変える。すなわち、カウンタ領域Bの下位桁領域Gに
それまで中位桁データ用記憶ブロックとして使用してい
た記憶ブロックのカウンタデータを書き込み、中位桁領
域Hにそれまで上位桁データ用記憶ブロックとして使用
していた記憶ブロックのカウンタデータを書き込み、上
位桁領域Iに0を書き込む。このようにカウンタデータ
を更新した後、入力待ち状態に戻る。
When the confirmation result at P18 is OK (when the mileage data for the upper two digits is stored in the non-volatile memory 24), at P21 the counter data in the storage block for lower digit data is the guaranteed number of times. Determine whether it exists or not. The determination method at this time is to check whether the numerical value written in the lower digit area G of the counter area B is 100,000 or less. If the guaranteed number of times has not been reached, the process returns to the input waiting state. Further, when the counter data reaches 100,000 (when the guaranteed number of times is reached), the storage block for each digit in the distance number area C is shifted by 1 byte at P22. For example, if writing is OK at each of P4, P11, and P18, in other words, if there is no defective location in the distance number area C, each memory block is Shift bytes. Then, after shifting the memory blocks and writing data into the nonvolatile memory 24 in P22, the counter data of each memory block is rewritten in P23. That is, the counter data of the storage block that was previously used as a storage block for middle-order digit data is written in the lower-order digit area G of counter area B, and the counter data of the storage block that was previously used as a storage block for upper-order digit data is written in the middle-order digit area H. Write the counter data of the memory block that was previously stored, and write 0 to the upper digit area I. After updating the counter data in this way, the process returns to the input waiting state.

【0024】次にメインスイッチ25が切られた時の動
作について詳述する。メインスイッチ25のオンオフは
セルフパワーオフ回路23が検出する。メインスイッチ
25が切られた時には、図7においてS7からS8へ進
み、RAM21に記憶されていた積算パルス数を不揮発
性メモリ24のパルス数領域Dに書き込む。次に、不揮
発性メモリ24に書き込んだ積算パルス数をS9 で一
旦読み出し、S10でRAM21のデータと不揮発性メ
モリ24のデータとが一致するか否か確認する。なお、
S8 で積算パルス数を不揮発性メモリ24に記憶させ
た時には、パルス数領域Dのカウンタデータが1増えた
ことをRAM21に記憶させておく。
Next, the operation when the main switch 25 is turned off will be described in detail. The self-power-off circuit 23 detects whether the main switch 25 is turned on or off. When the main switch 25 is turned off, the process advances from S7 to S8 in FIG. Next, the cumulative number of pulses written in the non-volatile memory 24 is once read out in S9, and it is checked in S10 whether the data in the RAM 21 and the data in the non-volatile memory 24 match. In addition,
When the integrated pulse number is stored in the non-volatile memory 24 in S8, the fact that the counter data in the pulse number area D has been increased by 1 is stored in the RAM 21.

【0025】S10での判定の結果、データが一致しな
かった時には、パルス数領域Dの記憶ブロックが記憶不
能であると判断し、S11でパルス数領域Dでの記憶ブ
ロックを1バイトシフトさせる。言い換えれば、図5に
おいてパルス数領域Dの記憶ブロックにD1〜D3で示
す不良箇所が存在していた場合、その不良箇所を含む1
バイト分の記憶ブロックを使用せずに、図5のアドレス
マップの右側に(1)〜(3)で示すように、不良箇所
より上側の記憶ブロックを次回から使用するようにする
。このように記憶ブロックをシフトさせた後には、新た
に使用する記憶ブロックのカウンタデータをS12にお
いて0へ変更する。この時、パルス数領域Dのカウンタ
データはカウンタ領域Bのパルスカウンタデータ領域E
に書き込まれる。そして、S12でカウンタデータを変
更した後はS8 へ戻って積算パルス数記憶動作を再び
行う。
If the result of the determination in S10 is that the data do not match, it is determined that the memory block in the pulse number area D cannot be stored, and the memory block in the pulse number area D is shifted by one byte in S11. In other words, if there are defective locations indicated by D1 to D3 in the memory block of the pulse number area D in FIG.
Instead of using the memory blocks for bytes, the memory blocks above the defective location are used from the next time, as shown in (1) to (3) on the right side of the address map in FIG. After shifting the memory block in this manner, the counter data of the newly used memory block is changed to 0 in S12. At this time, the counter data in the pulse number area D is the pulse counter data area E in the counter area B.
will be written to. After changing the counter data in S12, the process returns to S8 to perform the cumulative pulse number storage operation again.

【0026】S10でデータが一致することが確認され
た後には、S13〜S17のステップで積算走行距離数
を不揮発性メモリ24に記憶させる。その動作は、走行
中に100m毎に行われる記憶動作と略同じである。す
なわち、RAM21に記憶されている積算走行距離数を
S13で不揮発性メモリ24に記憶させ、S14でその
データを一旦読み出し、S15でそのデータがRAM2
1のデータと一致するかどうか確認する。一致しなかっ
た時にはS16で距離数領域Cでの記憶ブロックをシフ
トさせ、S17でカウンタデータを書き変える。その後
、積算走行距離数を再び記憶させる。これら一連の動作
は、下位桁,中位桁,上位桁毎に行われる。
After it is confirmed in S10 that the data match, the cumulative mileage number is stored in the nonvolatile memory 24 in steps S13 to S17. This operation is almost the same as the memorization operation that is performed every 100 meters while driving. That is, the cumulative mileage number stored in the RAM 21 is stored in the nonvolatile memory 24 in S13, the data is once read out in S14, and the data is stored in the RAM 2 in S15.
Check if it matches the data in 1. If they do not match, the memory block in the distance number area C is shifted in S16, and the counter data is rewritten in S17. Thereafter, the cumulative mileage number is stored again. These series of operations are performed for each lower digit, middle digit, and upper digit.

【0027】S15でデータが一致していると確認され
た後には、距離数領域Cのカウンタデータとパルス数領
域Dのカウンタデータとをそれぞれ記憶させる。すなわ
ち、S18で各データ記憶ブロックのカウンタデータを
不揮発性メモリ24のカウンタ領域Bに記憶させ、S1
9でそれを一旦読み出し、S20でそれがRAM21の
データと一致するか否か確認する。データでなかった時
には、S21においてカウンタ領域Bでの記憶領域を1
回だけシフトさせる。例えば、図6においてパルスカウ
ンタデータ領域EにE1〜E2で示す不良箇所が存在し
ていた場合、その不良箇所を含む3バイト分の記憶ブロ
ックを使用せずに、図6のアドレスマップの右側に(1
)〜(3)で示すように、不良箇所より上側の記憶ブロ
ックを次回から使用するようにする。このようなシフト
動作は、距離カウンタデータ領域Fの下位桁領域G,中
位桁領域H,上位桁領域IにG1〜G2,H1〜H2,
I1〜I2で示したような不良箇所が存在していた時に
も同様に実施される。このようにカウント領域Bで記憶
領域をシフトさせた後には、S18へ戻ってカウンタデ
ータ書き込む動作を再び行う。
After it is confirmed in S15 that the data match, the counter data of the distance number area C and the counter data of the pulse number area D are respectively stored. That is, in S18, the counter data of each data storage block is stored in the counter area B of the nonvolatile memory 24, and in S1
In step 9, the data is read once, and in step S20, it is checked whether it matches the data in the RAM 21. If it is not data, the storage area in counter area B is set to 1 in S21.
Shift only once. For example, if there are defective locations indicated by E1 to E2 in the pulse counter data area E in FIG. (1
) to (3), the memory blocks above the defective location will be used from next time onwards. Such a shift operation causes G1 to G2, H1 to H2,
The same process is carried out even when there are defective locations as indicated by I1 and I2. After shifting the storage area in count area B in this way, the process returns to S18 and the operation of writing the counter data is performed again.

【0028】上述したように積算走行距離数や積算パル
ス数を記憶する記憶領域のそれぞれのカウントデータを
書き込んだ後に、S22で電源が切られる。この時には
、CPU20がデータ保存終了信号をセルフパワーオフ
回路23へ出力し、このセルフパワーオフ回路23がC
PU20,不揮発性メモリ24等への電源供給を断つこ
とになる。
As described above, after writing the respective count data in the storage area for storing the cumulative mileage number and the cumulative pulse number, the power is turned off in S22. At this time, the CPU 20 outputs a data storage end signal to the self-power-off circuit 23, and this self-power-off circuit 23
Power supply to the PU 20, nonvolatile memory 24, etc. will be cut off.

【0029】したがって、本発明に係る数値データ保存
方法によれば、書き変え保証回数に達するまでデータ領
域Aで数値データが書き変えられ、データ領域Aおよび
カウンタ領域Bで不良箇所を避けてデータが記憶される
ことになる。
Therefore, according to the numerical data storage method of the present invention, numerical data is rewritten in data area A until the guaranteed number of rewrites is reached, and data is rewritten in data area A and counter area B while avoiding defective parts. It will be remembered.

【0030】なお、本実施例では図8中P4 ,P11
,P18の各判定ステップでNOであった時に直ちに次
のステップへ(P5 ,P12,P19へ)進ませたが
、NOであった時には数回「書き込みOKか?」をチェ
ックするようにしてもよい。
In this embodiment, P4 and P11 in FIG.
, P18, when the result was NO, the process immediately proceeded to the next step (to P5, P12, P19), but when the result was NO, the user checked "Is writing OK?" several times. good.

【0031】また、本実施例では自動二輪車用走行距離
計で走行距離数を保存する例について説明したが、本発
明の数値データの保存方法は、図9および図10に示す
ように船外機の累積作動時間を積算するアワーメーター
に適用することもできる。図9および図10は他の実施
例を示す図で、図9は本発明に係る数値データ保存方法
によって累積時間を保存するアワーメーターのブロック
図、図10はアワーメーターの動作を示すフローチャー
トである。これらの図において前記図2および図7で説
明したものと同一もしくは同等部材については、同一符
号を付しここにおいて詳細な説明は省略する。図9およ
び図10において、41はCPU20に接続されたタイ
マ回路、42はエンジンの回転速度を検出するセンサで
ある。なお、この例で使用するディスプレイユニット1
3aとしては、エンジン回転数を10進法で3桁分,累
積作動時間を10進法で6桁分だけ表示するものが採用
されている。このように構成されたアワーメータでは、
積算走行距離数の代わりにエンジン累積作動時間を記憶
する。すなわち、エンジン作動中に単位時間当たり1回
のパルスをエンジン回転速度検出センサ42によって発
生させ、その積算パルス数から累積作動時間を算出する
。そして、その累積作動時間を不揮発性メモリ24に記
憶させる構成である。また、パルスは25/1000秒
あたり1回発生するように構成されている。累積作動時
間,積算パルス数およびカウンタデータ等を不揮発性メ
モリ24に書き込む手法は前記実施例と同じであるため
、ここでの説明は省略する。なお、図10中ステップS
7 でメインスイッチ25が切られていない時には、S
7aでエンジンが回転しているか否かを確認し、エンジ
ンが回転していればS7bで引き続き時間を測定するよ
うにし、エンジンが停止していればS7cで時間を測定
するのを中断させる。このように累積時間を記憶させる
ように構成しても前記実施例と同等の効果が得られる。
[0031]Also, in this embodiment, an example was explained in which the number of traveled distances is stored using an odometer for a motorcycle, but the method for storing numerical data of the present invention is as shown in It can also be applied to an hour meter that totals the cumulative operating time of a machine. 9 and 10 are diagrams showing other embodiments, in which FIG. 9 is a block diagram of an hour meter that stores cumulative time using the numerical data storage method according to the present invention, and FIG. 10 is a flowchart showing the operation of the hour meter. . In these figures, the same or equivalent members as those explained in FIGS. 2 and 7 are given the same reference numerals, and detailed explanations are omitted here. In FIGS. 9 and 10, 41 is a timer circuit connected to the CPU 20, and 42 is a sensor that detects the rotational speed of the engine. In addition, display unit 1 used in this example
3a is one that displays the engine speed in three decimal digits and the cumulative operating time in six decimal digits. In an hour meter configured in this way,
The cumulative engine operating time is stored instead of the cumulative mileage. That is, the engine rotation speed detection sensor 42 generates one pulse per unit time during engine operation, and the cumulative operating time is calculated from the cumulative number of pulses. The cumulative operating time is then stored in the nonvolatile memory 24. Further, the pulse is configured to occur once every 25/1000 seconds. The method of writing the cumulative operating time, cumulative number of pulses, counter data, etc. into the non-volatile memory 24 is the same as in the previous embodiment, and therefore will not be described here. Note that step S in FIG.
7, when the main switch 25 is not turned off, the S
It is checked in step 7a whether or not the engine is rotating, and if the engine is rotating, the time is continued to be measured in step S7b, and if the engine is stopped, the time measurement is interrupted in step S7c. Even if the cumulative time is configured to be stored in this way, the same effect as in the embodiment described above can be obtained.

【0032】さらに、本実施例ではカウンタ領域Bをパ
ルスカウンタデータ領域E,下位桁領域G,中位桁領域
H,上位桁領域Iの4つの領域に大別し、記憶領域中に
不良箇所が存在した時には各領域毎に記憶ブロックをシ
フトさせたが、図11に示すように前記4つの領域を一
括してシフトさせることもできる。図11は数値データ
保存方法の他の実施例を示す図で、同図は不揮発性メモ
リのアドレスマップにおけるカウンタ領域の拡大図であ
る。図11中E1で示す不良箇所が存在した時には、図
11のアドレスマップの右側に(1)で示すように、そ
れまでパルスカウンタデータ領域Eとして使用していた
記憶領域より上側の記憶領域へ4つの記憶領域を全てシ
フトさせる。同様にしてH1で示す不良箇所が存在した
時には(2)で示すように、また、I1で示す不良箇所
が存在した時には(3)で示すように、それぞれシフト
させる。
Furthermore, in this embodiment, the counter area B is roughly divided into four areas: the pulse counter data area E, the lower digit area G, the middle digit area H, and the upper digit area I. When the memory block existed, the memory block was shifted for each area, but it is also possible to shift the four areas at once as shown in FIG. 11. FIG. 11 is a diagram showing another embodiment of the numerical data storage method, and is an enlarged view of the counter area in the address map of the nonvolatile memory. When there is a defective location indicated by E1 in FIG. 11, as shown in (1) on the right side of the address map in FIG. Shift all storage areas. Similarly, when there is a defective location indicated by H1, it is shifted as shown in (2), and when there is a defective location indicated by I1, it is shifted as shown in (3).

【0033】[0033]

【発明の効果】以上説明したように本発明に係る電子式
積算計の数値データ保存方法は、数値データを記憶する
データ領域と、このデータ領域で数値データを書き変え
た回数を記憶するカウンタ領域とに記憶領域が分けられ
た不揮発性メモリに、数値データおよび数値データ書き
変え回数をそれぞれ記憶させ、カウンタ領域に記憶され
た数値が書き変え保証回数値に達した時と、データ領域
およびカウンタ領域のデータを一旦読み出してデータが
確認できなかった時に、数値データと、数値データの書
き変え回数とをそれぞれ記憶領域の未使用部分へ新たに
記憶させるため、書き変え保証回数に達するまでデータ
領域で数値データが書き変えられ、データ領域およびカ
ウンタ領域で不良箇所を避けてデータが記憶される。し
たがって、書き変え保証回数より多く数値データを書き
変えるのを防ぐことができると共に、不良箇所にデータ
を書き込むのを防ぐことができるから、信頼性の高い電
子式積算計を得ることができる。
As explained above, the method for storing numerical data of an electronic totalizer according to the present invention has a data area for storing numerical data and a counter area for storing the number of times the numerical data has been rewritten in this data area. Numerical data and the number of times the numerical data has been rewritten are stored in a non-volatile memory that has separate storage areas, and when the number stored in the counter area reaches the guaranteed number of rewrites, When the data cannot be confirmed after reading the data, the numerical data and the number of rewrites of the numerical data are newly stored in the unused part of the storage area, so the data area is stored until the guaranteed number of rewrites is reached. Numerical data is rewritten and stored in the data area and counter area while avoiding defective areas. Therefore, it is possible to prevent numerical data from being rewritten more than the guaranteed number of rewrites, and it is also possible to prevent data from being written to a defective location, making it possible to obtain a highly reliable electronic totalizer.

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

【図1】本発明に係る数値データ保存方法を採用した電
子式走行距離計が装着された自動二輪車の側面図である
FIG. 1 is a side view of a motorcycle equipped with an electronic odometer employing the numerical data storage method according to the present invention.

【図2】本発明の数値データ保存方法を実施するに当た
り用いる電子式走行距離計の構成を示すブロック図であ
る。
FIG. 2 is a block diagram showing the configuration of an electronic odometer used to implement the numerical data storage method of the present invention.

【図3】本発明の数値データ保存方法を実施するに当た
り用いる電子式走行距離計のセルフパワーオフ回路の回
路図である。
FIG. 3 is a circuit diagram of a self-power-off circuit of an electronic odometer used to implement the numerical data storage method of the present invention.

【図4】本発明の数値データ保存方法を実施するに当た
り用いる不揮発性メモリのアドレスマップを示す図であ
る。
FIG. 4 is a diagram showing an address map of a nonvolatile memory used in implementing the numerical data storage method of the present invention.

【図5】図4に示したアドレスマップのデータ領域を拡
大して示す図である。
FIG. 5 is a diagram showing an enlarged data area of the address map shown in FIG. 4;

【図6】図4に示したアドレスマップのカウンタ領域を
拡大して示す図である。
FIG. 6 is an enlarged view of a counter area of the address map shown in FIG. 4;

【図7】本発明に係る電子式走行距離計の数値データ保
存方法を示すフローチャートである。
FIG. 7 is a flowchart showing a method for storing numerical data of an electronic odometer according to the present invention.

【図8】不揮発性メモリに走行距離データを記憶する時
の動作を示すフローチャートである。
FIG. 8 is a flowchart showing the operation when storing mileage data in a nonvolatile memory.

【図9】本発明に係る数値データ保存方法によって累積
時間を保存するアワーメーターのブロック図である。
FIG. 9 is a block diagram of an hour meter that stores cumulative time using the numerical data storage method according to the present invention.

【図10】アワーメーターの動作を示すフローチャート
である。
FIG. 10 is a flowchart showing the operation of the hour meter.

【図11】数値データ保存方法の他の実施例を示す図で
、同図は不揮発性メモリのアドレスマップにおけるカウ
ンタ領域の拡大図である。
FIG. 11 is a diagram showing another embodiment of the numerical data storage method, and is an enlarged view of the counter area in the address map of the nonvolatile memory.

【符号の説明】[Explanation of symbols]

12    電子式走行距離計 13    表示部 15    コントロールユニット 16    バッテリー 20    CPU 21    RAM 22    制御ユニット 23    セルフパワーオフ回路 24    不揮発性メモリ 25    メインスイッチ 12 Electronic odometer 13 Display section 15 Control unit 16 Battery 20 CPU 21 RAM 22 Control unit 23 Self power off circuit 24 Non-volatile memory 25 Main switch

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  不揮発性メモリに記憶された数値デー
タを新たな数値データに書き変えて保存する電子式積算
計の数値データ保存方法において、数値データを記憶す
るデータ領域と、このデータ領域で数値データを書き変
えた回数を記憶するカウンタ領域とに記憶領域が分けら
れた不揮発性メモリに、数値データおよび数値データ書
き変え回数をそれぞれ記憶させ、カウンタ領域に記憶さ
れた数値が書き変え保証回数値に達した時と、データ領
域およびカウンタ領域のデータを一旦読み出してデータ
が確認できなかった時に、数値データと、数値データの
書き変え回数とをそれぞれ記憶領域の未使用部分へ新た
に記憶させることを特徴とする電子式積算計の数値デー
タ保存方法。
Claim 1. A numerical data storage method for an electronic totalizer in which numerical data stored in a non-volatile memory is rewritten and saved as new numerical data, a data area for storing numerical data, and a data area for storing numerical data. Numerical data and the number of times the numerical data has been rewritten are each stored in a non-volatile memory that has a storage area divided into a counter area that stores the number of times data has been rewritten, and the number stored in the counter area is the guaranteed number of rewrites. To newly store the numerical data and the number of times the numerical data has been rewritten in unused portions of the storage area, respectively, when the data area and the counter area are read once and the data cannot be confirmed. A method for storing numerical data of an electronic totalizer.
JP17044991A 1991-06-17 1991-06-17 Method for storing numerical data for electronic integrator Pending JPH04369095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17044991A JPH04369095A (en) 1991-06-17 1991-06-17 Method for storing numerical data for electronic integrator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17044991A JPH04369095A (en) 1991-06-17 1991-06-17 Method for storing numerical data for electronic integrator

Publications (1)

Publication Number Publication Date
JPH04369095A true JPH04369095A (en) 1992-12-21

Family

ID=15905140

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17044991A Pending JPH04369095A (en) 1991-06-17 1991-06-17 Method for storing numerical data for electronic integrator

Country Status (1)

Country Link
JP (1) JPH04369095A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003030728A (en) * 2001-07-17 2003-01-31 Sanyo Electric Co Ltd Controller for automatic vending machine
US9320120B2 (en) 2012-04-13 2016-04-19 Koninklijke Philips N.V. Data generating system and lighting device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003030728A (en) * 2001-07-17 2003-01-31 Sanyo Electric Co Ltd Controller for automatic vending machine
US9320120B2 (en) 2012-04-13 2016-04-19 Koninklijke Philips N.V. Data generating system and lighting device

Similar Documents

Publication Publication Date Title
US7212107B2 (en) Odometer system and method for a vehicle
JPH0129407B2 (en)
JPH0692898B2 (en) Electronic odometer
JPH01152311A (en) Electronic type odo/tripmeter for vehicle
JPH04369095A (en) Method for storing numerical data for electronic integrator
JPH04369094A (en) Electronic integrator
JPH04369096A (en) Method for storing numerical data in electronic integrator
JPH0565010B2 (en)
JP2850667B2 (en) Electronic odometer
JP2979965B2 (en) Electronic counting value storage device
JP2917794B2 (en) Electronic odometer
JP2533055Y2 (en) Vehicle mileage accumulator
JPH0426693B2 (en)
JPS62254013A (en) Electronic odometer
JP3003543B2 (en) Electronic odometer
JPS6197514A (en) Integrated distance information recorder for vehicle
JPS6060515A (en) Displaying method of run distance
JPH05215567A (en) Electronic travel distance meter
JP2933191B2 (en) Vehicle parts maintenance alarm
JP2848119B2 (en) Electronic odometer
JPH07198410A (en) Electronic cyclometer
JPH07239237A (en) Electronic trip distance recorder
JPH074503Y2 (en) Vehicle mileage recorder
JPH0682265A (en) Instrument for vehicle
JPH05332782A (en) Electronic odometer