Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5196809B2 - Memory system - Google Patents
[go: Go Back, main page]

JP5196809B2 - Memory system - Google Patents

Memory system Download PDF

Info

Publication number
JP5196809B2
JP5196809B2 JP2007046500A JP2007046500A JP5196809B2 JP 5196809 B2 JP5196809 B2 JP 5196809B2 JP 2007046500 A JP2007046500 A JP 2007046500A JP 2007046500 A JP2007046500 A JP 2007046500A JP 5196809 B2 JP5196809 B2 JP 5196809B2
Authority
JP
Japan
Prior art keywords
data
eeprom
memory
nonvolatile memory
memory system
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.)
Expired - Fee Related
Application number
JP2007046500A
Other languages
Japanese (ja)
Other versions
JP2008210169A (en
JP2008210169A5 (en
Inventor
川波  昭博
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2007046500A priority Critical patent/JP5196809B2/en
Publication of JP2008210169A publication Critical patent/JP2008210169A/en
Publication of JP2008210169A5 publication Critical patent/JP2008210169A5/ja
Application granted granted Critical
Publication of JP5196809B2 publication Critical patent/JP5196809B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Debugging And Monitoring (AREA)
  • Structure And Mechanism Of Cameras (AREA)

Description

本発明は、電気的消去可能で、電源が遮断されても記憶されたデータ内容を保持することが可能な不揮発性メモリを組み込んだ機器において、種類の異なる複数の不揮発性メモリを使用した場合のメモリシステムに関するものである。   The present invention relates to a case where a plurality of different types of non-volatile memories are used in a device incorporating a non-volatile memory that is electrically erasable and can retain stored data contents even when the power is turned off. It relates to the memory system.

不揮発性メモリであるEEPROMは、マイクロコンピュータ(以下マイコン)と共に使用することで、装置内のメモリシステムを構築することが一般的となっている。このEEPROMを使用することによって、機器の個別調整データを随時にEEPROMに書き込んで、処理の高性能化を図っている。その他の不揮発性メモリとしてはフラッシュROMがあり、近年になってマイコンの内部メモリとして使用することが一般的となっている。   An EEPROM, which is a non-volatile memory, is generally used together with a microcomputer (hereinafter referred to as a microcomputer) to construct a memory system in the apparatus. By using this EEPROM, the individual adjustment data of the device is written to the EEPROM as needed to improve the processing performance. Another nonvolatile memory is a flash ROM, which has recently become popular for use as an internal memory of a microcomputer.

従来においては、安価で書き換え不能なマスクROMを内蔵したマスクROM内蔵マイコンと、外付けEEPROMとを組み合わせて使用している。ところが、最近になってフラッシュROMを内蔵したフラッシュROM内蔵マイコンが安価となり、マスクROM内蔵マイコンとの価格差が少なくなってきている。   Conventionally, a mask ROM built-in microcomputer incorporating a mask ROM that is inexpensive and cannot be rewritten is combined with an external EEPROM. However, recently, flash ROM built-in microcomputers with built-in flash ROM have become cheaper and the price difference from mask ROM built-in microcomputers has been reduced.

また、フラッシュROM内蔵マイコンを使用することによって、外付けEEPROMを使用しない機器も開発されている。外付けEEPROMに書き込む代りに、フラッシュROM内蔵マイコンに内蔵されるフラッシュROMに、制御上の調整データを書き込むことで、外付けEEPROMを使用する必要がなく、そのIC価格分だけ安価となり、機器としての価格も下げられる。   Devices that do not use an external EEPROM have also been developed by using a microcomputer with a built-in flash ROM. By writing control adjustment data in the flash ROM built in the microcomputer with built-in flash ROM instead of writing in the external EEPROM, there is no need to use an external EEPROM, and the price is reduced by the IC price. The price of can also be lowered.

通常使用されている外付けEEPROMやマイコンに内蔵されるフラッシュROMは、その書換回数に制限が発生することが知られている。近年では、外付けEEPROMが100万回程度であり、フラッシュROMでは100回程度の性能保証が現実的である。この書換回数を超えてフラッシュROMを継続的に使用した場合は、保持されたデータが消去される可能性があり、取り扱いに注意が必要である。   It is known that an external EEPROM that is normally used and a flash ROM built in a microcomputer are limited in the number of times of rewriting. In recent years, the number of external EEPROM is about 1 million times, and the performance guarantee of about 100 times is practical for a flash ROM. If the flash ROM is continuously used beyond this number of rewrites, the stored data may be erased, and handling is necessary.

これらの不揮発性メモリには書換回数に制限があることを考慮し、特許文献1にはEEPROMを差し込むソケットを複数個用意し、書換回数が限界に達した場合に、他方に差してデータをコピーして使用することが開示されている。   Considering that these nonvolatile memories have a limit on the number of times of rewriting, Patent Document 1 provides a plurality of sockets into which an EEPROM can be inserted, and when the number of times of rewriting reaches the limit, data is copied across the other. It is disclosed that it is used.

特開平5−232759号公報JP-A-5-232759

このように、不揮発性メモリの書換回数には制限があり、機器によってはこの制限を超えてしまうものがある。この場合は書換回数が100万回の外付けメモリを使用して調整データを記憶させることも必要となるが、コストが高くなるというデメリットが伴う。   As described above, there is a limit to the number of times the nonvolatile memory can be rewritten, and some devices may exceed this limit. In this case, it is necessary to store the adjustment data using an external memory having a rewrite count of 1 million times, but this has a demerit that the cost is increased.

この書換制限を超えてしまう機器の例として、デジタル一眼レフカメラの交換レンズ等の光学機器がある。この種の光学機器は一般的な家電とは異なり、屋外で使用されることが多く、多様な環境下でも性能を維持させるために、周辺温度や湿度などの外的な環境変化に対応した調整データを不揮発性メモリに記憶している。更に、光学機器の使用頻度に合わせた自動調整機構が入っている場合には、使用者の使用環境や使用頻度によって、不揮発性メモリ内に記憶された調整データを修正することによってメモリの書換回数が変化することになる。   An example of a device that exceeds this rewrite limit is an optical device such as an interchangeable lens of a digital single lens reflex camera. Unlike general home appliances, this type of optical equipment is often used outdoors, and in order to maintain performance even in various environments, adjustments are made in response to external environmental changes such as ambient temperature and humidity. Data is stored in a non-volatile memory. In addition, if an automatic adjustment mechanism that matches the frequency of use of the optical device is included, the number of times the memory is rewritten by correcting the adjustment data stored in the nonvolatile memory according to the user's usage environment and frequency of use. Will change.

つまり、全く同じ光学機器であっても、使用者の使用状態によって、書換回数の多い/少ない場合が存在するが、メーカ側としては、書換回数の多いケースを想定した製品化を考える必要がある。そのため、書換回数が多い外付けEEPROMを搭載する必要があるが、これによってコストが高くなっているのが現状である。   In other words, even with the exact same optical equipment, there are cases where the number of rewrites is large / small depending on the use state of the user, but the manufacturer needs to consider commercialization assuming a case where the number of rewrites is large. . For this reason, it is necessary to mount an external EEPROM having a large number of rewrites, but the cost is increased due to this.

特許文献1では、内容自体は書換回数制限とコスト面の両方で捉えてはいるが、あくまでも同じ種類のEEPROMメモリを使用することが記載され、常に機器内には1つのEEPROMが搭載されることを前提としている。なお、特許文献1ではEEPROMの選択方法や使用法などの具体的な方法が全く記載されていない。   Patent Document 1 describes the content itself in terms of both the number of rewrites and the cost, but it is described that the same type of EEPROM memory is used, and one EEPROM is always mounted in the device. Is assumed. Note that Patent Document 1 does not describe any specific method such as an EEPROM selection method or usage.

従来の光学機器では、外付けEEPROMは100万回の書換回数制限があるため、書換回数自体は殆ど問題とならない。しかし、前述したように光学機器にフラッシュROM内蔵マイコンを使用した場合に、書換回数が100回程度しかなく、書換回数が足りない場合が生ずる。そのため、マイコン内の不揮発性メモリを使用しているにも拘わらず、他の不揮発性メモリである外付けEEPROMを使用しなければならないことになる。つまり、光学機器等の環境変化に対応した機器では、これらの不揮発性メモリを使用した場合の新たな使用方法が、製品価格を下げるためにも必要であると考えられる。   In the conventional optical apparatus, the external EEPROM has a limit of 1 million times of rewriting, so the number of times of rewriting itself hardly causes a problem. However, as described above, when a microcomputer with built-in flash ROM is used in an optical device, the number of rewrites is only about 100 times, and there are cases where the number of rewrites is insufficient. For this reason, it is necessary to use an external EEPROM, which is another nonvolatile memory, even though the nonvolatile memory in the microcomputer is used. In other words, it is considered that a new usage method when these nonvolatile memories are used is necessary to reduce the product price in an apparatus such as an optical apparatus corresponding to environmental changes.

本発明の目的は、上述の課題を解消し、不揮発性メモリの書換回数を考慮することなく使用可能なメモリシステムを提供することにある。   An object of the present invention is to solve the above-described problems and provide a memory system that can be used without considering the number of times of rewriting of a nonvolatile memory.

上記目的を達成するための本発明に係るメモリシステム技術的特徴は、種類の異なる複数の不揮発性メモリの組み込みが可能な光学機器のメモリシステムにおいて、組み込まれている前記不揮発性メモリの種類を判別する判別手段と、前記不揮発性メモリを使用する優先順位を予め記憶した記憶手段と前記判別手段により種類の異なる複数の不揮発性メモリが装着されていると判別した場合に、前記記憶手段に記憶された優先順位に従って選択された不揮発性メモリの情報に応じて前記光学機器を制御する制御手段と、を有し、前記判別手段は、前記優先順位に従って選択された不揮発性メモリ内のデータを読み出し、前記読み出したデータに応じて前記優先順位に従って選択された不揮発性メモリが外付けか否かを判別することにある。 In order to achieve the above object, the technical feature of the memory system according to the present invention is that in the memory system of an optical apparatus capable of incorporating a plurality of different types of nonvolatile memories, the types of the incorporated nonvolatile memories are as follows. If the determination means determines that a plurality of different types of non-volatile memories are mounted by the determination means , the storage means that stores in advance the priority order for using the nonvolatile memory, and the storage means a control means for controlling said optical apparatus in accordance with the stored priority nonvolatile memory information is selected in accordance with the said determining means, said priority non-volatile memory that is chosen by ranking read data is to nonvolatile memories selected according to the priority order is determined whether or not the external in response to the read data

本発明に係るメモリシステムによれば、種類の異なる複数の不揮発性メモリに対応した光学機器において、使用者の使用頻度、使用環境に合わせ最適な価格とすることができる。不揮発性メモリの書換回数が制限を超えた場合は使用者に何らかの警告を発することで不揮発性メモリの追加を促すことができる。また、現状の調整データのままでも性能に大きな問題がないと使用者が判断した場合は、メモリの追加をせずに使用を続けることも可能となる。更に、メーカ側としてはメモリの交換ではなく追加作業のみとなるため、作業時間の短縮やそれに伴って作業工賃なども安価にできるため、使用者にとっての利益も大きい。 According to the memory system of the present invention, it is possible to obtain an optimal price in accordance with the use frequency and use environment of the user in an optical apparatus compatible with a plurality of different types of nonvolatile memories. When the number of times of rewriting of the nonvolatile memory exceeds the limit, it is possible to prompt the user to add the nonvolatile memory by issuing some warning. In addition, if the user determines that there is no significant problem in performance even with the current adjustment data, it is possible to continue using the memory without adding a memory. Furthermore, since the manufacturer is not only replacing the memory but only performing additional work, the working time can be reduced and the work cost can be reduced accordingly.

本発明を図示の実施例に基づいて詳細に説明する。   The present invention will be described in detail based on the embodiments shown in the drawings.

本実施例1では、オートフォーカス式一眼レフカメラにおいて、複数の不揮発性メモリの組み込みが可能な交換レンズ1を示し、図1は交換レンズ1の内部のブロック回路構成図である。   Embodiment 1 shows an interchangeable lens 1 in which a plurality of nonvolatile memories can be incorporated in an autofocus single-lens reflex camera, and FIG. 1 is a block circuit configuration diagram inside the interchangeable lens 1.

オートフォーカス式交換レンズ1には、各種ユニット、アクチュエータ、センサ等を制御するレンズマイコン2が内蔵されており、レンズマイコン2の入力端子には、回転量検出器3、電圧検出器4、スイッチ検出手段5の出力が接続されている。レンズマイコン2の出力端子には、モータユニット6、絞りユニット7、手振れ補正ユニット8が接続されている。また、レンズマイコン2は通信インタフェース9と接続され、信号を相互に送受信可能とし、更にレンズマイコン2には外付けEEPROM10が接続されている。   The autofocus interchangeable lens 1 incorporates a lens microcomputer 2 that controls various units, actuators, sensors, and the like. The input terminal of the lens microcomputer 2 has a rotation amount detector 3, a voltage detector 4, and switch detection. The output of means 5 is connected. A motor unit 6, a diaphragm unit 7, and a camera shake correction unit 8 are connected to the output terminals of the lens microcomputer 2. In addition, the lens microcomputer 2 is connected to the communication interface 9 so that signals can be transmitted and received with each other, and an external EEPROM 10 is connected to the lens microcomputer 2.

また、レンズマイコン2内にはマイクロプロセッサであるCPUコア11と、揮発性メモリであるRAM12と、不揮発性メモリであるフラッシュROM13と、周辺ペリフェラル14が内蔵されている。フラッシュROM13は消去可能ブロック13a〜13hから構成され、周辺ペリフェラル14汎用I/Oポート、タイマ、A/Dコンバータ等を有し、CPUコア11と各周辺機能は信号を相互に送受信可能とされている。   The lens microcomputer 2 includes a CPU core 11 that is a microprocessor, a RAM 12 that is a volatile memory, a flash ROM 13 that is a nonvolatile memory, and a peripheral peripheral 14. The flash ROM 13 is composed of erasable blocks 13a to 13h, and has peripheral peripherals 14 general-purpose I / O ports, timers, A / D converters, etc., and the CPU core 11 and peripheral functions can transmit and receive signals to and from each other. Yes.

モータユニット6はAF用のモータを含み、回転量検出器3はモータユニット6でAF動作した場合のモータの回転量を検出し、絞りユニット7は交換レンズ1に入光する光量を調節する。電圧検出器4はレンズマイコン2に印加する電圧を検出し、所定電圧以下の場合はレンズマイコン2をリセットするための動作を行う。補正ユニット8は手振れ補正を行うための振動ジャイロとアクチュエータ等を含んでいる。通信インタフェース9は交換レンズ1をカメラに固定させるための図示しないリングマウントに固定されており、本実施例では、通信インタフェース9とカメラ又は外部装置を電気的に連結して通信を行う。スイッチ検出手段5は交換レンズ1に関連する各種スイッチ類を表し、AFモード切換えスイッチ、手振れ補正許可スイッチ等の状態検出を行う。なお、外付けのEEPROM10は交換レンズ1の内部に取り付けられる構成となっているが、初めはメモリそのものが外された状態で使用者は購入することになる。   The motor unit 6 includes a motor for AF, the rotation amount detector 3 detects the rotation amount of the motor when the motor unit 6 performs an AF operation, and the aperture unit 7 adjusts the amount of light incident on the interchangeable lens 1. The voltage detector 4 detects the voltage applied to the lens microcomputer 2, and performs an operation for resetting the lens microcomputer 2 when the voltage is equal to or lower than a predetermined voltage. The correction unit 8 includes a vibration gyro and an actuator for performing camera shake correction. The communication interface 9 is fixed to a ring mount (not shown) for fixing the interchangeable lens 1 to the camera. In this embodiment, the communication interface 9 and the camera or an external device are electrically connected to perform communication. The switch detection means 5 represents various switches related to the interchangeable lens 1, and detects states of an AF mode changeover switch, a camera shake correction permission switch, and the like. The external EEPROM 10 is attached to the inside of the interchangeable lens 1, but the user purchases it with the memory itself removed at first.

また、回転量検出器3〜手振れ補正ユニット8の各周辺ユニットは、それぞれがレンズマイコン2と電気的に接続され、レンズマイコン2はプログラムに従って処理を実行する。   Further, each peripheral unit of the rotation amount detector 3 to the camera shake correction unit 8 is electrically connected to the lens microcomputer 2, and the lens microcomputer 2 executes processing according to a program.

フラッシュROM13内には消去可能ブロック13a〜13hが配置されている。各消去可能ブロックのメモリ容量は消去可能ブロック13a、13bが4Kバイトであり、消去可能ブロック13c〜13hが32Kバイトであり、計約200Kバイトとなっている。消去可能ブロック13aには、主に交換レンズ1の回転量検出器3〜手振れ補正ユニット8の各周辺ユニットが安定して動作を行うための制御データや調整データが書き込まれている。この調整データは個々の交換レンズ1ごとに値が変更されるべきもので、図示しない外部装置によって交換レンズ1内の各ユニットを測定して、調整データを消去可能ブロック13aの予め決められたアドレスに書き込む操作を行っている。   In the flash ROM 13, erasable blocks 13a to 13h are arranged. The memory capacity of each erasable block is 4K bytes for the erasable blocks 13a and 13b, 32K bytes for the erasable blocks 13c to 13h, and is about 200K bytes in total. In the erasable block 13a, control data and adjustment data for stably operating the peripheral units of the rotation amount detector 3 to the camera shake correction unit 8 of the interchangeable lens 1 are mainly written. The value of this adjustment data should be changed for each individual interchangeable lens 1, and each unit in the interchangeable lens 1 is measured by an external device (not shown), and the adjustment data can be erased. A write operation is being performed.

図2はRAM12の内部メモリ配置の説明図である。レンズマイコン2としての最大メモリ容量は32Kバイトで、アドレスH’FF0000〜H’FF7FFF(16進数)まで配置されている。   FIG. 2 is an explanatory diagram of the internal memory arrangement of the RAM 12. The maximum memory capacity of the lens microcomputer 2 is 32 Kbytes, and addresses from H′FF0000 to H′FF7FFF (hexadecimal) are arranged.

レンズマイコン2に電源が投入されると、フラッシュROM13に記憶したプログラムが実行される。初めに、外付けEEPROM10が取り付けられているか否かを判別する。EEPROM10が取り付けられていないと判断すると、フラッシュROM13の消去可能ブロック13a内のデータを全てRAM12に転送する。EEPROM10が取り付けられていると判断した場合は、EEPROM10内のデータを全てRAM12に転送する。   When the lens microcomputer 2 is turned on, the program stored in the flash ROM 13 is executed. First, it is determined whether or not the external EEPROM 10 is attached. If it is determined that the EEPROM 10 is not attached, all the data in the erasable block 13 a of the flash ROM 13 is transferred to the RAM 12. If it is determined that the EEPROM 10 is attached, all data in the EEPROM 10 is transferred to the RAM 12.

転送先のRAMアドレスは何れの場合もH’FF0000〜H’FF0FFFとしている。これは初めに何れのメモリを使用するかを判断し、その結果、決定したメモリのデータをRAM12に転送することで、これ以降はこの判断をしなくとも済むことになる。つまり、これ以降のプログラムでは常にRAM12のデータを使用することで、プログラムの処理速度を早くすることができる。   In any case, the transfer destination RAM address is H'FF0000 to H'FF0FFF. This first determines which memory is to be used, and as a result, the data of the determined memory is transferred to the RAM 12, so that this determination need not be made thereafter. In other words, the processing speed of the program can be increased by always using the data in the RAM 12 in the subsequent programs.

次に、レンズマイコン2は通信インタフェース9から受信する図示しないカメラからの指示命令に従って、回転量検出器3〜手振れ補正ユニット8の各ユニットを使って動作や処理を繰り返すことになる。   Next, the lens microcomputer 2 repeats the operation and processing using each unit of the rotation amount detector 3 to the camera shake correction unit 8 in accordance with an instruction command received from the communication interface 9 from a camera (not shown).

制御データとは、例えばモータユニット6を使用するために内部のモータを駆動する場合に、モータへの累積駆動回数を記憶して制御を切換えている。モータへの駆動回数が所定値よりも多いと機械的な磨耗によってモータに加わる負荷が増え、同じ電圧で負荷が増加すると当然に回転速度が遅くなる。モータに加わる負荷を考慮した制御を行うため、駆動回数を或るタイミングでフラッシュROM13やEEPROM10に書き込むことで、交換レンズ1の電源が切られても記憶することができる。   For example, when the internal motor is driven to use the motor unit 6, the control data stores the cumulative number of times of driving the motor and switches the control. If the number of times the motor is driven is greater than a predetermined value, the load applied to the motor increases due to mechanical wear, and if the load increases with the same voltage, the rotation speed naturally decreases. In order to perform control in consideration of the load applied to the motor, the number of times of driving is written in the flash ROM 13 and the EEPROM 10 at a certain timing, so that the data can be stored even when the interchangeable lens 1 is turned off.

次に、レンズマイコン2に電源が供給された場合は、記憶したその駆動回数で制御するようにする。例えば、駆動回数が所定値よりも大きくなるとモータへの印加電圧を高目に設定することで、負荷が増えてもモータの回転速度が変わらない制御にすることができる。ここで比較している所定値とは、前述した調整データのことであり、モータの固体によって特性が異なるために、比較する値自体も変更することが必要となる。   Next, when power is supplied to the lens microcomputer 2, the lens microcomputer 2 is controlled by the stored number of times of driving. For example, when the number of times of driving becomes greater than a predetermined value, the applied voltage to the motor is set to a high value, so that the rotation speed of the motor does not change even when the load increases. The predetermined value being compared here refers to the adjustment data described above. Since the characteristics vary depending on the motor, it is necessary to change the value to be compared.

その他に、絞りユニット7や手振れ補正ユニット8でも同様にモータが利用されているので、制御データや調整データがフラッシュROM13やEEPROM10の別のアドレスに記憶される。これらの制御データや調整データは、前述したように時々、書き換えが必要な場合があるが、従来技術で説明したように不揮発性メモリには書換回数に制限がある。   In addition, since the motor is also used in the aperture unit 7 and the camera shake correction unit 8, control data and adjustment data are stored in different addresses of the flash ROM 13 and the EEPROM 10. These control data and adjustment data sometimes need to be rewritten as described above, but the nonvolatile memory has a limited number of rewrites as described in the prior art.

前述したモータの累積駆動回数は、使用者の使用頻度によって変わることが予想される。或る使用者は50回の書換回数が必要で、別の使用者は200回の書換回数が必要となる場合が考えられる。つまり、メモリを主体として考えると、この場合は交換レンズ1の設計的なコンセプトとしては最悪値で考える必要があり、当然に外付けEEPROM10を取り付けて製造しなければならないと考えられる。従って、使用者にとっては不必要な機能であっても、IC分の価格の高い交換レンズ1を購入することになる。   It is expected that the cumulative number of times the motor is driven will change depending on the frequency of use by the user. One user may need 50 rewrites and another user may need 200 rewrites. In other words, considering the memory as a main component, in this case, the design concept of the interchangeable lens 1 needs to be considered at the worst value, and it is naturally considered that the external EEPROM 10 must be attached and manufactured. Therefore, even if the function is unnecessary for the user, the interchangeable lens 1 having a high price for the IC is purchased.

本実施例では、外付けEEPROM10は取り付けずに製品を製造し、内蔵のフラッシュROM13に調整データや制御データを書き込むこととし、交換レンズ1の使用頻度が低い使用者の場合は何もせずに済む。使用頻度が高い使用者の場合は、フラッシュROMの書換回数である100回に達する前に、交換レンズ1又はカメラから警告を発するようにする。使用者はその警告の内容によって製造したメーカに対して修理依頼をするか、或いはそのままにするかを判断することが可能となる。このままにしておいても、前述した例ではオートフォーカス速度が若干遅くなる程度であって、それが気にならない使用者ならば、そのまま使用し続けても特に問題はない。   In the present embodiment, the product is manufactured without attaching the external EEPROM 10, and adjustment data and control data are written in the built-in flash ROM 13, and nothing is necessary for a user who uses the interchangeable lens 1 less frequently. . In the case of a user who is frequently used, a warning is issued from the interchangeable lens 1 or the camera before the flash ROM is rewritten 100 times. The user can determine whether to make a repair request to the manufacturer or to leave it as it is based on the content of the warning. Even if it is left as it is, if the user does not care about the autofocus speed in the above-described example, there is no particular problem even if the user does not care about it.

このように、例えば「何が原因で警告を出したのか?」、「このまま使用した場合の不具合は?」ということが警告として発せられることで、使用者の判断に委ねることが可能である。これによって、使用者はより安価な交換レンズ1を購入することができ、自分の使用頻度に応じかつ性能差を考えて、修理するか否かを判断することができる。また、修理の内容はEEPROM10を取り付けるだけなので、使用者への課金や修理日数の軽減が図れ、更にメーカにとっては在庫管理がし易いなど、互いに便利なシステムとなる。   As described above, for example, “What caused the warning?” And “What is the malfunction when used as it is” are issued as warnings, and it is possible to leave it to the judgment of the user. Accordingly, the user can purchase a cheaper interchangeable lens 1 and can determine whether or not to repair the interchangeable lens 1 according to his / her use frequency and considering a performance difference. Further, since the contents of the repair are only attached to the EEPROM 10, the user can be charged, the number of repair days can be reduced, and the manufacturer can easily manage the inventory.

図3は通信インタフェース9の内部構造を表している。レンズマイコン2に3本の電気信号が接続され、通信インタフェース9を介して交換レンズ1のマウント側に接続されている。この3本の信号は図示しないマウントを介して、通常はカメラと接続されて通信を行っている。また、フラッシュROM13やEEPROM10を書き換える場合には、外部装置を使用してレンズマイコン2と通信する設定となっている。   FIG. 3 shows the internal structure of the communication interface 9. Three electrical signals are connected to the lens microcomputer 2 and connected to the mount side of the interchangeable lens 1 via the communication interface 9. These three signals are usually connected to a camera via a mount (not shown) for communication. Further, when the flash ROM 13 or the EEPROM 10 is rewritten, it is set to communicate with the lens microcomputer 2 using an external device.

図3において、レンズマイコン2では通信インタフェース9はクロック同期式のシリアル通信インタフェースとして設定され、バッファ9aはカメラからの出力データCoutを受信し、その出力はレンズマイコン2の入力端子Linに接続されている。バッファ9bはレンズマイコン2からの出力データLoutを受信し、その出力はカメラの入力端子Cinに接続されている。バッファ9cは双方向通信が可能なバッファであり、通常はカメラからの同期クロック出力Cclkを受信し、その出力はレンズマイコン2の同期クロック入力端子Lclkに接続されている。   In FIG. 3, in the lens microcomputer 2, the communication interface 9 is set as a clock synchronous serial communication interface, the buffer 9a receives the output data Cout from the camera, and its output is connected to the input terminal Lin of the lens microcomputer 2. Yes. The buffer 9b receives the output data Lout from the lens microcomputer 2, and its output is connected to the input terminal Cin of the camera. The buffer 9c is a buffer capable of bidirectional communication, and normally receives a synchronous clock output Cclk from the camera, and its output is connected to the synchronous clock input terminal Lclk of the lens microcomputer 2.

図4は交換レンズ1のマウント側から観測した図3のCout、Cin、Cclkの波形を表している。レンズマイコン2はCclkの立ち下りでLoutにデータを出力し、Cclkの立ち上がりでカメラデータCoutをLinで読み取る仕様となっている。シリアルデータは8ビットを基本として認識され、通信自体はカメラ又は外部装置からの指示コマンドに応じたデータ数で互いに通信して認識する方式となっている。レンズマイコン2は8ビットを基本としたシリアルデータを全て受信すると、Busyと記載した波形に示すようにCclkを出力端子に切換えて出力を一旦引き下げる動作を行う。このとき、カメラ又は外部装置はバッファ9cの入出力方向の反転とCclkを出力端子から入力端子に切換えている。   4 shows the waveforms of Cout, Cin, and Cclk of FIG. 3 observed from the mount side of the interchangeable lens 1. The lens microcomputer 2 is configured to output data to Lout at the fall of Cclk and read the camera data Cout with Lin at the rise of Cclk. Serial data is recognized on the basis of 8 bits, and communication itself is performed by communicating with each other by the number of data corresponding to an instruction command from a camera or an external device. When the lens microcomputer 2 receives all the serial data based on 8 bits, the lens microcomputer 2 switches the Cclk to the output terminal as shown by the waveform described as Busy, and performs the operation of temporarily lowering the output. At this time, the camera or the external device switches the inversion of the input / output direction of the buffer 9c and Cclk from the output terminal to the input terminal.

この操作によって、レンズマイコン2は受信したデータ処理を行い、処理が終了するとCclkの引き下げを解除して入力端子に切換える。これによって、Cclkは電源にプルアップされているためハイレベルに設定される。カメラ又は外部装置はこのCclkがハイレベルに設定されることを待ってから、Cclkを出力端子に切換えてバッファ9cの入出力方向を反転して次の通信を送信する。   By this operation, the lens microcomputer 2 processes the received data, and when the processing is completed, cancels the lowering of Cclk and switches to the input terminal. As a result, Cclk is pulled up to the power source and is therefore set to the high level. The camera or external device waits for this Cclk to be set to the high level, then switches Cclk to the output terminal, inverts the input / output direction of the buffer 9c, and transmits the next communication.

図5は図4のシリアル通信波形を16進数のデータに変換し、かつ時系列で通信内容を示した表である。(1)のCoutはカメラコマンド通信で、カメラからの指示コマンドは10Hである。この10HはフラッシュROM13へのデータ書き込み指示、或いは外付けEEPROM10がある場合はEEPROM10への書き込み指示とレンズマイコン2は認識し、また通信するデータ数は3バイトとなっている。このときのCinは前回の通信によって変わるため、XXH(無意味)としている。   FIG. 5 is a table in which the serial communication waveform of FIG. 4 is converted into hexadecimal data and the communication contents are shown in time series. Cout in (1) is camera command communication, and the instruction command from the camera is 10H. The lens microcomputer 2 recognizes this 10H as an instruction to write data to the flash ROM 13, or if there is an external EEPROM 10, and the number of data to be communicated is 3 bytes. Since Cin at this time changes depending on the previous communication, it is set to XXH (nonsense).

(2)はカメラからの指示コマンド10Hの1バイト目のデータで、フラッシュROM13(又はEEPROM10)への書込データを表している。Cinはカメラからの指示コマンドがフラッシュROM13(又はEEPROM10)への書き込み指示であったため、フラッシュROM13(又はEEPROM10)の最終上位アドレスを返信している。   (2) is data of the first byte of the instruction command 10H from the camera and represents data to be written to the flash ROM 13 (or EEPROM 10). Cin returns the last upper address of the flash ROM 13 (or EEPROM 10) because the instruction command from the camera is a write instruction to the flash ROM 13 (or EEPROM 10).

(3)はカメラからの指示コマンド10Hの2バイト目のデータで、フラッシュROM13(又はEEPROM10)への書込上位アドレスデータを表している。Cinはカメラからの指示コマンドが書き込み指示であったため、フラッシュROM13(又はEEPROM10)の最終下位アドレスを返信している。   (3) is the second byte data of the instruction command 10H from the camera and represents the upper address data to be written to the flash ROM 13 (or the EEPROM 10). Cin returns the last lower address of the flash ROM 13 (or EEPROM 10) because the instruction command from the camera is a write instruction.

(4)はカメラからの指示コマンド10Hの3バイト目のデータで、フラッシュROM13(又はEEPROM10)の下位アドレスデータを表している。Cinはカメラからの指示コマンドをそのまま返信している。   (4) is the third byte data of the instruction command 10H from the camera, and represents the lower address data of the flash ROM 13 (or EEPROM 10). Cin returns an instruction command from the camera as it is.

(5)のCoutはカメラコマンド通信で、カメラからの指示コマンドは00Hである。この00Hは現状維持を表し、レンズマイコン2は特に何も動作はせず、Cinはカメラからの指示コマンドをそのまま返信している。   Cout in (5) is camera command communication, and the instruction command from the camera is 00H. This 00H represents the status quo, the lens microcomputer 2 does not perform any particular operation, and Cin returns the instruction command from the camera as it is.

前述した通信内容を簡単に説明すると、カメラからはアドレスH’01FFHのフラッシュROM13(又はEEPROM10)に、AAHのデータ書き込み指示を行っていることになる。このとき、レンズマイコン2からはフラッシュROM13の消去可能ブロック13aがデータ領域であるため、最終アドレスがH’0FFFであることをカメラに伝達している。また、EEPROM10が取り付けられている場合には、プログラムでこの書き込みアドレスをEEPROM10用に変換する処理を行う。その後に、指定されたフラッシュROM13の領域やEEPROM10の領域にデータ書込処理を行う。   Briefly explaining the above-described communication contents, an AAH data write instruction is issued from the camera to the flash ROM 13 (or EEPROM 10) at the address H'01FFH. At this time, since the erasable block 13a of the flash ROM 13 is a data area, the lens microcomputer 2 notifies the camera that the final address is H'0FFF. If the EEPROM 10 is attached, the program converts the write address for the EEPROM 10 using a program. Thereafter, data writing processing is performed on the designated area of the flash ROM 13 or the area of the EEPROM 10.

また、(4)、(5)のCinでレンズマイコン2がカメラからの指示コマンド10Hを返信しているのは、レンズマイコン2が間違いなく10Hを受信したことを表している。これが10H以外の場合には、何らかの原因でレンズマイコン2がカメラからの指示コマンドを受信していないことになり、カメラ又は外部装置側で通信エラー処理を行うことで、最初からカメラコマンドデータを送り直すことなども可能である。   In addition, the fact that the lens microcomputer 2 sends back the instruction command 10H from the camera in Cin of (4) and (5) indicates that the lens microcomputer 2 has definitely received 10H. If this is other than 10H, the lens microcomputer 2 has not received an instruction command from the camera for some reason, and the camera command data is sent from the beginning by performing communication error processing on the camera or external device side. It is possible to fix it.

図4、図5で説明した外部装置からの通信によって、フラッシュROM13(又はEEPROM10)の書き換えを行った場合、或いは内部の制御データや調整データを更新するために書き換えた場合は、そのときの書換回数も同時に更新する。つまり、この書換回数自体もデータの一部としてフラッシュROM13の領域やEEPROM10の領域の特定のアドレスに配置され、書き換えを行う度に計数される。レンズマイコン2内のプログラムでは、この書換回数の制限値を記憶している。   When the flash ROM 13 (or the EEPROM 10) is rewritten by communication from the external device described with reference to FIGS. 4 and 5, or when it is rewritten to update internal control data or adjustment data, rewriting at that time The number of times is updated at the same time. That is, the number of times of rewriting itself is also arranged as a part of data at a specific address in the area of the flash ROM 13 or the area of the EEPROM 10, and is counted each time rewriting is performed. The program in the lens microcomputer 2 stores the limit value of the number of rewrites.

レンズマイコン2では、フラッシュROM13なら100回、EEPROM10なら100万回として、時々、書き込まれた書換回数データとの比較をしている。このプログラムはリセット処理や書換処理内に配置されていて、EEPROM10が取り付けられている/いない、により何れかの制限値を使うかを判断する。   In the lens microcomputer 2, the flash ROM 13 is 100 times, and the EEPROM 10 is 1 million times. This program is arranged in the reset process and the rewrite process, and determines whether to use any limit value depending on whether or not the EEPROM 10 is attached.

このプログラムでは、書換回数の制限値が近付いた又は超えた異常があると判断した場合は、何らかの警告を出すようにしている。警告の方法としては、交換レンズ1内に発音体を設けて音による警告や、通信インタフェース9を使って、カメラが表示部に何らかの警告表示を出せるようなシステム構成にしている。   In this program, when it is determined that there is an abnormality approaching or exceeding the limit value of the number of rewrites, some kind of warning is issued. As a warning method, a sound generator is provided in the interchangeable lens 1 to make a sound warning, or the communication interface 9 is used so that the camera can display some warning display on the display unit.

また、前述した不揮発性メモリの書換回数の制限については、実際には書換回数ではなく、消去回数が制限されている場合が一般的である。これは消去時にメモリ自体に高電圧を印加させることで消去を行っているため、この高電圧によるデバイスの劣化が消去回数制限として設定されていることに起因している。   In addition, regarding the limitation on the number of times of rewriting of the nonvolatile memory described above, in general, the number of times of erasure is limited, not the number of times of rewriting. This is because, since erasing is performed by applying a high voltage to the memory itself at the time of erasing, the deterioration of the device due to the high voltage is set as the number of times of erasing.

つまり、前述した書換回数制限の説明では書き換えと同時に消去を行っている場合は、書換回数を計数しても同じであることが判断できる。ただし、書換時に消去しないで書き込みのみで対応し、書き込みで対応しきれなくなると消去するような制御であれば、消去回数を計数することが必要となる。   That is, in the description of the rewrite count restriction described above, if erasure is performed at the same time as rewrite, it can be determined that the same is achieved even if the rewrite count is counted. However, it is necessary to count the number of times of erasing if the control is such that only erasing is performed without erasing at the time of rewriting and erasing is performed when the erasing cannot be performed.

図6はレンズマイコン2のリセット処理制御シーケンスの動作フローチャート図である。   FIG. 6 is an operation flowchart of the reset processing control sequence of the lens microcomputer 2.

ステップS100:初めに交換レンズ1が図示しないカメラに装着されると、カメラからは交換レンズ1に電源が供給され、その供給された電源によってレンズマイコン2は図示しない発振回路が発振を始めて動作を開始する。   Step S100: When the interchangeable lens 1 is first attached to a camera (not shown), power is supplied from the camera to the interchangeable lens 1, and the lens microcomputer 2 operates with an oscillation circuit (not shown) oscillating with the supplied power. Start.

ステップS101:レンズマイコン2は動作が開始されると、フラッシュROM13の消去可能ブロック13b以降に記憶されたファームウエアがスタートする。ファームウエアで最初に処理されるのは、レンズマイコン2のリセット処理からで、主にレンズマイコン2内部の周辺ペリフェラル14の初期化やRAM12のクリア等が行われている。   Step S101: When the operation of the lens microcomputer 2 is started, the firmware stored after the erasable block 13b of the flash ROM 13 is started. The first processing by the firmware is from the reset processing of the lens microcomputer 2, and mainly the peripheral peripheral 14 in the lens microcomputer 2 is initialized and the RAM 12 is cleared.

ステップS102:次の処理として、レンズマイコン2は外付けEEPROM10が取り付けられているか否かを判別する。そのために、外付けEEPROM10の予め決められたアドレスのデータの読み出し処理を行う。実際には、レンズマイコン2のEEPROM10と結線されているポートを使って、EEPROM10内のデータのシリアル受信処理を行っている。読み出したデータが16進数でFFH以外であった場合は、EEPROM10が取り付けられていると判断し、以降の処理はEEPROM10内のデータを使用することになる。   Step S102: As the next processing, the lens microcomputer 2 determines whether or not the external EEPROM 10 is attached. For this purpose, data reading processing of a predetermined address of the external EEPROM 10 is performed. Actually, serial reception processing of data in the EEPROM 10 is performed using a port connected to the EEPROM 10 of the lens microcomputer 2. If the read data is a hexadecimal number other than FFH, it is determined that the EEPROM 10 is attached, and the subsequent processing uses the data in the EEPROM 10.

また、EEPROM10から読み出したデータが16進数でFFHの場合は、EEPROM10が取り付けられていないか、或いはデータがFFHの場合が考えられる。そこで、EEPROM10に対して予め決められたアドレスに所定の値を書き込む処理を行う。書込処理が終了すると再びデータを書き込んだアドレスのデータの読み出し処理を行う。その読み出したデータが、先ほど書き込んだデータと等しい場合はEEPROM10が取り付けられていると判断する。また、読み出したデータがFFHであった場合は、EEPROM10が取り付けられていないと判断する。   When the data read from the EEPROM 10 is hexadecimal FFH, the EEPROM 10 is not attached, or the data is FFH. Therefore, a process of writing a predetermined value at a predetermined address to the EEPROM 10 is performed. When the writing process ends, the data reading process at the address where the data is written is performed again. If the read data is equal to the data written earlier, it is determined that the EEPROM 10 is attached. If the read data is FFH, it is determined that the EEPROM 10 is not attached.

ステップS103:レンズマイコン2はEEPROM10が取り付けられていると判断すると、EEPROM10内のデータを全てRAM12のH’FF0000〜H’FF0FFFのアドレスに転送する。RAM12に全てのデータを転送する理由として、これらのデータを使用する場合に、EEPROM10が取り付けられているか否かの判断を毎回することが面倒なためである。RAM12に転送することで、これらのデータを使用する場合は、常にRAM12から転送するのみであるため、前述の判断が不要となり、プログラムの処理時間を早くできることになる。   Step S103: When the lens microcomputer 2 determines that the EEPROM 10 is attached, it transfers all the data in the EEPROM 10 to the addresses of H'FF0000 to H'FF0FFF in the RAM 12. The reason for transferring all the data to the RAM 12 is that it is troublesome to determine whether or not the EEPROM 10 is attached every time when using these data. By transferring these data to the RAM 12, when these data are used, they are always transferred only from the RAM 12, so that the above-described determination is not required, and the processing time of the program can be shortened.

ステップS104:レンズマイコン2はEEPROM10が取り付けられていないと判断した場合に、以降の処理はフラッシュROM13内のデータを使用し、フラッシュROM13の消去可能ブロック13a内のデータをRAM12に転送する。RAM12を使用する理由はステップS103と同じ理由である。   Step S104: When the lens microcomputer 2 determines that the EEPROM 10 is not attached, the subsequent processing uses the data in the flash ROM 13 and transfers the data in the erasable block 13a of the flash ROM 13 to the RAM 12. The reason for using the RAM 12 is the same reason as in Step S103.

ステップS105:レンズマイコン2はRAM12に転送された書換回数データを読み出す処理を行う。EEPROM10が装着されている場合は読み出した書換回数データとEEPROM10の書換制限である100万回との比較を行う。EEPROM10が装着されていない場合は、読み出した書換回数データとフラッシュROM13の書換制限である100回との比較を行う。何れの場合でも、書換回数が制限に近い又は超えているか否かを判断するが、EEPROM10の場合はその書換回数の制限は100万回とかなり大きい数値であるため、システム的に絶対にこの数値を超えないという推定もできる。従って、EEPROM10が装着されている場合には、書換回数と書換制限との比較を行わずに制限内にあると判断してもよい。   Step S105: The lens microcomputer 2 performs a process of reading the rewrite count data transferred to the RAM 12. When the EEPROM 10 is mounted, the read-out rewrite count data is compared with the million rewrite limit of the EEPROM 10. If the EEPROM 10 is not mounted, the read-out rewrite count data is compared with the 100 rewrite limit of the flash ROM 13. In any case, it is determined whether or not the number of rewrites is close to or exceeding the limit. In the case of the EEPROM 10, the limit on the number of rewrites is a very large value of 1 million times. It can be estimated that it does not exceed. Accordingly, when the EEPROM 10 is mounted, it may be determined that the number of rewrites is within the limit without comparing the number of rewrites with the rewrite limit.

ステップS106:ステップS105で制限に近い又は書換制限を超えていると判断した場合は、交換レンズ1内に埋め込まれた図示しない圧電素子やスピーカなどに警告音を鳴らす処理を実行する。その他の警告方法として、通信インタフェース9によるカメラ−レンズ間通信で交換レンズ1の異常をカメラに送信して、カメラの液晶に表示する処理でも支障はない。このとき、異常の内容によって、どのような不具合の発生が考えられるかを表示させることで、使用者の判断に委ねることも可能である。   Step S106: When it is determined in step S105 that the limit is close to or exceeds the rewrite limit, a process for sounding a warning sound to a piezoelectric element or a speaker (not shown) embedded in the interchangeable lens 1 is executed. As another warning method, there is no problem in the process of transmitting the abnormality of the interchangeable lens 1 to the camera by the camera-lens communication through the communication interface 9 and displaying it on the liquid crystal of the camera. At this time, it is also possible to leave it to the user's judgment by displaying what kind of trouble may occur depending on the content of the abnormality.

ステップS107:全てのリセット処理を終了して、通常の交換レンズ1の処理に移行する。   Step S107: All reset processes are terminated, and the process proceeds to the normal process of the interchangeable lens 1.

図7はレンズマイコン2の割込処理制御シーケンスのフローチャート図である。   FIG. 7 is a flowchart of the interrupt processing control sequence of the lens microcomputer 2.

ステップS200:この処理はカメラ又は外部装置からのシリアル通信による指示コマンドを解析するための処理で、図4のBusy中に行っている。レンズマイコン2はカメラからの通信を受信すると、この割込処理を他の処理よりも優先的に行っている。   Step S200: This process is a process for analyzing an instruction command by serial communication from a camera or an external device, and is performed during Busy in FIG. When receiving the communication from the camera, the lens microcomputer 2 preferentially performs this interrupt process over other processes.

ステップS201:レンズマイコン2はカメラ又は外部装置からのシリアル通信で受信した値がコマンドなのかデータなのかを判断する。図5でも説明したように、コマンドとはカメラからの操作命令であり、その操作命令を実行するための各種情報をデータとしている。例えば、図5では10Hがコマンド命令でROMへの書き込みを行うことをレンズマイコン2に要求していて、この10Hコマンドの後の3バイト通信はデータ受信を伴うことを意味している。つまり、レンズマイコン2は10H通信+3バイトのデータを受信した後で、フラッシュROM13又はEEPROM10への書込処理を行うことになる。   Step S201: The lens microcomputer 2 determines whether the value received by serial communication from the camera or an external device is a command or data. As described with reference to FIG. 5, the command is an operation command from the camera, and various information for executing the operation command is used as data. For example, in FIG. 5, 10H requests the lens microcomputer 2 to write to the ROM by a command command, and 3-byte communication after this 10H command means that data reception is involved. That is, the lens microcomputer 2 performs the writing process to the flash ROM 13 or the EEPROM 10 after receiving 10H communication + 3 bytes of data.

コマンド通信の場合はステップS202に移行し、以前にコマンドを受信した後のデータ受信要求であった場合はステップS206に移行する。   In the case of command communication, the process proceeds to step S202, and in the case of a data reception request after receiving a command previously, the process proceeds to step S206.

ステップS202:ステップS201での判断がコマンド通信であるため、レンズマイコン2は交換レンズ1の駆動要求命令か否かを判断する。   Step S202: Since the determination in step S201 is command communication, the lens microcomputer 2 determines whether or not it is a drive request command for the interchangeable lens 1.

ステップS203:ステップS202で交換レンズ1の駆動命令である場合は、モータユニット6に対しレンズ駆動を開始する。交換レンズ1の駆動開始処理を行うと、ステップS209に移行して割込処理を終了する。   Step S203: If it is a drive command for the interchangeable lens 1 in Step S202, lens drive for the motor unit 6 is started. When the drive start process of the interchangeable lens 1 is performed, the process proceeds to step S209 and the interrupt process is terminated.

ステップS204:ステップS201での判断がコマンド通信であるため、レンズマイコン2は絞りの駆動要求命令か否かを判断する。   Step S204: Since the determination in step S201 is command communication, the lens microcomputer 2 determines whether or not it is an aperture drive request command.

ステップS205:ステップS204で絞りの駆動命令である場合は、絞りユニット7に対し絞り駆動を開始する。絞りユニット7の駆動開始処理を行うと、ステップS209に移行して割込処理を終了する。本来はその他に、手振れ補正等の様々な駆動命令コマンドやデータ送信要求命令が存在するが、本実施例とは無関係のため説明を省略する。   Step S205: If it is a stop drive command in Step S204, the stop drive for the stop unit 7 is started. When the drive start process of the aperture unit 7 is performed, the process proceeds to step S209, and the interrupt process is terminated. Originally, there are various other drive command commands such as camera shake correction and data transmission request commands, but the description is omitted because they are not related to this embodiment.

ステップS206:初めに、受信した内容がコマンド通信なのかデータ要求なのかを判断する。コマンド命令である場合は受信コマンドが10Hか否かを判断する。10Hである場合には、次回の通信は3バイトのデータの受信であることを記憶する。また、次回の通信からは、後述する図8のステップS300の処理Aに移行するために、フラッシュROM13又はEEPROM10に関する操作状態であることを記憶する。また、通信コマンドが10H以外の場合はステップS207に移行する。   Step S206: First, it is determined whether the received content is a command communication or a data request. If it is a command command, it is determined whether the received command is 10H. If it is 10H, it is stored that the next communication is reception of 3 bytes of data. Further, from the next communication, it is stored that the operation state is related to the flash ROM 13 or the EEPROM 10 in order to shift to the processing A of step S300 in FIG. If the communication command is other than 10H, the process proceeds to step S207.

また、受信した内容がデータ要求である場合に、フラッシュROM13又はEEPROM10の操作に関する操作状態であるか否かを判断する。フラッシュROM13又はEEPROM10の操作に関する操作状態ならば、図8のステップS300の処理Aに移行し、それ以外ならステップS207に移行する。   Further, when the received content is a data request, it is determined whether or not the operation state is related to the operation of the flash ROM 13 or the EEPROM 10. If the operation state is related to the operation of the flash ROM 13 or the EEPROM 10, the process proceeds to step A300 in FIG. 8; otherwise, the process proceeds to step S207.

ステップS207:交換レンズ1の駆動要求命令や絞りユニット7の駆動命令、フラッシュROM13又はEEPROM10の書き込み命令以外のコマンド通信であるため、レンズマイコン2は通信されたコマンドから何の要求命令なのか解析を行う。   Step S207: Since the command communication is other than the drive request command for the interchangeable lens 1, the drive command for the aperture unit 7, and the write command for the flash ROM 13 or the EEPROM 10, the lens microcomputer 2 analyzes what the request command is from the communicated command. Do.

ステップS208:ステップS201でコマンド通信ではなくデータ受信要求である場合、或いはステップS207で解析した結果、データの受信要求、データの送信要求、その他等を判断して、次の通信に必要な処理を行う。なお、本実施例では無関係な通信であるため、詳しい説明を省略する。   Step S208: If it is a data reception request instead of command communication in Step S201, or a result of analysis in Step S207, a data reception request, a data transmission request, etc. are determined, and processing necessary for the next communication is performed. Do. In addition, since it is unrelated communication in a present Example, detailed description is abbreviate | omitted.

ステップS209:レンズマイコン2のシリアル通信割込処理を終了する。   Step S209: The serial communication interrupt process of the lens microcomputer 2 is terminated.

図8は図7のステップS206において、レンズマイコン2の割込処理制御シーケンスのメモリが操作状態にある場合の動作フローチャート図である。   FIG. 8 is an operation flowchart when the memory of the interrupt processing control sequence of the lens microcomputer 2 is in the operating state in step S206 of FIG.

ステップS300、S301:レンズマイコン2は今回の通信がデータ通信であって、何回目の通信であるかを判断する。コマンド通信後の最初の通信である場合は、フラッシュROM13(又はEEPROM10)の書込データを表しているためステップS302に移行する。   Steps S300 and S301: The lens microcomputer 2 determines how many times the current communication is data communication and the communication. If it is the first communication after the command communication, it represents the write data of the flash ROM 13 (or EEPROM 10), and the process proceeds to step S302.

ステップS302:カメラ又は外部装置から送信されたメモリ書込データをRAM12に記憶する。   Step S302: The memory write data transmitted from the camera or the external device is stored in the RAM 12.

ステップS303:レンズマイコン2はコマンド通信後の2回目の通信か否かを判断する。2回目データはフラッシュROM13(又はEEPROM10)にデータを書き込むための上位アドレスを表しているため、ステップS304に移行する。   Step S303: The lens microcomputer 2 determines whether or not the second communication after the command communication. Since the second time data represents an upper address for writing data to the flash ROM 13 (or EEPROM 10), the process proceeds to step S304.

ステップS304:カメラ又は外部装置から送信されたメモリ書込上位アドレスデータをRAM12に記憶する。   Step S304: The memory write upper address data transmitted from the camera or the external device is stored in the RAM 12.

ステップS305:メモリ書込操作命令のデータ通信であり、かつ最初でも2回目の通信でもない場合は、フラッシュROM13(又はEEPROM10)にデータを書き込むための下位アドレスであると判断する。その結果、受信したデータを無条件でカメラ又は外部装置から送信されたメモリ書込下位アドレスデータとしてRAM12に記憶する。また、これでメモリ書込操作のための一連の通信処理が終了したため、フラッシュROM13又はEEPROM10の操作に関する操作状態であることを記憶していた状態を解除する。   Step S305: If it is the data communication of the memory write operation command and neither the first communication nor the second communication, it is determined that it is a lower address for writing data to the flash ROM 13 (or the EEPROM 10). As a result, the received data is stored in the RAM 12 as memory write lower address data transmitted unconditionally from the camera or the external device. In addition, since a series of communication processes for the memory writing operation is completed, the state where the operation state relating to the operation of the flash ROM 13 or the EEPROM 10 is stored is cancelled.

ステップS306:レンズマイコン2は図6のリセット処理のステップS102において、EEPROM10が取り付けられているか判断した結果を基に、現在のメモリ状態を判断する。   Step S306: The lens microcomputer 2 determines the current memory state based on the result of determining whether the EEPROM 10 is attached in step S102 of the reset process of FIG.

ステップS307:ステップS306でEEPROM10が取り付けられていないと判断した場合は,ステップS301〜S305で取得したアドレスデータと書込データを使って、フラッシュROM13の消去可能ブロック13aのデータを書き換える処理を行う。同時に、記憶している書換回数データを+1又は−1することで、計数を進める操作を行ってからフラッシュROM13に書き込む。   Step S307: If it is determined in step S306 that the EEPROM 10 is not attached, the address data and write data acquired in steps S301 to S305 are used to rewrite the data in the erasable block 13a of the flash ROM 13. At the same time, the stored number-of-rewrites data is incremented by +1 or -1, so that the operation for advancing the count is performed and then written to the flash ROM 13.

ステップS308:ステップS306でEEPROM10が取り付けられていると判断した場合は、ステップS301〜S305で取得したアドレスデータと書込データを使って、EEPROM10の書込処理を行う。また、このとき通信によって取得したアドレスデータは、フラッシュROM13のアドレスデータに相当するため、EEPROM10のアドレスへの変換処理を行っている。同時に、記憶している書換回数データを+1又は−1することで、計数を進める操作を行ってからEEPROM10に書き込む。   Step S308: If it is determined in step S306 that the EEPROM 10 is attached, the EEPROM 10 is written using the address data and write data acquired in steps S301 to S305. Further, the address data acquired by communication at this time corresponds to the address data of the flash ROM 13, and therefore conversion processing to the address of the EEPROM 10 is performed. At the same time, the stored number-of-rewrites data is incremented by +1 or -1, so that the operation for advancing the count is performed and then written to the EEPROM 10.

ステップS309:レンズマイコン2はEEPROM10が装着されている場合は更新した書換回数データと書換制限である100万回との比較を行う。EEPROM10が装着されていない場合は、読み出した書換回数データと書換制限である100回の比較を行う。何れの場合でも書換回数が制限に近い又は超えているか否かを判断する。   Step S309: When the EEPROM 10 is mounted, the lens microcomputer 2 compares the updated rewrite frequency data with 1 million rewrite limit. When the EEPROM 10 is not mounted, the read rewrite count data is compared with the rewrite limit 100 times. In any case, it is determined whether the number of rewrites is close to or exceeding the limit.

ステップS310:ステップS309で制限に近い又は書換制限を超えていると判断した場合は、警告の処理を実行する。   Step S310: If it is determined in step S309 that the limit is near or exceeds the rewrite limit, a warning process is executed.

ステップS311:図7のステップS209に移行する。図8のステップS306〜S310は、例えば図7のステップS203やステップS205の処理で行うこともある。これは前述したように、交換レンズ1の各種制御データ又は調整データの更新が必要な場合は、これらの各データを使用しているプログラム内でフラッシュROM13やEEPROM10の書き換えを行っているためである。これらの処理に関しては、ステップS306〜S310をサブルーチンとして考えると、他の制御から簡単にアクセスできる。   Step S311: The process proceeds to step S209 in FIG. Steps S306 to S310 in FIG. 8 may be performed, for example, by the processing in steps S203 and S205 in FIG. This is because, as described above, when various control data or adjustment data of the interchangeable lens 1 needs to be updated, the flash ROM 13 and the EEPROM 10 are rewritten in a program using these data. . Regarding these processes, if steps S306 to S310 are considered as a subroutine, they can be easily accessed from other controls.

実施例1では、フラッシュROM13とEEPROM10の2種類のメモリについて説明した。しかし、近年の他のメモリ手段として非接触ICタグが知られており、例えば特許文献2では交換レンズに固体識別情報を記憶したICタグとして紹介されている。   In the first embodiment, two types of memories, the flash ROM 13 and the EEPROM 10, have been described. However, a non-contact IC tag is known as another memory means in recent years. For example, Patent Document 2 introduces an IC tag having solid identification information stored in an interchangeable lens.

図9は実施例2の交換レンズ1内部のブロック回路構成図であり、実施例1の図1とほぼ同様であるが、図1に対して、レンズマイコン2にICタグリーダ21の出力が接続されている。そして、ICタグリーダ21によりICタグ22のデータを読み込み可能とされている。   FIG. 9 is a block circuit configuration diagram inside the interchangeable lens 1 according to the second embodiment, which is almost the same as FIG. 1 according to the first embodiment, but the output of the IC tag reader 21 is connected to the lens microcomputer 2 with respect to FIG. ing. The IC tag reader 21 can read the data of the IC tag 22.

ICタグリーダ21及びICタグ22の処理は、最初にICタグリーダ21がマイクロ波帯の電波をICタグ22に送信する。交換レンズ1内のICタグ22は電波を送受信するアンテナを備えており、このアンテナにより受信した電波から電磁誘導により電源を作り出し動作する。電波はデータの送受信も兼ねているため、予め記憶している各種制御データや調整データを出力し、この出力されたデータをICタグリーダ21が読み取って、RAM12に転送するようになっている。   In the processing of the IC tag reader 21 and the IC tag 22, the IC tag reader 21 first transmits a microwave band radio wave to the IC tag 22. The IC tag 22 in the interchangeable lens 1 has an antenna for transmitting and receiving radio waves, and operates by generating a power source by electromagnetic induction from the radio waves received by the antenna. Since the radio wave also serves as data transmission / reception, various control data and adjustment data stored in advance are output, and the output data is read by the IC tag reader 21 and transferred to the RAM 12.

本実施例2では、種類の異なる複数のメモリがあるため、レンズマイコン2は予め設定してある使用メモリの優先順位に従って、各種メモリの装着の有無を確認している。本実施例2では、EEPROM10を最優先順位とし、次にICタグ22、フラッシュROM13の順位として選択している。EEPROM10を最優先順位としたのは、書換回数制限が大きいためである。使い方としては、初めにフラッシュROM13を使用し、書換制限回数に達するとICタグ22を使用する。これはICタグ22の通信方式は非接触であり、交換レンズ1の近くに配置されていればよいため、交換レンズ1の外装に取り付けるのみで、新たなメモリに対応できるためである。EEPROM10を使用するには、交換レンズ1を分解してEEPROM10を取り付けることになるため、面倒な作業となる。   In the second embodiment, since there are a plurality of different types of memories, the lens microcomputer 2 confirms whether or not various memories are mounted in accordance with a preset priority order of used memories. In the second embodiment, the EEPROM 10 is selected as the highest priority, and then the IC tag 22 and the flash ROM 13 are selected. The reason why the EEPROM 10 is given the highest priority is that the rewrite frequency limit is large. As a usage, the flash ROM 13 is used first, and the IC tag 22 is used when the rewrite limit number is reached. This is because the communication method of the IC tag 22 is non-contact and it is only necessary that the IC tag 22 be disposed near the interchangeable lens 1, so that it is possible to deal with a new memory by simply attaching it to the exterior of the interchangeable lens 1. To use the EEPROM 10, the interchangeable lens 1 is disassembled and the EEPROM 10 is attached, which is a troublesome work.

次に、ICタグ22が書換回数制限に達すると、取り付けられているICタグ22を外して、新しいICタグ22を取り付け、或いはEEPROM10を取り付けてもよい。これはEEPROM10が最も書換回数が多いことから、同じユーザが何度も交換する場合はICタグ22よりもEEPROM10を取り付けた方が良い場合もあるためである。フラッシュROM13、ICタグ22、EEPROM10の中からデータを取得するメモリが決定すると、そのメモリのデータを全てRAM12に転送する。   Next, when the IC tag 22 reaches the rewrite count limit, the attached IC tag 22 may be removed, and a new IC tag 22 may be attached, or the EEPROM 10 may be attached. This is because the EEPROM 10 has the highest number of rewrites, and therefore it may be better to attach the EEPROM 10 than the IC tag 22 when the same user exchanges it many times. When the memory for acquiring data from the flash ROM 13, the IC tag 22, and the EEPROM 10 is determined, all the data in the memory is transferred to the RAM 12.

図10はレンズマイコン2のリセット処理制御シーケンスの動作フローチャート図である。   FIG. 10 is an operation flowchart of the reset processing control sequence of the lens microcomputer 2.

ステップS400:初めに交換レンズ1が図示しないカメラに装着されると、カメラから交換レンズ1に電源が供給され、供給された電源によってレンズマイコン2は動作を開始する。   Step S400: When the interchangeable lens 1 is first attached to a camera (not shown), power is supplied from the camera to the interchangeable lens 1, and the lens microcomputer 2 starts operating with the supplied power.

ステップS401:レンズマイコン2の動作が開始されると、フラッシュROM13の消去可能ブロック13b以降に記憶されたファームウエアがスタートする。ファームウエアで最初に処理されるのは、レンズマイコン2のリセット処理からで、主にレンズマイコン2へ内部の周辺ペリフェラル14の初期化やRAM12のクリア等が行われる。   Step S401: When the operation of the lens microcomputer 2 is started, the firmware stored after the erasable block 13b of the flash ROM 13 is started. The first processing by the firmware is from the reset processing of the lens microcomputer 2, and mainly initialization of the peripheral peripheral 14 inside the lens microcomputer 2, clearing of the RAM 12, and the like are performed.

ステップS402:次の処理として、レンズマイコン2では外付けEEPROM10が取り付けられているか否かを判断する。そのために外付けEEPROM10の予め決められたアドレスのデータの読み出し処理を行う。実際には、レンズマイコン2のEEPROM10と結線されているポートを使ってEEPROM10内のデータのシリアル受信処理を行う。読み出したデータが16進数でFFH以外である場合は、EEPROM10が取り付けられていると判断し、以降の処理はEEPROM10内のデータを使用することになる。   Step S402: As the next processing, the lens microcomputer 2 determines whether or not the external EEPROM 10 is attached. For this purpose, data reading processing of a predetermined address of the external EEPROM 10 is performed. Actually, serial reception processing of data in the EEPROM 10 is performed using a port connected to the EEPROM 10 of the lens microcomputer 2. If the read data is a hexadecimal number other than FFH, it is determined that the EEPROM 10 is attached, and the subsequent processing uses the data in the EEPROM 10.

また、EEPROM10から読み出したデータが16進数でFFHである場合は、EEPROM10が取り付けられていないか、或いはデータがFFHの場合が考えられる。そこで、EEPROM10に対して予め決められたアドレスに所定の値を書き込む処理を行う。書込処理が終了すると、再びデータを書き込んだアドレスのデータの読み出し処理を行う。読み出したデータが、先に書き込んだデータと等しい場合はEEPROM10が取り付けられていると判断する。また、読み出したデータがFFHである場合は、EEPROM10が取り付けられていないと判断する。   Further, when the data read from the EEPROM 10 is FFH in hexadecimal, it may be considered that the EEPROM 10 is not attached or the data is FFH. Therefore, a process of writing a predetermined value at a predetermined address to the EEPROM 10 is performed. When the writing process is completed, the data reading process at the address where the data is written is performed again. If the read data is equal to the previously written data, it is determined that the EEPROM 10 is attached. If the read data is FFH, it is determined that the EEPROM 10 is not attached.

ステップS403:レンズマイコン2はEEPROM10が取り付けられていると判断した場合に、以降の処理はEEPROM10内のデータを使用することになる。そして、EEPROM10内のデータを全てRAM12のH’FF0000〜H’FF0FFFのアドレスに転送する。RAM12に全てのデータを転送する理由として、これらのデータを使用する場合に、EEPROM10が取り付けられているか否かの判断を毎回行うことが面倒なためである。   Step S403: When the lens microcomputer 2 determines that the EEPROM 10 is attached, the subsequent processing uses data in the EEPROM 10. Then, all the data in the EEPROM 10 is transferred to the addresses of H′FF0000 to H′FF0FFF in the RAM 12. The reason for transferring all the data to the RAM 12 is that it is troublesome to determine whether or not the EEPROM 10 is attached every time when using these data.

ステップS404:次の処理として、レンズマイコン2ではICタグ22が取り付けられているか否かを判断する。そのために、ICタグリーダ21を起動させる。   Step S404: As the next processing, the lens microcomputer 2 determines whether or not the IC tag 22 is attached. For this purpose, the IC tag reader 21 is activated.

ステップS405:レンズマイコン2はICタグ22が取り付けられていると判断すると、ICタグ22内のデータを使用するために、ICタグ22内のデータを全てRAM12に転送する。RAM12を使用する理由はステップS403と同じ理由である。   Step S405: When the lens microcomputer 2 determines that the IC tag 22 is attached, in order to use the data in the IC tag 22, all the data in the IC tag 22 is transferred to the RAM 12. The reason for using the RAM 12 is the same reason as in step S403.

ステップS406:レンズマイコン2はEEPROM10及びICタグ22が取り付けられていないと判断した場合に、以降の処理はフラッシュROM13内のデータを使用することになる。そして、フラッシュROM13の消去可能ブロック13a内のデータをRAM12に転送する。RAM12を使用する理由はステップS403と同じ理由である。   Step S406: When the lens microcomputer 2 determines that the EEPROM 10 and the IC tag 22 are not attached, the subsequent processing uses the data in the flash ROM 13. Then, the data in the erasable block 13 a of the flash ROM 13 is transferred to the RAM 12. The reason for using the RAM 12 is the same reason as in step S403.

ステップS407:レンズマイコン2はRAM12に転送された書換回数データを読み出す処理を行う。EEPROM10が装着されている場合には、読み出した書換回数データと書換制限である100万回との比較を行う。EEPROM10が装着されていない場合は、ICタグ22が装着されているか否かを判断し、装着されている場合は読み出した書換回数データとICタグ22の書換制限である1万回との比較を行う。ICタグ22が装着されていないと判断した場合は、読み出した書換回数データとフラッシュROM13の書換制限である100回との比較を行う。何れの場合でも、書換回数が制限に近い又は超えているか否かを判断する。   Step S407: The lens microcomputer 2 performs a process of reading the rewrite count data transferred to the RAM 12. When the EEPROM 10 is mounted, the read rewrite count data is compared with the rewrite limit of 1 million times. If the EEPROM 10 is not attached, it is determined whether or not the IC tag 22 is attached. If it is attached, the read rewrite frequency data is compared with 10,000 times that is the rewrite limit of the IC tag 22. Do. When it is determined that the IC tag 22 is not attached, the read rewrite count data is compared with the rewrite limit of the flash ROM 13 which is 100 times. In any case, it is determined whether the number of rewrites is close to or exceeding the limit.

ステップS408:ステップS407で書換制限に近い又は超えていると判断した場合は、圧電素子やスピーカなどで警告音を鳴らす処理を実行する。   Step S408: When it is determined in step S407 that the rewrite limit is close or exceeded, a process of sounding a warning sound with a piezoelectric element or a speaker is executed.

ステップS409:全てのリセット処理を終了して、通常の交換レンズの処理に移行する。   Step S409: All reset processes are terminated, and the process proceeds to normal interchangeable lens processing.

図11はレンズマイコン2内の割込処理制御シーケンスのメモリ書き込みに関する動作フローチャート図である。   FIG. 11 is an operation flowchart relating to memory writing of the interrupt processing control sequence in the lens microcomputer 2.

ステップS500、S501:レンズマイコン2は今回の通信がデータ通信であって、何回目の通信であるかを判断する。コマンド通信後の最初の通信である場合は、フラッシュROM13(又はEEPROM10、ICタグ22)への書込データを表しているため、ステップS502に移行する。   Steps S500 and S501: The lens microcomputer 2 determines how many times the current communication is data communication and the communication. If it is the first communication after the command communication, it represents the write data to the flash ROM 13 (or the EEPROM 10, the IC tag 22), and therefore the process proceeds to step S502.

ステップS502:カメラ又は外部装置から送信されたメモリ書込データをRAM12に記憶する。   Step S502: The memory write data transmitted from the camera or the external device is stored in the RAM 12.

ステップS503:レンズマイコン2はコマンド通信後の2回目の通信か否かを判断する。2回目データはフラッシュROM13(又はEEPROM10、ICタグ22)にデータを書き込むための上位アドレスを表しているためステップS504に移行する。   Step S503: The lens microcomputer 2 determines whether or not the second communication after the command communication. Since the second data represents the upper address for writing data to the flash ROM 13 (or EEPROM 10, IC tag 22), the process proceeds to step S504.

ステップS504:カメラ又は外部装置から送信されたメモリ書込上位アドレスデータをRAM12に記憶する。   Step S504: The memory write upper address data transmitted from the camera or the external device is stored in the RAM 12.

ステップS505:メモリ書込操作命令のデータ通信であり、かつ最初でも2回目の通信でもない場合は、フラッシュROM13(又はEEPROM10、ICタグ22)にデータを書き込むための下位アドレスであると判断する。その結果、受信したデータを無条件でカメラ又は外部装置から送信されたメモリ書込下位アドレスデータとしてRAM12に記憶する。   Step S505: If it is data communication of the memory write operation command and it is not the first or second communication, it is determined that the address is a lower address for writing data to the flash ROM 13 (or EEPROM 10, IC tag 22). As a result, the received data is stored in the RAM 12 as memory write lower address data transmitted unconditionally from the camera or the external device.

また、これでメモリ書込操作のための一連の通信処理が終了したため、フラッシュROM13(又はEEPROM10、ICタグ22)の操作に関する操作状態であることを記憶していた状態を解除する。   In addition, since a series of communication processing for the memory writing operation is completed, the state where the operation state relating to the operation of the flash ROM 13 (or the EEPROM 10, the IC tag 22) is stored is cancelled.

ステップS506:レンズマイコン2は図10のリセット処理のステップS402において、EEPROM10が取り付けられているかを判断した結果を基に、現在のメモリ状態を判断する。   Step S506: The lens microcomputer 2 determines the current memory state based on the result of determining whether the EEPROM 10 is attached in step S402 of the reset process of FIG.

ステップS507:レンズマイコン2は図10のリセット処理のステップS404において、ICタグ22が取り付けられているかを判断した結果を基に、現在のメモリ状態を判断する。   Step S507: The lens microcomputer 2 determines the current memory state based on the determination result of whether or not the IC tag 22 is attached in step S404 of the reset process of FIG.

ステップS508:ステップS506でEEPROM10が取り付けられていると判断した場合は、ステップS501〜S505で取得したアドレスデータと書込データを使って、EEPROM10の書換処理を行う。   Step S508: If it is determined in step S506 that the EEPROM 10 is attached, the EEPROM 10 is rewritten using the address data and the write data acquired in steps S501 to S505.

また、このとき通信によって取得したアドレスデータは、フラッシュROM13のアドレスデータに相当するため、EEPROM10のアドレスに変換する処理を行う。同時に、記憶している書換回数データを+1又は−1することで計数を進める操作を行ってから、EEPROM10に書き込みを行う。   In addition, since the address data acquired by communication at this time corresponds to the address data of the flash ROM 13, the address data is converted into the address of the EEPROM 10. At the same time, an operation for advancing the count is performed by incrementing the stored rewrite count data by +1 or −1, and then writing to the EEPROM 10 is performed.

ステップS509:ステップS507でICタグ22が取り付けられていると判断した場合は、ステップS501からステップS505で取得したアドレスデータと書込データを使ってICタグ22の書換処理を行う。また、このとき通信によって取得したアドレスデータはフラッシュROM13のアドレスデータに相当するため、ICタグ22のアドレスに変換する処理を行う。同時に、記憶している書換回数データを+1又は−1することで計数を進める操作を行ってから、ICタグ22に書き込む。   Step S509: If it is determined in step S507 that the IC tag 22 is attached, the IC tag 22 is rewritten using the address data and write data acquired in steps S501 to S505. In addition, since the address data acquired by communication at this time corresponds to the address data of the flash ROM 13, the address data is converted to the address of the IC tag 22. At the same time, the stored number-of-rewrites data is incremented by +1 or −1 and the count is incremented, and then written to the IC tag 22.

ステップS510:ステップS507でICタグ22が取り付けられていないと判断した場合は、ステップS501〜S505で取得したアドレスデータと書込データを使って、フラッシュROM13の消去可能ブロック13aのデータの書換処理を行う。同時に、記憶している書換回数データを+1又は−1することで計数を進める操作を行ってから、フラッシュROM13に書き込む。   Step S510: If it is determined in step S507 that the IC tag 22 is not attached, the data in the erasable block 13a of the flash ROM 13 is rewritten using the address data and write data acquired in steps S501 to S505. Do. At the same time, the stored number-of-rewrites data is incremented by +1 or −1, and the count is incremented, and then written in the flash ROM 13.

ステップS511:レンズマイコン2はステップS508〜S510で、RAM12にも同時に書き込まれた書換回数データを読み出す処理を行う。EEPROM10が装着されている場合には、読み出した書換回数データとEEPROM10の書換制限である100万回との比較を行う。   Step S511: The lens microcomputer 2 performs a process of reading out the rewrite count data simultaneously written in the RAM 12 in steps S508 to S510. When the EEPROM 10 is mounted, the read-out rewrite count data is compared with the million rewrite limit of the EEPROM 10.

ICタグ22が装着されている場合は読み出したICタグの書換回数データとICタグの書換制限である1万回との比較を行う。ICタグ22が装着されていない場合は読み出した書換回数データとフラッシュROM13の書換制限である100回の比較を行う。何れの場合でも、書換回数が制限に近い又は超えているか否かを判断する。   When the IC tag 22 is attached, the read IC tag rewrite frequency data is compared with 10,000 times which is the rewrite limit of the IC tag. When the IC tag 22 is not mounted, the read rewrite count data is compared with the rewrite limit of the flash ROM 13 100 times. In any case, it is determined whether the number of rewrites is close to or exceeding the limit.

ステップS512:ステップS511で制限に近い又は書換制限を超えていると判断した場合は、警告処理を実行する。   Step S512: If it is determined in step S511 that the limit is near or exceeds the rewrite limit, a warning process is executed.

ステップS513:図7のステップS209に移行する。   Step S513: The process proceeds to step S209 in FIG.

特開2006−30859号公報JP 2006-30859 A

本発明では、実施例の光学機器のメモリシステムのみならず、フラッシュROM仕様のマイコンを使用した産業機器であれば、同様な構成やシステムを構築できる。   In the present invention, not only the memory system of the optical device of the embodiment but also an industrial device using a flash ROM microcomputer can be used to construct a similar configuration and system.

実施例1のブロック回路構成図である。1 is a block circuit configuration diagram of Embodiment 1. FIG. メモリの配置の説明図である。It is explanatory drawing of arrangement | positioning of memory. 通信インタフェースの説明図である。It is explanatory drawing of a communication interface. 通信波形の説明図である。It is explanatory drawing of a communication waveform. 通信内容の説明図である。It is explanatory drawing of the content of communication. 実施例1のリセット処理動作のフローチャート図である。FIG. 6 is a flowchart of reset processing operation according to the first embodiment. 実施例1の割込処理フローチャート図である。FIG. 3 is a flowchart of interrupt processing according to the first embodiment. 実施例1の割込処理動作のフローチャート図である。FIG. 6 is a flowchart of interrupt processing operations according to the first embodiment. 実施例2のブロック回路構成図である。6 is a block circuit configuration diagram of Embodiment 2. FIG. 実施例2のリセット処理動作のフローチャート図である。FIG. 10 is a flowchart of reset processing operation according to the second embodiment. 実施例2の割込処理動作のフローチャート図である。FIG. 10 is a flowchart of interrupt processing operations according to the second embodiment.

符号の説明Explanation of symbols

1 交換レンズ
2 レンズマイコン
3 回転量検出器
4 電圧検出器
6 モータユニット
7 絞りユニット
8 手振れ補正ユニット
9 通信インタフェース
10 EEPROM
11 CPUコア
12 RAM
13 フラッシュROM
13a〜13b 消去可能ブロック
14 周辺ペリフェラル
21 ICタグリーダ
22 ICタグ
DESCRIPTION OF SYMBOLS 1 Interchangeable lens 2 Lens microcomputer 3 Rotation amount detector 4 Voltage detector 6 Motor unit 7 Aperture unit 8 Camera shake correction unit 9 Communication interface 10 EEPROM
11 CPU core 12 RAM
13 Flash ROM
13a to 13b Erasable block 14 Peripheral peripheral 21 IC tag reader 22 IC tag

Claims (9)

種類の異なる複数の不揮発性メモリの組み込みが可能な光学機器のメモリシステムにおいて、
組み込まれている前記不揮発性メモリの種類を判別する判別手段と、
前記不揮発性メモリを使用する優先順位を予め記憶した記憶手段と
前記判別手段により種類の異なる複数の不揮発性メモリが装着されていると判別した場合に、前記記憶手段に記憶された優先順位に従って選択された不揮発性メモリの情報に応じて前記光学機器を制御する制御手段と、を有し、
前記判別手段は、前記優先順位に従って選択された不揮発性メモリ内のデータを読み出し、前記読み出したデータに応じて前記優先順位に従って選択された不揮発性メモリが外付けか否かを判別することを特徴とするメモリシステム。
In a memory system of an optical device capable of incorporating a plurality of different types of nonvolatile memories,
A discriminating means for discriminating the type of the nonvolatile memory incorporated therein;
Storage means for storing the priority order of using the nonvolatile memory in advance ;
When a plurality of non-volatile memory of different types by the determining means is determined to have been attached, the optical instrument according to the information of the nonvolatile memory that is selected according to priority stored in said storage means Control means for controlling ,
The determining means reads data in a nonvolatile memory selected according to the priority order, and determines whether or not the nonvolatile memory selected according to the priority order is external according to the read data. And memory system.
前記判別手段は、前記読み出したデータが16進数でFFH以外の場合、前記優先順位に従って選択された不揮発性メモリが外付けであると判別することを特徴とする請求項1に記載のメモリシステム。2. The memory system according to claim 1, wherein when the read data is a hexadecimal number other than FFH, the determining unit determines that the nonvolatile memory selected according to the priority order is external. 前記判別手段は、前記読み出したデータが16進数でFFHの場合、前記優先順位に従って選択された不揮発性メモリに所定のデータを書き込んだ後に、前記書き込んだデータを読み出し、前記読み出したデータが前記書き込んだデータと等しい場合は前記優先順位に従って選択された不揮発性メモリが外付けであると判別し、前記読み出したデータが前記書き込んだデータと異なる場合は前記優先順位に従って選択された不揮発性メモリが外付けでないと判別することを特徴とする請求項2に記載のメモリシステム。When the read data is hexadecimal FFH, the determination means writes the predetermined data to the nonvolatile memory selected according to the priority, reads the written data, and the read data is the write If the read-out data is different from the written data, the non-volatile memory selected according to the priority order is determined to be external. The memory system according to claim 2, wherein the memory system is determined not to be attached. 前記制御手段は、前記不揮発性メモリへの前記光学機器が備えるモーターの累積駆動回数を書き込んだ回数、または、消去した回数が、前記優先順位に従って選択された不揮発性メモリに設定されている所定値を超えた場合、警告を出力することを特徴とする請求項1乃至3のいずれか1項に記載のメモリシステム。The control means is a predetermined value in which the number of times of writing or erasing the cumulative driving number of the motor included in the optical device in the nonvolatile memory is set in the nonvolatile memory selected according to the priority order 4. The memory system according to claim 1, wherein a warning is output when the threshold is exceeded. 5. 前記優先順位に従って選択された不揮発性メモリが外付けである場合、前記優先順位に従って選択された不揮発性メモリへ前記モーターの累積駆動回数を書き込んだ回数、または、消去した回数に関係なく警告を出力しないことを特徴とする請求項4に記載のメモリシステム。When the non-volatile memory selected according to the priority order is external, a warning is output regardless of the number of times the cumulative driving number of the motor has been written or erased to the non-volatile memory selected according to the priority order 5. The memory system according to claim 4, wherein the memory system is not. 前記制御手段は、前記不揮発性メモリに書き込まれた前記光学機器が備えるモーターの累積駆動回数が前記モーターに設定されている所定値よりも大きい場合、前記モーターへ印加する電圧を高くすることを特徴とする請求項1乃至3のいずれか1項に記載のメモリシステム。The control means increases the voltage applied to the motor when the cumulative number of driving times of the motor included in the optical device written in the nonvolatile memory is larger than a predetermined value set in the motor. The memory system according to any one of claims 1 to 3. 前記不揮発性メモリの異常を検出する手段を有し、前記優先順位によって選択された前記不揮発性メモリの異常を検出した場合に警告を出力することを特徴とする請求項1に記載のメモリシステム。   2. The memory system according to claim 1, further comprising means for detecting an abnormality of the nonvolatile memory, and outputting a warning when an abnormality of the nonvolatile memory selected according to the priority order is detected. 前記不揮発性メモリの異常は、前記不揮発性メモリの書換回数に基づくことを特徴とする請求項に記載のメモリシステム。 The memory system according to claim 7 , wherein the abnormality of the nonvolatile memory is based on the number of rewrites of the nonvolatile memory. 請求項1乃至8のいずれか1項に記載のメモリシステムを有する光学機器。An optical apparatus comprising the memory system according to claim 1.
JP2007046500A 2007-02-27 2007-02-27 Memory system Expired - Fee Related JP5196809B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007046500A JP5196809B2 (en) 2007-02-27 2007-02-27 Memory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007046500A JP5196809B2 (en) 2007-02-27 2007-02-27 Memory system

Publications (3)

Publication Number Publication Date
JP2008210169A JP2008210169A (en) 2008-09-11
JP2008210169A5 JP2008210169A5 (en) 2010-04-08
JP5196809B2 true JP5196809B2 (en) 2013-05-15

Family

ID=39786407

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007046500A Expired - Fee Related JP5196809B2 (en) 2007-02-27 2007-02-27 Memory system

Country Status (1)

Country Link
JP (1) JP5196809B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5535383B2 (en) * 2013-09-02 2014-07-02 株式会社東芝 Host device and control tool

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3912447B2 (en) * 1997-11-14 2007-05-09 株式会社安川電機 Memory system and method of using external nonvolatile memory
JP2001109670A (en) * 1999-10-05 2001-04-20 Canon Inc Information processing apparatus, recording apparatus, flash ROM rewrite control method, and flash ROM reuse method
JP4422926B2 (en) * 2001-07-02 2010-03-03 株式会社リコー Image forming apparatus
JP2004109693A (en) * 2002-09-19 2004-04-08 Canon Inc Camera, lens device and camera system

Also Published As

Publication number Publication date
JP2008210169A (en) 2008-09-11

Similar Documents

Publication Publication Date Title
JP6206583B2 (en) Memory chip, imaging cartridge, method of changing serial number, and method of using memory chip
US8130596B2 (en) Electronic circuit controlling the operation of peripheral members of the watch
CN110211621B (en) Bidirectional counter in flash memory
US7602655B2 (en) Embedded system
JP6447469B2 (en) Rewriting system
JP5196809B2 (en) Memory system
KR20020036717A (en) Microcomputer and method for controlling the same
JP2001306543A (en) Microcomputer, and data reloading method for flash memory
JP4989208B2 (en) INVERTER DEVICE PARAMETER TRANSFER SYSTEM, INVERTER DEVICE AND PARAMETER TRANSFER DEVICE
JP5884663B2 (en) Electronic control device and data rewriting system
US20050289290A1 (en) In-circuit programming architecture with processor and delegable flash controller
EP0881578A2 (en) Microcomputer
JP4158935B2 (en) Memory card input / output device and control method thereof
JP2013122690A (en) Ic card, portable electronic device and ic card control method
JP7006410B2 (en) Control device, image forming device and circuit device
JP2007226302A (en) Memory device
CN102411989B (en) Semiconductor integrated circuit and method of controlling memory device
JP2008225922A (en) Nonvolatile storage device
WO2001097056A1 (en) Integrated circuit and method of writing nonvolatile memory within integrated circuit
JPH09231065A (en) Programmable electronic control unit
CN114490455B (en) Method for managing operations and corresponding memory device
JP5052221B2 (en) Semiconductor integrated circuit
JP7011054B2 (en) RFID tags and RFID tag systems
JP2008257415A (en) Controller with program writing function
JP2007257544A (en) Portable electronic device and IC card

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100222

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100222

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20100302

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20100630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120508

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120709

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130122

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130205

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160215

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5196809

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160215

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees