JP2621500B2 - CPU data communication processing method - Google Patents

CPU data communication processing method

Info

Publication number
JP2621500B2
JP2621500B2 JP1220971A JP22097189A JP2621500B2 JP 2621500 B2 JP2621500 B2 JP 2621500B2 JP 1220971 A JP1220971 A JP 1220971A JP 22097189 A JP22097189 A JP 22097189A JP 2621500 B2 JP2621500 B2 JP 2621500B2
Authority
JP
Japan
Prior art keywords
serial
data
cpu
circuit
register
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 - Lifetime
Application number
JP1220971A
Other languages
Japanese (ja)
Other versions
JPH02160225A (en
Inventor
俊彦 石村
玲二 関
明彦 藤野
Original Assignee
ミノルタ株式会社
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 ミノルタ株式会社 filed Critical ミノルタ株式会社
Priority to JP1220971A priority Critical patent/JP2621500B2/en
Publication of JPH02160225A publication Critical patent/JPH02160225A/en
Application granted granted Critical
Publication of JP2621500B2 publication Critical patent/JP2621500B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、所定の処理を行なうと共に外部装置との間
でデータ交信を行うCPUのデータ交信処理方式に関す
る。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data communication processing method of a CPU that performs predetermined processing and performs data communication with an external device.

従来の技術 外部装置との間でデータ交信するときにCPUの端子数
を少なくするためにデータ交信をシリアルで行うことが
一般的である。例えば1バイト分のデータを外部装置か
らシリアルで読込む場合、8個のシリアル転送用クロッ
クをCPUから外部装置に送り、これらシリアル転送用ク
ロックに応答して外部装置から順次シリアル転送されて
くる1バイト分のデータをCPU内のシリアルレジスタに
読込み、一括してパラレルに読込むことが通常なされて
いる。
2. Description of the Related Art It is common to perform data communication serially in order to reduce the number of CPU terminals when performing data communication with an external device. For example, when serially reading 1-byte data from an external device, eight serial transfer clocks are sent from the CPU to the external device, and the serial transfer is sequentially performed from the external device in response to the serial transfer clock. It is common practice to read bytes of data into a serial register in the CPU and read them in parallel in a batch.

発明が解決しようとする課題 この場合、クロックの出力が開始されてから1バイト
分のデータのシリアルレジスタへの読込みが終了するま
でに要する時間を計数するタイマーがCPUに設けられて
おり、このシリアル転送に要する期間CPUは待機状態に
あった。即ち、CPUの全体としての処理時間を考える
と、この待機期間は他の処理はなされず無駄であった。
In this case, the CPU is provided with a timer that counts the time required from the start of clock output to the end of reading one byte of data into the serial register. The CPU was in a standby state during the period required for the transfer. That is, considering the processing time of the CPU as a whole, this waiting period was useless because no other processing was performed.

本発明はこのような無駄な時間を節約できるCPUのデ
ータ交信処理方式を提供することを目的とする。
An object of the present invention is to provide a data communication processing method of a CPU that can save such useless time.

課題を解決するための手段 本発明は、メインルーチンからの指令に応答してシリ
アル交信用クロックを出力し、該クロックがシリアル交
信に要する数だけ出力されると割込み要求を発生するシ
リアル交信用インターフェースと、上記割込み要求に応
答して上記クロックの出力を停止すると共にデータ交信
の割込み処理を行う割込みルーチンとをCPUに備えたこ
とを特徴とする。
SUMMARY OF THE INVENTION The present invention provides a serial communication interface which outputs a serial communication clock in response to a command from a main routine, and generates an interrupt request when the clock is output by the number required for serial communication. And an interrupt routine for stopping output of the clock in response to the interrupt request and performing interrupt processing for data communication.

作用 データ交信の割込み処理が行われるのは、メインルー
チンのクロック出力指令が1バイト分のクロック出力後
であり、それまでの間メインルーチンは所定の処理を行
う。
The interrupt processing for data communication is performed after the clock output command of the main routine is output for one byte of clock. Until that time, the main routine performs predetermined processing.

実施例 本発明をカメラに適用した場合の一実施例を以下に説
明する。第1図は本実施例によるカメラの全体構成を示
すブロック図である。尚、本実施例では自動焦点調節
(以下、AFという)機能および自動フィルム巻上機能を
有し、着脱自在な交換レンズとフラッシュとに対してデ
ータ転送を行なうフォーカルプレンシャッターカメラを
例に説明する。図において、カメラ本体は、カメラ制御
部としてのCPU(1)の他に、主としてAF回路(2)、
フィルム感度出力部(3)、露出モード設定部(4)、
測光回路(5)、表示回路(6)からなっている。CPU
(1)はRAMを内蔵したワンチップマイクロコンピュー
タであり、AF・測光・演算・表示・露出制御(AE)・フ
ィルム巻上げ等の制御を行なう。
Embodiment An embodiment in which the present invention is applied to a camera will be described below. FIG. 1 is a block diagram showing the overall configuration of the camera according to the present embodiment. In this embodiment, a focal plane shutter camera having an automatic focus adjustment (hereinafter, referred to as AF) function and an automatic film winding function and transferring data to a detachable interchangeable lens and a flash will be described as an example. . In the figure, a camera body mainly includes an AF circuit (2) in addition to a CPU (1) as a camera control unit.
Film sensitivity output section (3), exposure mode setting section (4),
It comprises a photometric circuit (5) and a display circuit (6). CPU
(1) is a one-chip microcomputer having a built-in RAM, which controls AF, photometry, calculation, display, exposure control (AE), film winding, and the like.

AF回路(2)は、焦点検出用ラインセンサとしてのCC
D、CCD駆動部、A/D変換部を備えており、CPU(1)から
の制御信号によりCCDの電荷蓄積(積分)の開始及び終
了、CCD出力(アナログ)のデシタル化等の動作を行な
う。フィルム感度出力部(3)はフィルム容器上にDXコ
ードの形態で印字されているフィルム感度を自動的に読
取ってCPU(1)に出力する。露出モード設定部(4)
は操作部材により手動設定されたシャッター速度や絞り
値、露出制御モード(プログラム、シャッター優先、絞
り優先等)をCPU(1)に出力する。これら回路
(2)、(3)、(4)はそれぞれ専用のデータバスを
介してCPU(1)との間でデータ交信を行なう。
The AF circuit (2) uses a CC as a focus detection line sensor.
A D / CCD drive unit and A / D conversion unit are provided, and operations such as start and end of CCD charge accumulation (integration) and digitalization of CCD output (analog) are performed by control signals from the CPU (1). . The film sensitivity output unit (3) automatically reads the film sensitivity printed in the form of a DX code on the film container and outputs the film sensitivity to the CPU (1). Exposure mode setting section (4)
Outputs the shutter speed, aperture value, and exposure control mode (program, shutter priority, aperture priority, etc.) manually set by the operation member to the CPU (1). These circuits (2), (3) and (4) communicate data with the CPU (1) via dedicated data buses.

一方、詳細は後述するが、測光回路(5)及び表示回
路(6)は交換レンズのレンズ回路(7)、フラッシュ
装置のフラッシュ回路(8)と共に共通のデータバスを
介してCPU(1)との間で順次データ交信を行なうよう
構成されている。
On the other hand, although details will be described later, the photometric circuit (5) and the display circuit (6) are connected to the CPU (1) via a common data bus together with the lens circuit (7) of the interchangeable lens and the flash circuit (8) of the flash device. Are configured to perform data communication sequentially.

スイッチSW1はシャッタ釦の押圧操作の初期段階でON
して、焦点検出及び測光動作を行なわせるための信号を
CPU(1)の割込み入力端IP1に与える撮影準備スイッチ
である。スイッチSW2はシャッタ釦の押圧操作の最終段
階でONしてシャッタレリーズ動作を行なわせるための信
号をCPU(1)の割込み入力端IP2に与えるレリーズスイ
ッチである。スイッチSW3は開放絞りからの絞り込み量
に応じた数のパルスを発生する絞りエンコーダスイッチ
である。スイッチSW4はメインミラーのアップ動作に連
動してONし、フィルム巻上げ動作の完了に連動してOFF
する巻上げ状態検出スイッチである。
Switch SW 1 is ON at the initial stage of shutter button pressing operation
Signal for performing focus detection and photometric operation.
A photographing preparation switch which gives to the interrupt input terminal IP 1 of CPU (1). Switch SW 2 is a release switch which provides a signal for causing the shutter release operation and ON at the final stage of the pressing operation of the shutter button to the interrupt input terminal IP 2 of CPU (1). Switch SW 3 is an aperture encoder switch for generating a number of pulses corresponding to the narrowing of the open aperture. Switch SW 4 is turned on when the main mirror is moved up, and turned off when the film winding operation is completed.
This is a winding state detection switch.

パワーオンクリア回路は抵抗とコンデンサとの直列接
続体からなり、その接続中点はCPU(1)のリセット端
(RESET)に接続されている。
The power-on-clear circuit is composed of a series connection of a resistor and a capacitor, and the midpoint of the connection is connected to the reset terminal (RESET) of the CPU (1).

マグネットRMgはCPU(1)の出力端OP1からの制御信
号に応答してカメラのシャッタレリーズを開始させるレ
リーズマグネットである。マグネットFMgはCPU(1)の
出力端OP2からの制御信号に応答して絞りの絞り込み動
作を停止する絞りマグネットである。マグネット(1CM
g)及び(2CMg)はCPU(1)の出力端(OP3)、(OP4
からの制御信号に応答してフォーカルプレーンシャッタ
の先幕、後幕の走行を開始させるシャッタ制御用マグネ
ットである。
Magnet RMg is a release magnet for starting the shutter release in response camera to a control signal from the output terminal OP 1 of CPU (1). Magnet FMg is an aperture magnet for stopping the narrowing operation of the diaphragm in response to a control signal from the output terminal OP 2 of CPU (1). Magnet (1CM
g) and (2CMg) an output terminal of the CPU (1) (OP 3) , (OP 4)
This is a shutter control magnet that starts traveling of the front curtain and rear curtain of the focal plane shutter in response to a control signal from the shutter.

巻上げ回路はCPU(1)の出力端(OP6)、(OP7)の
制御信号に応答してフィルム巻上げ及びシャッターチャ
ージ用モータM1を駆動する。レンズ駆動回路はCPU
(1)の出力端(OP8)、(OP9)の制御信号に応答して
AF用モータM2を駆動する。
The winding circuit output terminal of the CPU (1) (OP 6) , drives the motor M 1 for to film winding and shutter charging in response to a control signal (OP 7). Lens drive circuit is CPU
In response to the control signals of the output terminals (OP 8 ) and (OP 9 ) of (1)
Drives the AF motor M 2.

次に、CPU(1)と測光回路(5)、表示回路
(6)、レンズ回路(7)、フラッシュ回路(8)との
間のデータ交信のための回路構成を説明する。まず、CP
U(1)には、これら回路(5)〜(8)からCPU(1)
に或いはCPU(1)からこれら回路(5)〜(8)にシ
リアル転送されるデータをハード的に一時的に蓄えるシ
リアルレジスタを含むシリアルインターフェースSCI
と、シリアルインターフェースSCIに一時記憶されたデ
ータがソフト的に蓄えられるRAMとを備えている。尚、
シリアルインテーフェースの詳細構造は第2図で後述す
る。CPU(1)の出力端OP11〜OP14はシリアル転送を行
なうべき回路を指定するためのに設けられており、
「L」レベル信号を出力された端子に対応する回路が選
択される。ここで、出力端子OP11はレンズ回路(7)
に、出力端子OP12はフラッシュ回路(8)に、出力端子
OP13は表示回路(6)に、出力端子OP14は測光回路
(5)にそれぞれ接続されている。尚、フラッシュ回路
(8)はCPU(1)との間でデータ送信及び受信の両方
を行なえるようになっており、出力端子PO10の出力レベ
ルに応じて送信及び受信のいずれになるかが決定され
る。具体的には出力端子OP10が「L」レベルのときはフ
ラッシュ回路(8)からCPU(1)へのデータ受信とな
り、「H」レベルのときはCPU(1)からフラッシュ回
路(8)へのデータ受信となる。
Next, a circuit configuration for data communication between the CPU (1) and the photometric circuit (5), the display circuit (6), the lens circuit (7), and the flash circuit (8) will be described. First, CP
U (1) includes the CPU (1) from these circuits (5) to (8).
Or a serial interface SCI including a serial register for temporarily storing data serially transferred from the CPU (1) to these circuits (5) to (8).
And a RAM in which data temporarily stored in the serial interface SCI is stored as software. still,
The detailed structure of the serial interface will be described later with reference to FIG. Output terminal OP 11 ~OP 14 of CPU (1) is provided for to specify a circuit to perform a serial transfer,
The circuit corresponding to the terminal that has output the "L" level signal is selected. Here, the output terminal OP 11 is a lens circuit (7)
The output terminal OP 12 is connected to the flash circuit (8) and the output terminal
OP 13 in the display circuit (6), the output terminal OP 14 are connected to the photometry circuit (5). Incidentally, a flash circuit (8) is turned perform so both data transmission and reception between the CPU (1), or be one of the transmit and receive in accordance with the output level of the output terminal PO 10 is It is determined. Specifically from the flash circuit when the output terminal OP 10 is "L" level (8) will receive data to CPU (1), "H" from the CPU (1) when the level to the flash circuit (8) Is received.

第2図はシリアルインターフェースの具体構成を示す
回路図である。図において、CPU(1)の基準周波数を
分周したシリアルクロックSCK1はシリアルデータ転送の
同期をとるために用いられるが、このクロックはアンド
ゲートにより出力端OP5との論理積SCK2として各回路
(5)〜(8)に与えられる。即ち、出力端子OP5
「H」レベルのときのみCPU(1)からシリアルクロッ
クSCK2の送出が許可される。又、上記シリアルクロック
SCK1はシリアルインターフェース内において8進カウン
タに入力され、そのカウンタのキャリー出力は後述のシ
リアル割込み用信号として用いられる。尚、シリアル割
込みが許可状態にあるときにシリアル割込み信号が出力
されると、後述するように、シリアルクロックSCK1の出
力は自動的に停止するようソフト的に構成されている。
FIG. 2 is a circuit diagram showing a specific configuration of the serial interface. In the figure, the serial clock SCK 1 a reference frequency by dividing the CPU (1) is used to synchronize the serial data transfer, this clock each as logical SCK 2 the output terminal OP 5 by the AND gate Circuits (5) to (8) are provided. That is, the output terminal OP 5 is transmitted only from CPU (1) when the "H" level of the serial clock SCK 2 is permitted. Also, the above serial clock
SCK 1 is input to an octal counter in the serial interface, and the carry output of the counter is used as a serial interrupt signal described later. Incidentally, the serial interrupt signal is output when the serial interrupt is in the authorized state, as described later, the output of the serial clock SCK 1 is software-configured to automatically stop.

これらシリアルクロックSCK1、端子OP5、論理積SC
K2、シリアル割込み信号の関係を第3図のタイミングチ
ャートに示す。このタイミングチャート及び4図ないし
第14図のフローチャートに基づいて本実施例の作用を説
明する。
These serial clock SCK 1 , terminal OP 5 , logical product SC
The relationship between K 2 and the serial interrupt signal is shown in the timing chart of FIG. The operation of this embodiment will be described with reference to this timing chart and the flowcharts of FIGS.

第4図は、電池装着時に公知のパワーオンクリア回路
によってリセット端子RESETへの入力レベルが「L」か
ら「H」に立ち上がったときの割込みによる電池装着ル
ーチンのフローを示している。
FIG. 4 shows a flow of a battery mounting routine by an interrupt when the input level to the reset terminal RESET rises from "L" to "H" by a known power-on clear circuit when the battery is mounted.

割込みがかかると、ステップ(#1)でCPU(1)内
のPAMのクリアを行い、測光フラグ(後述)をリセット
し、出力端子OP10からOP14を「H」にし、出力端子OP1
からOP4を「L」にする。
When an interrupt is applied, the step (# 1) performs the clearing of PAM in CPU (1), the resets the metering flag (described later), the OP 14 to "H" from the output terminal OP 10, the output terminal OP 1
To make OP 4 "L".

次にステップ(#2)で一度すべての割込みを禁止
し、ステップ(#3)で撮影準備スイッチSW1のONによ
る起動割込みを許可し、CPUスタンバイ状態になる。
Next step (# 2) is prohibited once all interrupts, step permits activation interrupt by ON photographing preparation switch SW 1 in (# 3), the CPU standby state.

この後、撮影準備スイッチ(SW1)がONされると、第
5図に示すメインルーチンが起動する。尚、このメイン
ルーチンではAF制御を優先的に実行する構成となってい
る。メインルーチンにおいて、まずステップ(#10)で
測光フラグをリセットする。この測光フラグは以下の第
1表に示すシリアル転送が1回終了すると“0"から“1"
に切換わるフラグである。次に、ステップ(#11)でシ
リアルコードとして0を代入する。メインルーチンはAF
のための演算制御が主になっているが、シリアルコード
はAE演算等のための複数種類の制御を割込み処理で行う
上で、その処理の順番を指定するためのものである。シ
リアルコードは0から4まであり、それぞれ、第1表に
示すようなルーチンを処理する。
Thereafter, when the photographing preparation switch (SW 1 ) is turned on, the main routine shown in FIG. 5 is started. In this main routine, the AF control is executed with priority. In the main routine, first, the photometry flag is reset in step (# 10). The photometry flag changes from “0” to “1” when the serial transfer shown in Table 1 below is completed once.
The flag is switched to. Next, in step (# 11), 0 is substituted as a serial code. The main routine is AF
The serial code is used to specify the order of the processes when performing a plurality of types of control for the AE calculation and the like in the interrupt process. There are serial codes 0 to 4, each of which processes a routine as shown in Table 1.

ステップ(#12)ではAF回路(2)中のCCDをイニシ
ャライズする。ステップ(#14)は、第6図に示すシリ
アルスタートのサブルーチンを実行する。以下、第6図
に示したサブルーチンについて説明する。
In step (# 12), the CCD in the AF circuit (2) is initialized. In step (# 14), the serial start subroutine shown in FIG. 6 is executed. Hereinafter, the subroutine shown in FIG. 6 will be described.

ステップ(#100)では端子OP11を「L」にしてシリ
アルデータ交信の対象としてレンズ回路(7)を選ぶ。
ステップ(#11)では、レンズ内のROMに記憶されてい
る各種の8ビットのレンズデータ(開放絞り値、最小口
径絞り値、焦点距離、焦点調節用レンズ繰出変換係数
等)をCPU(1)内のRAMに取り込むための格納開始番地
をレジスタIXに入れる。ステップ(#102)では、取り
込むべきレンズデータの個数をレジスタIYに入れる。
Step a (# 100), the terminal OP 11 to "L" choose lenses circuit (7) as a target of serial data communication with.
In step (# 11), the CPU (1) stores various 8-bit lens data (open aperture value, minimum aperture value, focal length, lens adjustment conversion coefficient for focusing, etc.) stored in the ROM in the lens. In the register IX, the storage start address to be taken into the RAM in the RAM is entered. In step (# 102), the number of lens data to be captured is entered in the register IY.

ステップ(#103)では、端子OP5「H」にする。これ
により、アンドゲートが能動となるが、このときレンズ
回路(7)に対してシリアル転送用のクロックパルスSC
K1は供給されていない。
In step (# 103), to the terminal OP 5 "H". As a result, the AND gate becomes active. At this time, the clock pulse SC for serial transfer is supplied to the lens circuit (7).
K 1 is not supplied.

次に、ステップ(#104)でシリアル割込みを許可
し、ステップ(#105)でシリアル転送を開始する。つ
まり、端子SINを介して外部回路のデータをシリアルイ
ンターフェースSCI内のシリアルレジスタに取り込む
(但しOP5=H)か、または、端子SOUTを介してシリア
ルレジスタ内のデータを外部回路へ送る(但しOP5
H)か、あるいは、AF動作優先作用に待ち時間を作る
(但しOP5=L)ために、クロックパルス信号SCK1の出
力を開始する。そして、ステップ(#106)でリターン
し、第5図のフローに復帰する。
Next, a serial interrupt is permitted in step (# 104), and serial transfer is started in step (# 105). That is, the data of the external circuit is taken into the serial register in the serial interface SCI through the terminal SIN (however, OP 5 = H), or the data in the serial register is sent to the external circuit through the terminal SOUT (however, OP 5 =
H) or, alternatively, make latency AF operation priority action (except the OP 5 = L) for starts outputting the clock pulse signal SCK 1. Then, the process returns in step (# 106) and returns to the flow in FIG.

第5図に戻り、ステップ(#15)ではAF回路(2)中
のCCDの積分を開始させる。そしてステップ(#106)で
積分が完了するのを待ってから、ステップ(#17)でCP
U(1)内にCCDデータを取り込む。ステップ(#18)で
は取り込んだCCDデータに基づいてピントのずれている
量(デフォーカス量)と方向とを演算する。ステップ
(#19)ではデフォーカス量が合焦許容幅内にある(即
ち合焦)かどうかを判断し、合焦であればステップ(#
20)にすすみ第7図に示すリレーズ許可判定のサブルー
チンを実行する。合焦でなければステップ(#21)によ
って演算結果のピントずれ量と方向とに基づいて合焦位
置に向けてモータ(M2)を駆動する。
Returning to FIG. 5, in step (# 15), integration of the CCD in the AF circuit (2) is started. Then, after waiting for the completion of the integration in step (# 106), the CP in step (# 17)
Import CCD data into U (1). In step (# 18), the amount of defocus (amount of defocus) and the direction are calculated based on the captured CCD data. In step (# 19), it is determined whether or not the defocus amount is within the allowable focusing range (that is, focusing).
In step 20), the subroutine of the relay permission determination shown in FIG. 7 is executed. If not in focus, the motor (M 2 ) is driven toward the in-focus position based on the defocus amount and direction of the calculation result in step (# 21).

以下、第7図に示したサブルーチンについて説明す
る。
Hereinafter, the subroutine shown in FIG. 7 will be described.

ステップ(#50)では、測光フラグが0か1(第1表
に示したルーチンを最低一回はすべて行った)かを判断
する。0であれば第1表の全ルーチンの処理途中である
のでそのままリターンして第5図のフローに戻る。一
方、測光フラグが1であればステップ(#51)にすす
み、レリーズスイッチ(SW2)のONによるレリーズ割込
みを許可し、リターンする。即ち、第1表に示す各ルー
チンを最低1回行わないと、いくらレリーズスイッチ
(SW2)をONしてもシャッタレリーズはなされない。
In step (# 50), it is determined whether the photometry flag is 0 or 1 (all of the routines shown in Table 1 have been performed at least once). If it is 0, it means that all the routines in Table 1 are being processed, so that the routine returns and returns to the flow of FIG. On the other hand, if the photometric flag is 1 proceeds to step (# 51), to allow the release interruption by ON of the release switch (SW 2), the process returns. That is, unless each routine shown in Table 1 is performed at least once, the shutter is not released even if the release switch (SW 2 ) is turned on.

第5図に戻り、ステップ(#22)で撮影準備スイッチ
(SW1)がまだONのままであるかどうかを判定する。ON
のままであればステップ(#15)から(#21)までのAF
動作を繰返す。一方、OFFであればステップ(#23)に
進み、AF用モータ(M2)が駆動中であればモータ駆動を
停止させる。その後、第4図に示したステップ(#1)
へジャンプしてCPUスタンバイ状態となる。
Returning to FIG. 5, it determines whether it remains in the photographing preparation switch (SW 1) is still ON at step (# 22). ON
If it remains, AF from step (# 15) to (# 21)
Repeat the operation. On the other hand, if it is OFF, the process proceeds to step (# 23), and if the AF motor (M 2 ) is being driven, the motor drive is stopped. Thereafter, the step (# 1) shown in FIG.
Jump to CPU standby state.

この第5図に示したフローの動作中にシリアル割込み
がかかったとき割込処理について第8図から第13図およ
び第6図に基づいて説明する。
The interrupt processing when a serial interrupt occurs during the operation of the flow shown in FIG. 5 will be described with reference to FIGS. 8 to 13 and 6.

上記#105でのシリアルクロッSCK1が8個出力したこ
とによりシリアル割込みが発生すると、第8図に示すフ
ローが実行される。まず、ステップ(#110)で誤動作
防止のためにシリアル割込みを禁止し、ステップ(#11
1)でシリアルコードの値を判別して、第1表に示した
シリアルコードに対応する処理ルーチンを実行する。こ
こで、シリアルコードが0の場合、第9図に示すリード
レンズ処理を実行する。
When the serial interrupt occurs by serial black Tsu SCK 1 in step # 105 is eight outputs, the flow shown in FIG. 8 is executed. First, in step (# 110), the serial interrupt is prohibited to prevent malfunction, and in step (# 11)
In step 1), the value of the serial code is determined, and a processing routine corresponding to the serial code shown in Table 1 is executed. Here, when the serial code is 0, the read lens process shown in FIG. 9 is executed.

第9図のリードレンズ処理では、まずステップ(#12
0)で端子OP5が「L」か「H」かを判断し、「H」であ
ればステップ(#121)に進む。ステップ(#121)では
端子OP5を「L」に戻し、ステップ(#122)で第6図の
ステップ(104)へジャンプする。これによって、第5
図に示したメインルーチンの処理時間を確保している。
In the lead lens processing shown in FIG.
0) in the terminal OP 5 determines whether "L" or "H", the flow proceeds to step (# 121). If "H". Step back (# 121) in the terminal OP 5 to "L", and jumps to step step FIG. 6 with (# 122) (104). As a result, the fifth
The processing time of the main routine shown in the figure is secured.

一方、端子OP5が「L」であればステップ(#123)に
進み、レンズ回路(7)からシリアルレジスタに転送さ
れてきたレンズデータをレジスタIXによって指定される
RAMの番地に転送する。次に、ステップ(#124)でレジ
スタIXに次の番地を入れ(IXを1インクリメント)、ス
テップ(#125)でまだRAMに転送していないデータ数を
レジスタIYに入れる(IYを1ディクリメント)。
On the other hand, if the terminal OP 5 is "L", the flow proceeds to step (# 123), is designated the lens data transferred to the serial register from the lens circuit (7) by the register IX
Transfer to RAM address. Next, in step (# 124), the next address is entered into the register IX (IX is incremented by 1), and in step (# 125), the number of data not yet transferred to the RAM is entered into the register IY (IY is decremented by 1) ).

ステップ(#126)では、レジスタIYのデータ数が0
かどうか、すなわち、全てのレンズデータをRAMに転送
し終わったかどうかを判断する。レジスタIYのデータ数
が0でなければ、第6図のステップ(#103)へジャン
プして次のレンズデータの転送を続行する。レジスタIY
が0の場合、全てのレンズデータの転送が終了している
ので、ステップ(#128)で端子OP11を「H」にして、
レンズ回路(7)を指定することをやめ、今度はステッ
プ(#129)で端子OP12を「L」にして、フラッシュ回
路(8)を選択する。
In step (# 126), the number of data in the register IY is 0
It is determined whether or not all the lens data has been transferred to the RAM. If the number of data in the register IY is not 0, the process jumps to the step (# 103) in FIG. 6 to continue the transfer of the next lens data. Register IY
If it is 0, because the transfer of all the lens data has been completed, and the terminal OP 11 to "H" at step (# 128),
Stop specifying the lens circuit (7), this time in the "L" terminal OP 12 in step (# 129), selects a flash circuit (8).

ステップ(#130)では、フラッシュ回路(8)内に
記憶されているフラッシュデータ(ガイドナンバー情
報、充電完了情報、調光確認情報等)をCPU(1)のRM
に格納するための番地をレジスタIXに入れる。ステップ
(#131)では、フラシュデータの個数をレジスタIYに
入れる。ステップ(#132)では、シリアルコードに1
を入れ、第6図のステップ(#103)にジャンプしてフ
ラッシュデータのCPU(1)へのシリアル転送を開始す
る。
In step (# 130), the flash data (guide number information, charging completion information, dimming confirmation information, etc.) stored in the flash circuit (8) is stored in the RM of the CPU (1).
Into the register IX. In step (# 131), the number of flash data is stored in the register IY. In step (# 132), the serial code
And jumps to the step (# 103) in FIG. 6 to start the serial transfer of flash data to the CPU (1).

シリアルコードが1の場合、第10図に示すリードフラ
ッシュ処理を実行する。まず、ステップ(#140)で端
子OP5が「L」か「H」かを判断し、「H」であれば第
9図のステップ(#121)へジャンプする。
When the serial code is 1, the read flash processing shown in FIG. 10 is executed. First, step (# 140) at the terminal OP 5 determines whether "L" or "H", and jumps to step ninth diagram If "H"(# 121).

一方、ステップ(#140)での判断が「L」の場合、
ステップ(#142)でレジスタIXによって指定されるRAM
の番地に、シリアルレジスタに入っているフラッシュデ
ータを転送する。その後、ステップ(#143)でレジス
タIXをインクリメントし、ステップ(#144)でレジス
タIYをディクリメントする。
On the other hand, if the judgment in step (# 140) is "L",
RAM specified by register IX in step (# 142)
The flash data stored in the serial register is transferred to the address. Thereafter, the register IX is incremented in step (# 143), and the register IY is decremented in step (# 144).

次に、ステップ(#145)でレジスタIYのデータが0
かどうかを判断し、0でなければ第6図のステップ(#
103)へジャンプして次のフラッシュデータの転送を続
行する。ステップ(#145)での判断が0の場合、全て
のフラッシュデータの転送が終了したのでステップ(#
148)で端子OP12を「H」にしてフラッシュ回路(8)
を選択することをやめ、今度はステップ(#147)で端
子OP14を「L」にして測光回路(5)を選択する。
Next, in step (# 145), the data of the register IY is set to 0.
It is determined whether or not it is not 0.
Jump to 103) to continue the transfer of the next flash data. If the determination in step (# 145) is 0, the transfer of all the flash data has been completed, so step (# 145)
148) Set the terminal OP 12 to “H” to set the flash circuit (8)
Quit that you select, this time to select the metering circuit (5) in the "L" terminal OP 14 in the step (# 147).

ステップ(#149)では、測光データをRAM内に格納す
るための番地をレジスタIXに入れ、ステップ(#150)
で測光データの個数をレジスタIYに入れる。次に、ステ
ップ(#151)でシリアルコードに2を入れ、第6図の
ステップ(#103)へジャンプして測光データのCPU
(1)へのシリアル転送を開始する。
In step (# 149), the address for storing the photometric data in the RAM is entered in the register IX, and the step (# 150)
Use to enter the number of photometric data into register IY. Next, in step (# 151), 2 is entered into the serial code, and the process jumps to step (# 103) in FIG.
Start serial transfer to (1).

シリアルコードが2の場合、第11図に示すリード測光
処理を実行する。まず、ステップ(#160)で端子OP5
「L」か「H」かを判断し、「H」であれば第9図のス
テップ(#121)へジャンプする。
When the serial code is 2, the lead photometry process shown in FIG. 11 is executed. First, step (# 160) at the terminal OP 5 determines whether "L" or "H", and jumps to step ninth diagram If "H"(# 121).

ステップ(#160)での判断が「L」の場合、ステッ
プ(#164)でレジスタIXによって指定されるRAM中の番
地にシリアルレジスタに入っているデータを転送する。
そして、ステップ(#165)でレジスタIXをインクリメ
ントし、ステップ(#166)でレジスタIYをディクリメ
ントする。次に、ステップ(#167)でレジスタIYのデ
ータが0かどうかを判断し、0でなければ第6図のステ
ップ(#103)へジャンプして次の測光データのシリア
ル転送を続行する。
If the determination in step (# 160) is "L", in step (# 164), the data stored in the serial register is transferred to the address in the RAM specified by the register IX.
Then, the register IX is incremented in step (# 165), and the register IY is decremented in step (# 166). Next, in step (# 167), it is determined whether the data in the register IY is 0. If not, the process jumps to step (# 103) in FIG. 6 to continue the serial transfer of the next photometric data.

ステップ(#167)での判断が0の場合、ステップ
(#169)で端子OP14を「H」にして測光回路(5)を
選択することをやめる。
Step For the determination in (# 167) 0, stop selecting a photometric circuit (5) to the terminal OP 14 to "H" at step (# 169).

ステップ(#170)では、RAM内に格納された測光デー
タや端子IPA,IPBから入力された情報に基づいて、露出
演算を行い、絞り値やシャッタースピードなど決定を行
う。演算結果はRAM内に格納する。
In step (# 170), exposure calculation is performed based on the photometric data stored in the RAM and the information input from the terminals IPA and IPB, and the aperture value, shutter speed, and the like are determined. The calculation result is stored in the RAM.

次に、ステップ(#171)で端子OP12を「L」にして
フラッシュ回路(8)を選択し、ステップ(#172)で
端子OP10を「L」にしてCPU(1)からフラッシュ回路
(8)への送信が選択される。
Next, step (# 171) to select the flash circuit (8) to the terminal OP 12 to "L", the step (# 172) in the flash circuit terminals OP 10 from CPU (1) in the "L" ( 8) Transmission is selected.

ステップ(#173)では、フラッシュ回路(8)に転
送すべきデータ(例えば演算絞り値や焦点距離等)が格
納されているRAMの番地をレジスタIXに入れる。ステッ
プ(#174)では、フラッシュ回路(8)に転送すべき
データの個数をレジスタIYに入れる。ステップ(#17
5)では、シリアルコードに3を入れ、第6図のステッ
プ(#103)へジャンプしてフラッシュデータのフラッ
シュ回路(8)への転送を開始する。
In step (# 173), the address of the RAM storing the data to be transferred to the flash circuit (8) (for example, the aperture value and the focal length) is stored in the register IX. In step (# 174), the number of data to be transferred to the flash circuit (8) is entered in the register IY. Step (# 17
In 5), 3 is added to the serial code, and the process jumps to step (# 103) in FIG. 6 to start transferring flash data to the flash circuit (8).

シリアルコードが3の場合、第12図に示すライトフラ
ッシュ処理を実行する。まず、ステップ(#180)で端
子OP5が「L」か「H」かを判断し、「H」であればス
テップ(#181)に進み、「L」であればステップ(#1
85)に進む。
When the serial code is 3, the write flash processing shown in FIG. 12 is executed. First, step (# 180) at the terminal OP 5 determines whether "L" or "H", if the "H", the flow proceeds to step (# 181), if the "L" Step (# 1
Go to 85).

ステップ(#181)ではRAM上の番地IXにあるデータを
シリアルレジスタに転送する。そして、ステップ(#18
2)でレジスタIXをインクリメントするステップ(#18
3)では、端子OP5を「L」にし、第6図のステップ(#
104)へジャンプする。一方、ステップ(#180)での判
断が「L」の場合、ステップ(#185)ではレジスタIY
をディクリメントする。ステップ(#186)ではレジス
タIYのデータが0かどうかを判断し、0でなければ第6
図のステップ(#103)へジャンプして次のフラッシュ
データの転送を続行する。
In step (# 181), the data at the address IX on the RAM is transferred to the serial register. Then, step (# 18
Step of incrementing register IX in 2) (# 18)
In 3), the terminal OP 5 to "L", the steps of FIG. 6 (#
Jump to 104). On the other hand, if the judgment in step (# 180) is "L", in step (# 185) the register IY
Is decremented. In the step (# 186), it is determined whether or not the data of the register IY is 0.
The process jumps to the step (# 103) in the figure to continue the transfer of the next flash data.

ステップ(#186)での判断が0の場合、フラッシュ
回路(8)への全データの転送が終了しているのでステ
ップ(#188)で端子OP10を「H」にし、ステップ(#1
89)では端子OP12を「H」にし、ステップ(#190)で
は端子OP13を「L」にする。これによってフラッシュ回
路(8)にデータを転送する処理を終え、表示回路
(6)を選択する。
Step For the determination in (# 186) 0, the terminal OP 10 to "H" in so all the data to the flash circuit (8) transfer is completed step (# 188), the step (# 1
89) In the terminal OP 12 to "H", the step (# 190), the terminal OP 13 to "L". This completes the process of transferring data to the flash circuit (8), and selects the display circuit (6).

次にステップ(#191)では表示回路(6)に転送す
べき表示データが格納されているRAMk番地をレジスタIX
に入れるか。そして、ステップ(#192)でデータの個
数をレジスタIYに入れ、ステップ(#193)でシリアル
コードに4を入れ、第6図のステップ(#103)へジャ
ンプする。
Next, in step (# 191), the RAMk address storing the display data to be transferred to the display circuit (6) is stored in the register IX.
Do you put in Then, in step (# 192), the number of data is entered into the register IY, and in step (# 193), 4 is entered in the serial code, and the process jumps to step (# 103) in FIG.

シリアルコードが4の場合、第13図に示すライト表示
処理を実行する。まずステップ(#200)で端子がOP5
「L」か「H」かを判断し、「H」であれば第12図のス
テップ(#181)へジャンプする。ステップ(#200)で
の判断が「L」のとき、ステップ(#202)でレジスタI
Yをディクリメントする。そして、ステップ(#203)で
レジスタIYのデータが0かどうかを判断し、0でなけれ
ばステップ(#204)で第6図のステップ(#103)へジ
ャンプして次の表示データの転送を続行する。
When the serial code is 4, the light display processing shown in FIG. 13 is executed. First Step pin (# 200) OP 5, it is determined whether "L" or "H", and jumps to step Figure 12, if "H"(# 181). When the judgment at step (# 200) is "L", the register I is set at step (# 202).
Decrement Y. Then, in step (# 203), it is determined whether or not the data in the register IY is 0. If not, the process jumps to step (# 103) in FIG. 6 in step (# 204) to transfer the next display data. continue.

一方、ステップ(#203)での判断が0の場合、ステ
ップ(#205)で端子O13を「H」にして表示回路を選択
することをやめ、ステップ(#206)でシリアルコード
に0を入れる。そして、ステップ(#207)で測光フラ
グに1を入れ、第6図のステップ(#100)へジャンプ
する。
On the other hand, the step when the judgment is 0 in (# 203), quit selecting a display circuit in the "H" terminal O 13 in step (# 205), the 0 to the serial code in step (# 206) Put in. Then, at step (# 207), 1 is set to the photometry flag, and the routine jumps to step (# 100) in FIG.

以上でシリアル割込みについての説明を終わる。 This concludes the description of the serial interrupt.

第5図に示したフローが実行されており、ステップ
(#20)内でレリーズ許可が出ているときに、リレーズ
スイッチ(SW2)がONされると、レリーズ割込みが発生
し、第14図に示すフローが実行される。まずステップ
(#300)でOP1を「H」にし、レリーズマグネット(RM
g)によってミラーアップや絞り込み動作を開始させ
る。
If the relay switch (SW 2 ) is turned on while the release permission is issued in step (# 20) while the flow shown in FIG. 5 is being executed, a release interrupt occurs, and FIG. Is executed. First, in step (# 300), OP 1 is set to “H”, and the release magnet (RM
g) to start the mirror-up or aperture operation.

ステップ(#306)では絞りエンコーダスイッチ(S
W3)のON,OFFによるパルス数をカウントし、このカウン
ト値が第11図のステップ(#170)の露出演算で算出し
た絞り値に対応する値になるのを待ち、ステップ(#30
7)で端子OP2を「H」にし、絞りストップマグネット
(FMg)によって絞りを演算結果どおりに固定する。ス
テップ(#308)では、アップしたミラーや固定された
絞りが安定するまでの時間(ΔT2)を待つ。
In step (# 306), the aperture encoder switch (S
The number of pulses by ON / OFF of W 3 ) is counted, and it is waited that the counted value becomes a value corresponding to the aperture value calculated by the exposure calculation in step (# 170) in FIG.
At 7), the terminal OP 2 is set to “H”, and the aperture is fixed according to the calculation result by the aperture stop magnet (FMg). In step (# 308), the process waits for the time (ΔT 2 ) until the raised mirror or the fixed aperture stabilizes.

ステップ(#309)では、端子OP3を「H」にして、ま
ずシャッター先幕を走行させる。そして、ステップ(#
310)でシャッター速度に対応するシャッター開放時間
だけ待ってから、ステップ(#311)で端子OP4を「H」
にしてシャッター後幕を走行させて露出を終了させる。
In step (# 309), and the terminal OP 3 to "H", is first run the shutter front curtain. And the step (#
After waiting for the shutter opening time corresponding to the shutter speed in 310), the terminal OP 4 is set to “H” in step (# 311).
And the exposure is completed by running the rear curtain of the shutter.

その後、ステップ(#322)でモータ(M1)を駆動し
て、巻上げやシャッターチャージなどを行い、ステップ
(#323)で巻上状態検出スイッチ(SW4)がOFFするの
を待ってから、ステップ(#324)でモータ(M1)の駆
動を停止する。
Then, after driving the motor (M 1), winding etc. is performed and shutter charge, step winding state detecting switch (# 323) (SW 4) is waiting to OFF in step (# 322), in step (# 324) stops driving the motor (M 1).

ステップ(#325)では、端子OP1から端子OP4
「L」にし、第5図のステップ(#10)へジャンプす
る。
In step (# 325), from the terminal OP 1 terminal OP 4 to "L", and jumps to step (# 10) of FIG. 5.

効果 上述のように、本発明によれば、メインルーチンがシ
リアル交信用クロックの送出開始を指令してから、1バ
イト分のクロックが送出されるまでをシリアルインター
フェースに分担させ、その期間メインルーチンは所定の
処理を続行するようにしたので、CPU全体としての処理
時間の短縮が図れると共に、従来のような待機時間を計
数するタイマが不要となりCPUの利用効率の向上が図れ
る。
Effects As described above, according to the present invention, the serial interface is assigned the time from when the main routine instructs the start of transmission of the serial communication clock to when the clock for one byte is transmitted, and during this period, the main routine is executed. Since the predetermined processing is continued, the processing time of the entire CPU can be reduced, and a conventional timer for counting the standby time is not required, so that the utilization efficiency of the CPU can be improved.

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

第1図は本発明の一実施例の全体回路構成を示すブロッ
ク図、第2図はその要部の構成を示す回路図、第3図は
第2図の構成の作動を示すタイムチャート、第4図ない
し第14図は第1図のCPUの動作を示すフローチャートで
ある。 1:CPU SCI:シリアルインターフェース #10〜#23:メインルーチン #110〜#111:割込みルーチン
FIG. 1 is a block diagram showing the overall circuit configuration of an embodiment of the present invention, FIG. 2 is a circuit diagram showing the configuration of a main part thereof, FIG. 3 is a time chart showing the operation of the configuration of FIG. FIGS. 4 to 14 are flowcharts showing the operation of the CPU of FIG. 1: CPU SCI: Serial interface # 10 to # 23: Main routine # 110 to # 111: Interrupt routine

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】所定の処理を行うと共に外部装置との間で
データ交信を行うCPUにおいて、メインルーチンからの
指令に応答して作動して上記データ交信をシリアルで行
うためのシリアル交信用クロックを出力するクロック出
力部及びデータのシリアル交信に要する数だけ上記シリ
アル交信用クロックが出力されると割込み要求を発生す
る割込み発生部を含みデータのシリアル交信をハード的
に行うシリアルインターフェースと、上記割込み要求に
応答して上記シリアル交信用クロックの出力を停止する
と共にデータ交信の割込み処理を行う割込みルーチンと
を備え、データ交信を上記シリアルインターフェース及
び割込みルーチンにより行わせるようにしたことを特徴
とするCPUのデータ交信方式。
A CPU for performing predetermined processing and performing data communication with an external device operates in response to a command from a main routine to generate a serial communication clock for performing the data communication serially. A serial interface that includes a clock output unit to output and an interrupt generation unit that generates an interrupt request when the serial communication clocks are output by the number required for serial communication of data; An interrupt routine for stopping the output of the serial communication clock in response to the interrupt and performing an interrupt process for data communication, wherein the data communication is performed by the serial interface and the interrupt routine. Data communication method.
JP1220971A 1989-08-28 1989-08-28 CPU data communication processing method Expired - Lifetime JP2621500B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1220971A JP2621500B2 (en) 1989-08-28 1989-08-28 CPU data communication processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1220971A JP2621500B2 (en) 1989-08-28 1989-08-28 CPU data communication processing method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP13129188A Division JPH01300346A (en) 1988-05-27 1988-05-27 Cpu for camera

Publications (2)

Publication Number Publication Date
JPH02160225A JPH02160225A (en) 1990-06-20
JP2621500B2 true JP2621500B2 (en) 1997-06-18

Family

ID=16759433

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1220971A Expired - Lifetime JP2621500B2 (en) 1989-08-28 1989-08-28 CPU data communication processing method

Country Status (1)

Country Link
JP (1) JP2621500B2 (en)

Also Published As

Publication number Publication date
JPH02160225A (en) 1990-06-20

Similar Documents

Publication Publication Date Title
US20130050510A1 (en) Image capture apparatus, accessory and image capture system
JP3658084B2 (en) Camera and interchangeable lens
JP2791667B2 (en) Photographic lens, camera body, and single-lens reflex camera system
JP3836685B2 (en) Communication system for interchangeable lens camera
JP2971924B2 (en) Camera system
JPH0229636A (en) Automatic focusing camera
JP2933341B2 (en) Camera lens storage return device
JPH0610726B2 (en) camera
JPH0875991A (en) Autofocusing camera
JPH049910A (en) Camera system
JP2621500B2 (en) CPU data communication processing method
JP2794631B2 (en) Camera with power zoom function and interchangeable camera and interchangeable lens with power zoom function
JP2915989B2 (en) Camera system
US6128443A (en) Camera and interchangeable lens
JP2966416B2 (en) Data communication method between microcomputers
JP3272477B2 (en) Camera with zoom device during step exposure
JP2605012B2 (en) Camera control device
JP2942305B2 (en) Camera system and shooting lens
JPH0690352B2 (en) Camera autofocus adjuster
JPH01300346A (en) Cpu for camera
JP2829920B2 (en) Cameras and interchangeable lenses with interchangeable lenses
JP2962785B2 (en) Camera with self-timer function
JP2880759B2 (en) Camera system and shooting lens
JPH05150301A (en) Flash communicating method of camera
JPH061291B2 (en) Camera autofocus adjuster

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080404

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20090404

Year of fee payment: 12

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090404

Year of fee payment: 12