JPS6095635A - Timer interruption processing method in microcomputer - Google Patents

Timer interruption processing method in microcomputer

Info

Publication number
JPS6095635A
JPS6095635A JP58201059A JP20105983A JPS6095635A JP S6095635 A JPS6095635 A JP S6095635A JP 58201059 A JP58201059 A JP 58201059A JP 20105983 A JP20105983 A JP 20105983A JP S6095635 A JPS6095635 A JP S6095635A
Authority
JP
Japan
Prior art keywords
timer
counter
pulse
timer interrupt
interrupt
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP58201059A
Other languages
Japanese (ja)
Inventor
Atsushi Taneda
淳 種田
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.)
Ricoh Elemex Corp
Ricoh Co Ltd
Original Assignee
Ricoh Elemex Corp
Ricoh Co Ltd
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 Ricoh Elemex Corp, Ricoh Co Ltd filed Critical Ricoh Elemex Corp
Priority to JP58201059A priority Critical patent/JPS6095635A/en
Priority to DE19843439560 priority patent/DE3439560A1/en
Publication of JPS6095635A publication Critical patent/JPS6095635A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To generate a timer interruption at an exact time interval by generating a timer interruption when a counter for counting a pulse of a constant period has overflowed. CONSTITUTION:A clock pulse outputted at a prescribed time interval from a pulse generating means A is counted by a pulse counting means B, and when this pulse counting means B is brought to increment to zero from the maximum count number, unless an external interruption is applied to a timer interruption generating means C, a timer interruption is generated immediately, and if the external interruption is applied, the timer interruption is generated when its external interruption is ended. An initial value calculating means E reads out a count value in that case, transfers it to an initial value setting means F, and corrects a count value of the pulse count means B. Accordingly, even in case the timer interruption is delayed, a delay time portion is corrected, and the timer interruption can be generated at an exact time interval.

Description

【発明の詳細な説明】 共術分野 この発明は、マイクロコンピュータ(以下「マイコン」
と称す)におけるタイマ割込み処理方法に関する。
[Detailed Description of the Invention] This invention relates to a microcomputer (hereinafter referred to as a "microcomputer").
This invention relates to a timer interrupt processing method in

K釆皮比 一般に、プリンタ、コピア、パーソナルコンピュータ、
フロッピディスク装置等の各種のシステムの制御部とし
てマイコンが使用されている。
Generally, printers, copiers, personal computers,
Microcomputers are used as control units for various systems such as floppy disk devices.

従来、このようなマイコンとして、例えは一定周期のパ
ルスを設定された初期値からカラン1−するカウンタか
オーバフローしたときにタイマ割込みを発生ずると共に
、外部割込み中に前記タイマ割込みか発生したときには
前記外部割込み処理を終了した後タイマ割込み処理をす
るようにしたものがある(例えばインテル社製のMC3
−48フアミリーフ。
Conventionally, such a microcontroller generates a timer interrupt when a counter overflows from a set initial value with pulses of a constant period, and also generates a timer interrupt when the timer interrupt occurs during an external interrupt. There are some devices that perform timer interrupt processing after finishing external interrupt processing (for example, Intel's MC3).
-48 Family Reef.

このマイコンにあっては、外部割込み処理中にタイマ割
込みが発生した場合、外部割込み処理が優先するため、
タイマ割込み処理で行なうカウン夕の初期値の設定が遅
JL、タイマ割込みの周期かすれる。
In this microcontroller, if a timer interrupt occurs during external interrupt processing, the external interrupt processing takes priority.
The initial value of the counter set in the timer interrupt process is slow, and the timer interrupt cycle is short.

ところで1例えばプリンタを制御する場合に、キャリッ
ジを駆動するスペータモータ、活字ホイールを駆動する
セレクションモータ等の回転に同期して発生されるエン
コーダからの信号を外部割込みに入力して、モータスピ
ードを制御すると共に、一定時間毎にタイマ割込みを発
生させ、そのタイマ割込みの発生回数を計数して所定時
間毎にリボンドライブ、ラインフィー)〜あるいはダブ
ル活字ホイール使用時のホイールシフ1−等の1(ライ
ブ制御をする場合がある。
By the way, 1. For example, when controlling a printer, a signal from an encoder generated in synchronization with the rotation of a spacer motor that drives a carriage, a selection motor that drives a type wheel, etc. is input to an external interrupt to control the motor speed. At the same time, a timer interrupt is generated at regular intervals, and the number of occurrences of the timer interrupt is counted, and the number of occurrences of the timer interrupt is counted and the number of times the timer interrupt is generated is determined at regular intervals. There may be cases where

この場合、例えばキャリッジリターンとラインフィー1
・あるいはセレクションとリボンフィー1−及びホイー
ルシフI・は動作が競合することかある。
In this case, for example, carriage return and line fee 1
-Or, selection, ribbon fee 1-, and wheel shift I- may conflict in operation.

ところが、このときマイコンは外部割込み処理中にタイ
マ割込みか発生しても外部割込みの終了を待ってタイマ
割込み処理をするので、タイマ割込みの発生から外部割
込みの終了までの時間分たけ次のタイマ割込みの発生が
遅れる。
However, at this time, even if a timer interrupt occurs during external interrupt processing, the microcontroller waits for the end of the external interrupt before processing the timer interrupt. The occurrence of is delayed.

そのため、ドライブパルスの出力も遅くなり、正補1な
タイムシーケンス制御ができなくなるという問題が生じ
る。
As a result, the output of the drive pulse is also delayed, causing a problem that time sequence control with corrective correction 1 cannot be performed.

目 白り この発明は上記の点に鑑みてなされたものであり、」二
連のようなマイコンにおいて、正確な時間間隔でタイマ
割込みを発生できるようにすることを目的とする。
This invention has been made in view of the above points, and it is an object of this invention to enable timer interrupts to be generated at accurate time intervals in a microcomputer such as a dual-unit microcomputer.

講倣J匹些」4俄 以下、この発明の構成を一実施例に基ついて説明する。Lecture "J pet" 4 yen Hereinafter, the configuration of the present invention will be explained based on one embodiment.

。 まず、第1図を参照して、この発明によるタイマ割込み
処理方法を簡単に説明する。
. First, a timer interrupt processing method according to the present invention will be briefly explained with reference to FIG.

このマイコンは、パルス発生手段Δから一定の時間間隔
で出力されるタロツクパルスをパルスカウント手段Bで
カウントし、このパルスカラン1一手段Bが最大力ラン
1〜数からゼロにインクリメン(・されたとき、すなわ
ちオーバフローしたときに、タイマ割込み発生手段Cが
、外部割込みがかかつていなけれは直ちにタイマ割込み
を発生し、外部割込みがかかつていれば、その外部割込
みか終了したときにタイマ割込みを発生する。
This microcomputer counts the tarok pulses outputted from the pulse generating means Δ at fixed time intervals using the pulse counting means B, and when the pulse count means B is incremented from the maximum force run 1 to the maximum force run number to zero, That is, when an overflow occurs, the timer interrupt generating means C immediately generates a timer interrupt if no external interrupt is applied, and if an external interrupt is applied, generates a timer interrupt when the external interrupt ends. .

このタイマ割込み発生手段Cがタイマ割込みを発生する
と、タイマ割込み処理手段りは所定のタイマ割込み処理
1例えばプリンタの各種のドライブ制御をし、その処理
が終了したときに、初期値算出手段Eにその旨を伝達す
る。
When the timer interrupt generation means C generates a timer interrupt, the timer interrupt processing means performs a predetermined timer interrupt processing 1, for example, various drive controls of a printer, and when the processing is completed, the initial value calculation means E Communicate the purpose.

それによって、初期値算出手段Eは、パルスカラン1一
手段Bのその時のカラン1へ値を読出して。
Thereby, the initial value calculation means E reads out the value to the current pulse run 1 of the pulse run 1 and the run 1 of the means B.

このカウント値に基づいて初期値又は予め定めた初期値
に対する偏差値を算出して初期値設定手段Fに転送する
Based on this count value, a deviation value from the initial value or a predetermined initial value is calculated and transferred to the initial value setting means F.

この初期値設定手段Fは、初期値算出手段Eから転送さ
れた初期値をそのまま、あるいは所定の初期値に偏差値
を加えた初期値をパルスカウント手段Bに設定する。
The initial value setting means F sets the initial value transferred from the initial value calculating means E as it is, or sets an initial value obtained by adding a deviation value to a predetermined initial value in the pulse counting means B.

このように、パルスカウント手段Bの初期値を設定する
ときに、そのときのパルスカウント手段Bのカラン1−
値に応した初期値を補正設定する。
In this way, when setting the initial value of the pulse counting means B, the current value of the pulse counting means B is
Correct and set the initial value according to the value.

したがって、タイマ割込みが外部割込み処理中に発生し
たためにタイマ割込み処理が遅、■シた場合でも、その
遅九時間に相当するカラン1−値分を補正して初]υj
値を設定するので、正11丁「な時間間隔てタイマ割込
みを発生させることができる。
Therefore, even if the timer interrupt processing is delayed due to a timer interrupt occurring during external interrupt processing, the timer interrupt processing is delayed by the amount corresponding to the 9 hours of delay]υj
Since the value is set, timer interrupts can be generated at regular time intervals.

第2図及び第6図は、この発明を実施した活字ホイール
型インバクl−プリンタの外観を示す斜視図及びその外
筐部の分解斜視図である。
FIG. 2 and FIG. 6 are a perspective view showing the external appearance of a type wheel type Invakl-printer embodying the present invention, and an exploded perspective view of the outer casing thereof.

このプリンタの外筐部は、印字機構部及び印字制御部を
収納する本体ケース1と、カバー2及びj戊板乙とによ
って構成されている。
The outer casing of this printer includes a main body case 1 that houses a printing mechanism and a printing control section, a cover 2, and a cover plate.

第[1は、このプリンタの印字Pa IW部を示す平面
図である。
1 is a plan view showing the printing Pa IW section of this printer.

この印字践溝部は、まず、フレーム10に印字する用紙
を巻イ」けて給送するプラテン11を回転自在に取付け
である。
In this printing groove section, first, a platen 11 for winding and feeding paper to be printed on a frame 10 is rotatably attached.

このプラテン11は、フレーt110に固着した用紙給
送モータ(ラインフィートモータ)121Cよってギア
列1ろを介して駆!IIされて、白1すj的1こ用紙を
給送する。
This platen 11 is driven by a paper feed motor (line foot motor) 121C fixed to the frame t110 through a gear train 1! 2 and feeds the white paper.

また、このプラテン11は1両端部にツノ14゜15を
固着してあり、用紙装填時や用紙抜き取り時には、この
ノブ14.15を回すことによって手動で回転できる。
Further, the platen 11 has horns 14 and 15 fixed to both ends thereof, and can be manually rotated by turning the knobs 14 and 15 when loading or removing paper.

なお、このプラテン1丁の前方には、用紙を表面に押し
付けるための2個のローラ16.16を回転自在に嵌挿
した用紙押え17を設けて、その日−ラ1G、1Gを抑
圧接触させている。
In addition, in front of this single platen, there is provided a paper presser 17 in which two rollers 16 and 16 for pressing the paper against the surface are rotatably inserted, and on that day, the paper presser 17 is brought into pressure contact with the rollers 1G and 1G. There is.

そして、フレーム10に固着したロット18及びステー
1S上に、キャリッジ21をプラテン11に刻し・てそ
の軸方向に平行移動可能に載置している。
A carriage 21 is mounted on the rod 18 and the stay 1S fixed to the frame 10 so as to be movable in parallel in the axial direction of the platen 11.

このキャリッジ21は、活字ホイール26を力セラ1へ
ケース24に収納してなるカセツI−ホイール22と、
活字ホイール23を活字を叩く印字ハンマ25と、活字
ホイール26を回転駆動するセレクションモータ26及
びこのセレクションモータ26の回転位置を検出するエ
ンコータ (セレクションセンサ)27等を備えている
が、その詳細は後述する。
This carriage 21 includes a cassette I-wheel 22 in which a type wheel 26 is housed in a case 24, and
It is equipped with a printing hammer 25 that hits the type wheel 23, a selection motor 26 that rotates the type wheel 26, an encoder (selection sensor) 27 that detects the rotational position of the selection motor 26, and the details thereof will be described later. do.

そして、このキャリッジ21は、フレーム10に装着さ
れ、回転位置を検出するエンコープ(スペースセンサ)
29を取付けたモータ(スペースモータ)28によって
、その回転軸に固着したり・rミンクプーリ60及びフ
レーム10に回転自在に固定した4個のプーリ61〜3
4に張装して、キャリッジ21の下部に固定したスペー
スワイヤ65を介して移動される。
This carriage 21 is equipped with an encoder (space sensor) that is attached to the frame 10 and detects the rotational position.
29 is attached to the motor (space motor) 28, the four pulleys 61 to 3 are fixed to the rotating shaft thereof, and are rotatably fixed to the mink pulley 60 and the frame 10.
4 and is moved via a space wire 65 fixed to the lower part of the carriage 21.

この印字機構部におけるカセットホイール22のdTf
、lllを第5図乃至第7図を参照して説明する。
dTf of the cassette wheel 22 in this printing mechanism section
, lll will be explained with reference to FIGS. 5 to 7.

このカセツ1−ホイールは22は、第5121及び第6
図に示すように、活字ホイール2乙を不透明体からなる
カセツ1−ケース24内に収納してなる。
This cassette 1-wheel 22 is the 5121st and the 6th wheel.
As shown in the figure, a type wheel 2B is housed in a cassette 1-case 24 made of an opaque material.

その活字ホイール26は、第5図乃至第7図に示すよう
に、裏側に後述するセレクションモータ26の前歯屯に
晒み合う前歯40を形成した中央ボス部41に、放射状
に枚数のスポーク42を延設し、このスポーク42の先
端に活字46を担持してなる。
As shown in FIGS. 5 to 7, the type wheel 26 has a central boss portion 41 formed with front teeth 40 that meet the front teeth of a selection motor 26 (described later) on the back side, and a number of spokes 42 radially arranged thereon. The spokes 42 have printed characters 46 at their tips.

そして、この活字ホイール2ろの中央ボス部41のプラ
テン側(表側)の周面には、第7図に示すように、同一
円周上にホーム位置識別標識とである反射板からなるマ
ーク45及びホイール種別識別fM識である反射板から
なるマーク4Sを(=1設している。
As shown in FIG. 7, on the peripheral surface of the central boss portion 41 of the type wheel 2 on the platen side (front side), there is a mark 45 made of a reflective plate on the same circumference as a home position identification mark. and a mark 4S made of a reflective plate for wheel type identification fM (=1).

なお、マーク45はマーク46よりも活字ホイール23
の回転方向の幅を広く形成してあり、またマーク45と
マーク46との間隔は活字ホイールの種類に応じて予め
定めている。
Note that the mark 45 is closer to the type wheel 23 than the mark 46.
The width in the rotational direction is wide, and the distance between the marks 45 and 46 is predetermined depending on the type of type wheel.

一方、カセッ1−ケース24には、第5図に示すように
、この活字ホイール26に付設したマーク45及び46
の半径方向位置に対応して切欠部24、を形成している
On the other hand, as shown in FIG.
A notch 24 is formed corresponding to the radial position.

次に、この印字機構部におけるキャリッジ21の詳細を
第8図乃至第10図を参照して説明する。
Next, details of the carriage 21 in this printing mechanism section will be explained with reference to FIGS. 8 to 10.

なお、これ等の各図では1図示の都合上相互に部品の一
部の図示を省略している。
Note that in each of these figures, some parts are omitted for the sake of illustrating only one figure.

まず、キャリッジ21のカセツ1へ支持フレーム51は
、第10図に示すようにロット18が貫通する筒状の軸
受部52と、その軸受部52から延びるフレーム部S6
とからなる。
First, as shown in FIG. 10, the support frame 51 for the cassette 1 of the carriage 21 has a cylindrical bearing part 52 through which the rod 18 passes, and a frame part S6 extending from the bearing part 52.
It consists of

そして、このカセット支持フレー1151のフレーム部
53には、その中間両側にそIしぞJしねじ孔53aを
設けてあり、それらのねじ孔5ろaに力セラ1−ボイー
ル22(第5図参照)を装填する力セラ1−ホルダ54
をねし止めて取イζ」けている。
The frame portion 53 of the cassette support frame 1151 is provided with threaded holes 53a on both sides of the middle, and the screw holes 5a are inserted into the force cellar 1-boil 22 (see Fig. 5). (See) Force cellar 1-holder 54 for loading
I stopped it and removed it.

また、このフレーム部53には、ねじ孔5乙aのそれぞ
れ少し上に別のねじ孔561)を設けてあり、そ九等の
ねし孔5ろbにハンマブラケット55をねし止めで取イ
KJけ、活字ホイール2ろの活字46を叩(印字ハンマ
25を装着している。
Further, this frame portion 53 is provided with another screw hole 561) slightly above each of the screw holes 5Oa, and the hammer bracket 55 is attached to the screw hole 5B with a screw. KJ, hit the type 46 on type wheel 2 (print hammer 25 is attached).

一方、このカセット支持フレーム51の軸受部52には
、第8図及び第9図に示すように略中央部にスペースワ
イヤ35を固定するためのフック52bを形成すると共
に、両端にそれぞれ樹脂製のキャップ56を嵌着してあ
り、それらのキャップ56」二にキャリアフレー115
7の01j方下端を載置している。
On the other hand, as shown in FIGS. 8 and 9, the bearing portion 52 of the cassette support frame 51 is provided with a hook 52b approximately in the center for fixing the space wire 35, and a hook 52b made of resin is formed at both ends. The caps 56 are fitted on the carrier frame 115.
The lower end of 7 on the 01j side is placed.

このキャリアフレーム57は、1戊部フレーム58、側
部フレーム5B及び後部フレーム60からなり、その後
部フレーム60にステー19」二に載置されてステー1
S上を転がるローラ61を回転自在に取り付けている。
This carrier frame 57 consists of a corner frame 58, a side frame 5B, and a rear frame 60, and the stay 19 is placed on the rear frame 60 and the stay 19 is placed on the rear frame 60.
A roller 61 that rolls on S is rotatably attached.

また、キャリアフレーム57の側部フレーム5日には、
それぞれ前方上方にロッド18を中心とする円弧孔59
aをg設し、この円弧孔59aとカセット支持フレーム
51のフレーム部53の先端に穿設した貫通孔53c及
びモータブラケット6乙の両側に穿設した連結孔63a
とを合わせて、1本の連結軸64で連結している。
Furthermore, on the 5th day of the side frame of the carrier frame 57,
Each has an arcuate hole 59 centered on the rod 18 at the front and upper side.
The circular arc hole 59a, the through hole 53c drilled at the tip of the frame portion 53 of the cassette support frame 51, and the connecting holes 63a drilled on both sides of the motor bracket 6B.
are connected by one connecting shaft 64.

そのモータブラケット63は、片側から後方に向けての
びる腕65を一体的に形成して、この腕6Sの先端外側
に係合ビン66を植設し、この保合ビン66をキャリア
フレーム57の一方の側部フレーム5Sの円弧孔59.
の若干後方に水平方向に直線的に穿設した長孔59bに
係合している。
The motor bracket 63 is integrally formed with an arm 65 extending rearward from one side, and an engagement pin 66 is implanted on the outside of the tip of the arm 6S. The circular arc hole 59 of the side frame 5S.
It engages with a long hole 59b that is straightly bored in the horizontal direction slightly rearward of the hole 59b.

このように、モータブラケッl−63は、連結軸64ど
係合ビン66とでキャリアフレーム57に吊り下げて、
円弧孔59aと長孔5Sbとに案内さ]してプラテン1
1と直角な方向に移動可能に装着している。
In this way, the motor bracket l-63 is suspended from the carrier frame 57 by the connecting shaft 64 and the engagement pin 66, and
The platen 1 is guided through the circular arc hole 59a and the long hole 5Sb.
It is mounted so that it can move in a direction perpendicular to 1.

そして、第8図に示すように、連結軸54の両端に、他
端をキャリアフレーム57に固定したビン68に掛けら
れたトグルバネ69の一端を掛けて、モータブラケツ1
へ66を円弧孔59a及び長孔59bの前方又は後方の
いずれかに押し当てられるようにする。なお、第8図及
び第9図は、前方に押し当てられた状態を示している。
Then, as shown in FIG. 8, one end of a toggle spring 69, which is hung on a pin 68 whose other end is fixed to the carrier frame 57, is hung on both ends of the connecting shaft 54, and the motor bracket 1 is attached.
66 can be pressed against either the front or rear of the circular arc hole 59a and the elongated hole 59b. Note that FIGS. 8 and 9 show a state in which it is pressed forward.

そして、このモータブラケツ1−66には、複数の取イ
1孔63bを設けて、セレクションセンサ27を一体と
するセレクションモータ26をねし止めで取り(qけて
いる。
The motor bracket 1-66 is provided with a plurality of holes 63b, and the selection motor 26, which includes the selection sensor 27, is screwed into the motor bracket 1-66.

このセレクションモータ26の回転軸26aの先端には
、冠歯車71を固着してあり、モータブラケツ1−63
が前方に位置する(第8図及び第9図図示の状態)とき
、その冠歯車71が活字ホイール2ろの冠面41と噛み
合う。
A crown gear 71 is fixed to the tip of the rotating shaft 26a of the selection motor 26, and the motor bracket 1-63
When located in the front (the state shown in FIGS. 8 and 9), its crown gear 71 meshes with the crown surface 41 of the type wheel 2.

また、第10図に示すように、キャリアフレーム57の
両側部フレーム5日の前方に夫々2つの取付孔59C,
59dを穿設して、カセット支持フレーム51及びカセ
ットホルタ54を挾むように、フロントフレーム72(
第8図では図示を省略)を取付けている。
Further, as shown in FIG. 10, two mounting holes 59C are provided in front of the frame 5 on both sides of the carrier frame 57, respectively.
59d, and the front frame 72 (
(not shown in Fig. 8) is attached.

このフロントフレーム72の前方には、活字ホイール2
3のホーム位置及び種別識別標識であるマーク45及び
46を検知する第11図に示すように発光素子73及び
受光素子74からなる反射型フ第1へセンサセンサ(ホ
イールセンサ)75を取付けている。
In front of this front frame 72, there is a type wheel 2.
As shown in FIG. 11, a sensor (wheel sensor) 75 is attached to the first reflective wheel consisting of a light-emitting element 73 and a light-receiving element 74. .

また、フロントフレーム22の前方には、カセット24
内の活字ホイール23をセレクションモータ26側へ付
勢する板ばね76と、カードホルダ77とを取付けてい
る。なお、第8図中、Pは用紙であり、また第8図及び
第9図中、Rはインクリボンである。
In addition, a cassette 24 is provided in front of the front frame 22.
A leaf spring 76 that urges the inner type wheel 23 toward the selection motor 26 side and a card holder 77 are attached. In addition, in FIG. 8, P is paper, and in FIGS. 8 and 9, R is an ink ribbon.

このように構成したキャリッジ21は、第8図に示す状
態にあるときに、セレクションモータ26の回転軸2G
、が活字ホイール2ろに連結されるので、活字ホイール
23を回転して所望の活字を選択し、印字ハンマ25で
叩いて用紙Pに印字することができる。
When the carriage 21 configured in this manner is in the state shown in FIG.
, are connected to the type wheel 2, so that the desired type can be selected by rotating the type wheel 23 and printed on the paper P by striking it with the printing hammer 25.

この第8図に示す印字状態から、カセツ1−ボイール2
2を交換するときに、第12図に示すように、1〜クル
バネ69に抗してカセツ1−支持フレーム51をロット
18を中心にして後方に回動し、連結軸64に吊り下げ
たモータプラケツ1−63を後退させてロット18から
活字ホイール273の冠面41までの距離とロツ1く1
8から連結軸64までの距離のレバー比によって、活字
ホイール23とセレクションモータ26との連結を解除
する。
From the printing state shown in FIG.
2, as shown in FIG. 1-63 is moved back and the distance from lot 18 to the crown surface 41 of type wheel 273 and lot 1-63 are calculated.
The connection between the type wheel 23 and the selection motor 26 is released depending on the lever ratio of the distance from 8 to the connection shaft 64.

このとき、カセツ1−支持フレーム51は、1−グルハ
ネ69のイ1勢力でロッド18を中心として後方に倒れ
、カセットボルダ54の上方がプラテン11から離れて
、カセツ1〜ホイール22の交換ができる。
At this time, the cassette 1-support frame 51 falls backward around the rod 18 by the force of the 1-glue 69, and the upper part of the cassette boulder 54 separates from the platen 11, allowing the cassette 1 to wheel 22 to be replaced. .

第13図は、このプリンタの制御部を示すブロック図で
ある。
FIG. 13 is a block diagram showing the control section of this printer.

この制御部のプリンタコントロール回路80は、このプ
リンタ全体の制御を司り、CIIU(中央処理装置)、
プログラムメモリ(ROM)、データメモリ(RAM)
及び■10(入出力装置)笠からなる2個のマイコン8
1.82と、I10ボー1−83.84と、1/4分周
器85.86等で構成されている。
The printer control circuit 80 of this control unit controls the entire printer, and includes a CIIU (central processing unit),
Program memory (ROM), data memory (RAM)
and ■10 (input/output device) two microcomputers 8 consisting of a cap.
1.82, I10 baud 1-83.84, 1/4 frequency divider 85.86, etc.

そのマイコン81.82は、インテル社製のr8048
Jを、またI10ボート8乙、84は、同社のr82 
L 2J を使用している。
The microcontroller 81.82 is Intel's r8048
J, and I10 boat 8 and 84 are the company's r82
I am using L 2J.

そして、そのマイコン81.82は、アドレスラッチス
トローブサイクルクロック端子ALEからのクロックパ
ルスを、]/4分周器85.86で分周したパルスをナ
スト端子TIに入力する。
The microcomputer 81.82 then inputs a pulse obtained by dividing the clock pulse from the address latch strobe cycle clock terminal ALE by a ]/4 frequency divider 85.86 to the Nast terminal TI.

また、マイコン81.82は、ブロクラマブル・コミュ
ニケーション・インタフェース等からなるプリンタ・イ
ンタフェース回路87を介してプリンタコントロール回
路80に入力さ九るコンピュータ、ワードプロセッサ等
のホストシステム側から印字文字データ、スペース(キ
ャリッジ移!IIIJ f )データ、ラインフィード
データ等の各種データを。
The microcomputers 81 and 82 also receive print character data, spaces (carriage movement) from a host system such as a computer or word processor that is input to the printer control circuit 80 via a printer interface circuit 87 consisting of a blockrammable communication interface or the like. !IIIJ f) data, line feed data, and other various data.

■/○ポート83.84又はI10ポー1−86を介し
て夫々入出力ボート1(PL)に入力する。
The signals are input to the input/output port 1 (PL) via the ■/○ ports 83 and 84 or the I10 ports 1-86, respectively.

そして、マイコン81は、入力さtbだ各種データの処
理結果に基づいて、改行(ラインフィート力のために、
ボーh2(P2)からドライブパルスD Lをドライブ
回路SOに出力してラインフィートモータ12を駆動制
御して、プラテン11を回転させて用紙を送る。
Then, based on the processing results of the various input data, the microcomputer 81 generates a new line (because of the line feed force).
A drive pulse DL is output from the baud h2 (P2) to the drive circuit SO to drive and control the line foot motor 12 to rotate the platen 11 and feed the paper.

また、マイコン81は、各種データの処理結果及びスペ
ースセンサ29から外部割込み端子I NTに入力され
る位置信号PAに基づいて、印字位置を指定するために
、ボー1−2からスペースモータ28の駆動を指令する
駆動信号1) RV C、スペースモータ28の速度を
指令する指令速度データV D A C及びスペースモ
ータ28の回転方向を指定する回転方向信号D I R
Cを、スペースサーボトライブ回路91に出力して、ス
ペースモータ28を回転11に動してキャリッジ21を
所定の方向に所要量たけ移動させる。
The microcomputer 81 also drives the space motor 28 from the board 1-2 in order to designate the print position based on the processing results of various data and the position signal PA input from the space sensor 29 to the external interrupt terminal INT. Drive signal 1) Command speed data VDC that commands the speed of RV C, space motor 28, and rotation direction signal DIR that designates the rotation direction of space motor 28
C is output to the space servo drive circuit 91, the space motor 28 is moved to rotation 11, and the carriage 21 is moved by the required amount in a predetermined direction.

一方、マイコン82は、トIJ字のために、ボート2か
ら1くライブパルスD Hをドライブ回路9乙に出力し
て、印字ハンマ25のハンママクネットS4を駆動II
I御してハンマ95によって活字ホイール2ろの活字を
叩かせる。
On the other hand, the microcomputer 82 outputs the live pulse DH from the boat 2 to the drive circuit 9B to drive the hammer net S4 of the printing hammer 25 for the IJ character.
Control I and have the hammer 95 hit the type on type wheel 2.

また、マイコン82は、インクリボンを送るために、ボ
ー1へ2からドライブパルスDRをドライブ回路S6に
出力して、第4図では図示を省略したリボンフィートモ
ータ97を1rA動制御して、インクリボン98を送る
In addition, in order to feed the ink ribbon, the microcomputer 82 outputs drive pulses DR from baud 1 to 2 to the drive circuit S6, and controls the ribbon foot motor 97 (not shown in FIG. 4) by 1 rA to send the ink ribbon. Send ribbon 98.

さらに、マイコン82は、印字文字データ及びセレクシ
ョンセンサ27から外部割込み端子INTに入力される
位置信号PBに基づいて、活字選択のために、セレクシ
ョンモータ26の駆動を指令する駆動信号DRVS、セ
レクションモータ26の速度を指令する指令速度データ
VDAS及びセレクションモータ26の回転方向を指定
する回転方向信号DIR3を、セレクションサーボドラ
イブ回路S9に出力して、セレクションモータ26を回
転駆動して活字ホイール2ろを所定の方向に所要量だけ
回転させ、所要の活字を印字ハンマ25によって叩かれ
る位置にする。
Further, the microcomputer 82 generates a drive signal DRVS for instructing the selection motor 26 to drive for character selection based on the print character data and the position signal PB input from the selection sensor 27 to the external interrupt terminal INT. The command speed data VDAS, which commands the speed of The printer is rotated by the required amount in the direction to bring the required type into a position where it is struck by the printing hammer 25.

さらにまた、マイコン82は、ボートlに入力されるホ
イールセンサ75からのホールパルスP Hに基ついて
C舌字ホ、イール23の種類を判別する。
Furthermore, the microcomputer 82 determines the type of the wheel 23 based on the Hall pulse PH from the wheel sensor 75 input to the boat 1.

次に、これ等のマイコン81.82として田川している
インテル社製の[804°8」について簡単に説明する
Next, the [804°8] manufactured by Intel Corporation and used by Tagawa as one of these microcontrollers 81.82 will be briefly explained.

まず、このマイコンのブロック構成を第14図に、その
f(0Mのブロクラムメモリ・マツプを第15図に、同
じ<RAMのデータメモリ・マツプを第16図に示す。
First, the block configuration of this microcomputer is shown in FIG. 14, its f(0M blockram memory map is shown in FIG. 15, and the same <RAM data memory map is shown in FIG. 16.

そのプログラムメモリには、次の30ケーシヨン(アド
レス)が特別に割当てらツしている。
The following 30 cases (addresses) are specially allocated in the program memory.

(1)0番地:リセツ1−人力を加えると、プロクラ1
1開始番地として0番地が割当てられる。
(1) Address 0: Reset 1 - If you add human power, Procla 1
Address 0 is assigned as the 1 starting address.

(2)3番地:外部割込み(INT)要求111号で割
込みがかかるど、前条1′1・に3番地からのプロクラ
bが実行される。
(2) Address 3: When an interrupt is generated by external interrupt (INT) request No. 111, program b from address 3 is executed in the previous article 1'1.

(3)7番地:タイマ/カウンタのオーバフローによる
内部割込みが発生すると、前条件に7番地からのブロク
ラムが実行される。
(3) Address 7: When an internal interrupt occurs due to a timer/counter overflow, the block from address 7 is executed as a precondition.

次に、データメモリは、下記のように構成されている。Next, the data memory is configured as follows.

(1)O〜7番地:SEL RBO命令でワーキングレ
ジスタO〜7 (RO〜7〕として指定され、直接アド
レッシング可能となる。このレジスタ群をパンク0と称
する。データメモリの全アドレスは、RAIv1ポイン
タレジスタRO又はR1により間接的に指定できる。
(1) Addresses O to 7: Designated as working registers O to 7 (RO to 7) by the SEL RBO instruction, and can be directly addressed. This register group is called Punk 0. All addresses in the data memory are specified by the RAIv1 pointer. It can be specified indirectly by register RO or R1.

(2)8〜23番地=番地−2ワードとする8レベルの
ブロクラムカウンタ・スタックとして使用する。スタッ
ファ1ヘレスは、サブルーチンコール中にブロクラム・
ステータス・ワー1−’(PSW)のスタックポインタ
によりアドレスさJしる。
(2) Used as an 8-level blockram counter stack where addresses 8 to 23 = address - 2 words. Stuffer 1 Jerez is a brochure during a subroutine call.
The address is determined by the stack pointer of status word 1-' (PSW).

(3)24〜3Iffi地:SEL RBI命令で0〜
7番地の代わりにワーキングレジスタ0〜7として指定
され、直接アドレッシンク可能になる。このレジスタJ
Irをバンクlと称し、割込みサブルーチンで使用する
。パンク1指定時には、データメモリの全アドレスは、
RAMポインタレジスタRO’又は1り1′ により間
接的に指定できる。
(3) 24~3Iffi ground: 0~ with SEL RBI command
They are designated as working registers 0 to 7 instead of address 7, allowing direct addressing. This register J
Ir is called bank 1 and is used in the interrupt subroutine. When specifying Punk 1, all addresses of data memory are
It can be specified indirectly by RAM pointer register RO' or 1'.

(4)32〜63番地:通常のRAM領域である。(4) Addresses 32 to 63: Normal RAM area.

(5)θ〜255番地:外イ」けの12. A M領域
である。
(5) θ~255th address: 12. This is the A M area.

次に、ブロクラフ1カウンタ(1)c)とブロクラフ1
カウンタ・スタック及びブロクラム・ステータス・ワー
ドについて述へる。
Next, the block graph 1 counter (1) c) and the block graph 1
Let's talk about counter stacks and blockrum status words.

プログラムカウンタは、独立したカウンタてあり、一方
フ”ロクラ11カウンタ・スタック(jl、データメモ
リ中で幾組かのレジスタタ4で構成される。
The program counter is an independent counter, while the program counter is composed of several sets of registers 4 in the data memory.

ブロクラムカウンタは、第17図に示すように、12ヒ
ツト構成で、その内のヒラ1−Au−Δ9の10ピッ1
−か内部プログラムメモリの1024ワードを71〜レ
スするために使用され、ヒツトΔlO+ABの2ビット
は外部メモリフェッチのために(・F用される。このプ
ロゲラ11カウンタは、リセツ1へ4u号によって、ゼ
ロに初期設定される。
As shown in Fig. 17, the block counter has a 12-hit configuration, of which 10 pips 1-Au-Δ9.
- is used to read 1024 words of internal program memory, and 2 bits of ΔlO+AB are used for external memory fetches. Initialized to zero.

そして、このプログラムカウンタの内容は、割込みやサ
ブルーチンコールの発生によつ−C1第18図に示すプ
ロゲラlトステータス・ワー1へ(PSW)のピッ1−
〇〜2て構成されるスタックポインタSo、S2.S3
で決定さ、fシる第19図に示すブロクラムカウンタ・
スタック(データメモリの8〜23番地)の8組のレジ
スタ対の内の1つにストアされる。
The contents of this program counter are changed depending on the occurrence of an interrupt or a subroutine call.
Stack pointer So, S2. S3
The block diagram counter shown in FIG.
It is stored in one of eight register pairs on the stack (data memory addresses 8-23).

ブロクラムカウンタ・スタックは、第19図に示すよう
に、プログラムカウンタPC0〜pc、。
As shown in FIG. 19, the block counter stack includes program counters PC0 to PC.

及びプログラム・ステータス・ワードの4ビツトをスト
アするために用いる。
and the 4 bits of the program status word.

ブロクラム・ステータ・スワ−1くを構成するスタック
ポインタS□、S2.S3は、初期設定て1’0,0,
0」になり、データメモリの8番地と9番地を示す。
Stack pointers S□, S2 . S3 is initially set to 1'0,0,
0'', indicating addresses 8 and 9 of the data memory.

そして、最初のサブルーチンコール又は内部割込みによ
って、そのときのブロクラフカウンタはデータメモリの
8番地と9@地にΦム送される。
Then, by the first subroutine call or internal interrupt, the current block rough counter is transferred to addresses 8 and 9 of the data memory.

その後、スタックポインタは、インクリメン1〜(−1
−]、)さ汎、次のサブルーチンコール囚Z jiii
 7−て10番地と11番地とを示す。
The stack pointer then increments from 1 to (-1
-],), next subroutine call Z jiii
7- indicates addresses 10 and 11.

また、スタックポインタは、リターン命令(R1゛Eあ
るいはRTER)の実行によってデクリメンI−(−1
)され、そのスタックポインタの示すレジスタ列の内容
がブロクラフ1カウンタに転送される。
Also, the stack pointer is decremented by executing a return instruction (R1゛E or RTER).
), and the contents of the register column indicated by the stack pointer are transferred to the block graph 1 counter.

次に、割込みについて述l\る。割込みロシツタは第2
0図に示すように構成さ、bている。
Next, let's talk about interrupts. The interrupt controller is the second
It is constructed as shown in Figure 0.

割込み(INT)入力は、各マシンサ・rグル毎にΔL
 E信号のときにザンブルさJし、割込みか険知さオし
ると、現在実行中のサイクルか完rしたい、プログラム
メモリの3nv地にサフルーチンシャンブか行なわJし
る。
Interrupt (INT) input is ΔL for each machine sensor/r group.
When the E signal is detected, an interrupt is detected, and the cycle currently being executed is completed, and a subroutine is executed at location 3nv in the program memory.

割込みのレベル数は1であり、一度割込みが受イ1けら
れると、次の割込み要求は、RIE T R命l17の
実行によって割込み入力の回路が再びイネ−フルになる
まてすl\て無現さツシる。この割込みイネーブルは、
RE T R命令の2番[1のサイクルの防めに行なわ
れる。この割込みイネーブルのタイミングは、タイマオ
ーバフローによって生しる内部割込みの場合も同じであ
る。
The number of interrupt levels is 1, and once an interrupt is accepted, the next interrupt request will be enabled again by executing the RIETR instruction 117. It's invisible. This interrupt enable is
This is done to prevent the second cycle of the RETR command. The interrupt enable timing is the same for internal interrupts caused by timer overflow.

なお、第20図から分るように、割込み進行中フリップ
フロップ回路(FIi )がセットされているどきには
、その後の割込みはすべていす、ltの割込み許可F 
Fの状態に関係なく、ロックアラ1−される。つまり、
−の割込み要求を受付けたときには、その受付けた割込
み処理が終了するまで、他の割込み要求の処理を開始し
ない。
As can be seen from FIG. 20, when the interrupt in progress flip-flop circuit (FIi) is set, all subsequent interrupts are handled by the interrupt enable F of the chair, lt.
Regardless of the state of F, lock alert 1 is performed. In other words,
- When an interrupt request is accepted, processing of other interrupt requests is not started until the accepted interrupt processing is completed.

次に、タイマ/カウンタは、第21図に示すように構成
されている。
Next, the timer/counter is configured as shown in FIG.

このタイマ/カウンタのカウンタは、8ピッ1−のバイ
ナリアップカウンタでブリセラ1−可能であり、MOV
E A、T (リード・タイマカウンタ)とMOVE 
T、A (ロード・タイマカウンタ)命令により、アキ
ームレータ(ACC)と内容のやりとりかできる。
The counter of this timer/counter is an 8-pin binary up counter that can be used for brissera 1-, and is MOV
E A, T (read timer counter) and MOVE
Contents can be exchanged with the achievator (ACC) using the T and A (load timer counter) instructions.

カウンタの内容は、リセットによって影響されす、M 
OV ET 、 ’A命令によって初1tlJ値か設定
さJルる。
The contents of the counter are affected by the reset, M
OV ET, 'A command sets the initial value.

そして、カウンタは、S’l”RT 1’ (スター1
−・タイマJ命令でタイマとして、S T II T 
CN T(スター1−・カウンタ)命令でイヘン1〜カ
ウンタとして、それぞ゛れカラン1へを開始する。
And the counter is S'l"RT 1' (star 1
-・As a timer with the timer J command, S T II T
With the CNT (star 1-counter) command, each of the counters starts counting from 1 to 1.

カウンタは、一度スター1〜すると、S T 01)T
CN”r(カラン1〜停止)命令かりセラ1−にょって
ストップさせIられるまでカウント1直川け、最大カウ
ン!−数(FF II )までインクリメンl−(+1
’)して、OOIIでオーバフローする。
Once the counter reaches 1 star, ST 01)T
When the CN"r (run 1~stop) command is issued, count 1 until it is stopped by Sera 1-. Increment l-(+1) until the maximum count!-number (FF II).
') and overflows in OOII.

このノα大カウン1−数(F F II )がlジA−
へフロー(OOn)になったときに、オーパフローフラ
フF l?がセットさ4じC1割込み要求が発生する。
This α large count 1-number (F F II ) is ldiA-
When the flow (OOn) occurs, the overflow fluff F l? is set, a C1 interrupt request is generated.

なお、このマイコンr8048Jの他の詳)IIIな説
明については、インテルジャパン扛発行の[マイ’)ロ
コンピュータ ユーザース・マニュアルMC5−48J
に委ねる。
For other detailed explanations of this microcomputer R8048J, please refer to the [My') Computer User's Manual MC5-48J published by Intel Japan Co., Ltd.
I leave it to you.

次に、このように構成した実IN例の作用について第2
2図以降をも参照して説明する。
Next, we will discuss the operation of the actual IN example configured in this way in the second section.
This will be explained with reference to Figure 2 and subsequent figures.

まず、第22図を参照して、このプリンタコン1−ロー
ル回路80が実行するプリンタ制a−11の概要を説明
する。
First, with reference to FIG. 22, an outline of the printer system a-11 executed by the printer controller 1-roll circuit 80 will be explained.

プリンタコンI・ロール回路8oは、電源投入によって
、リストア動作を行なった後、活字ホイール26のホイ
ール種別及びホー11位置を判別するホイール種別判別
動作をする。
The printer controller I/roll circuit 8o performs a restore operation upon power-on, and then performs a wheel type determination operation to determine the type of type wheel 26 and the position of the hoe 11.

その後、プリンタ・インタフェース回路87がらのデー
タを受け取って、そのデータが印字文字データであれば
、セレクションモータ26を駆動して活字ホイール26
を回転駆動し、所要の活字を選択する動作(セレクショ
ン動作)をして、印字ハンマ25を駆動すると共に、イ
ンクリボンS8を送る印字動作をする。
Thereafter, data from the printer interface circuit 87 is received, and if the data is print character data, the selection motor 26 is driven to move the type wheel 26.
is rotated to select desired characters (selection operation), drive the print hammer 25, and perform a printing operation to feed the ink ribbon S8.

また、データがキャリッジ移動爪(スペース)テ〜りで
あれば、スペースモータ28を駆動してキャリッジ28
を所要の位置に移動し、データが改行(ラインフィート
)であれば、ラインフィードモータ12を駆動してプラ
テン11を回動する改行動作をする。
Also, if the data is for the carriage moving claw (space), the space motor 28 is driven to move the carriage 28.
is moved to a required position, and if the data is a line feed (line feed), a line feed motor 12 is driven to rotate the platen 11.

次に、第23図及び第24図を参照してホイール判別動
作について説明する。
Next, the wheel discrimination operation will be explained with reference to FIGS. 23 and 24.

ます、各図に示す略称について説明すると、ステップ・
エラー・ステップSESは、活字ホイール23のホーム
位置の検索のために必要な位置信号PBが1個発生する
回転量を1ステツプとしたときのセレクションモータ2
6のステップ数であり、活字ホイール23の1回転に要
するステップ数にホーム位置識別用マーク45の幅に対
応するステップ数を加えたステップ数より多いステップ
数に改定している。
First, to explain the abbreviations shown in each figure, step
The error step SES is the rotation amount of the selection motor 2 when one step is the amount of rotation at which one position signal PB necessary for searching the home position of the type wheel 23 is generated.
The number of steps has been revised to be greater than the number of steps required for one rotation of the type wheel 23 plus the number of steps corresponding to the width of the home position identification mark 45.

ステップ・ストップ・ステップSSSは、マーク45か
ら活字ホ、イール26をf′7止するまでのセレクショ
ンモータ26のステップ数であり、マーク4Sとマーク
46との最大許容間隔よりも多いステップ数に設定して
いる。
The step/stop/step SSS is the number of steps of the selection motor 26 from the mark 45 to the type E until the eel 26 is stopped at f'7, and is set to a number of steps greater than the maximum allowable interval between the mark 4S and the mark 46. are doing.

カウント1直川は、ホームパルスP Hがボーア、(立
置パルスP HMか否かを判別するためのステップ数で
あり、マーク45に対応するホー11パルスP Hのパ
ルス幅をステップ数M II、マーク46に対応するホ
ームパルスP Hのパルス幅をステップ数MD (MD
<Mllンとしたとき、Mll≧Ill > MDの条
件を満すように設定する。ここでは、1r1−M f−
Iに設定している。
Count 1 Naokawa is the number of steps for determining whether the home pulse PH is a Bohr (vertical pulse PHM), and the pulse width of the Ho 11 pulse PH corresponding to mark 45 is the step number MII, The pulse width of the home pulse P H corresponding to the mark 46 is determined by the number of steps MD (MD
<When Mlln, Mll≧Ill> Set so that the condition of MD is satisfied. Here, 1r1-M f-
It is set to I.

第23図及び第24図において、ST[E[’ lで、
カウンタCNTlにステップ・エラー・ステップSES
をセリトン、5TIEIl 2 テカウンタCNT2及
びカウンタCN T 3をリセッ1へする( ” o 
″にする)。
In FIGS. 23 and 24, ST[E[' l,
Step error step SES in counter CNTl
Set the counter CNT2 and counter CNT3 to reset 1 ("o
).

そして、5TEP 3〜5で、セレクションモータ26
の1ステツプの回転駆動を開始して、駆動開始から所定
時間経過したか否かを判別し、所定時間経過したときに
はセレクションエラーとしてエラー処理をし、所定時間
経過していなければ、位置信号PB(パルス)が人力さ
れたか盃かを判別する。
Then, at 5TEP 3 to 5, the selection motor 26
1-step rotational drive is started, and it is determined whether or not a predetermined time has elapsed since the start of the drive. When the predetermined time has elapsed, an error process is performed as a selection error. If the predetermined time has not elapsed, the position signal PB ( Determine whether the pulse (pulse) was made manually or by a cup.

そして、所定時間内にパルスか入力されたときには、S
1’EP6で、カウンタCNTlをデクリメン1−(−
1)L、で、S1’EI37でホームパルスP Hか入
力されているか否かを判別する。
Then, when a pulse is input within a predetermined time, S
At 1'EP6, the counter CNTl is decremented by 1-(-
1) At L, it is determined in S1'EI37 whether or not the home pulse PH is input.

この判別結果かホーム位ルスPH有りであれは、5TE
P 8でカウンタCNT2をインクリメント(+1) 
した後、5TEP ]、 Oに進み、ホーt)パルスI
) I(無してあれば、5TIEP9でカウンタCN 
T2をリセツ1−シた後、 5TIEP 11に進む。
If this judgment result or home position Lus PH is present, 5TE
Increment counter CNT2 at P 8 (+1)
After that, proceed to 5TEP], O, and then t) Pulse I
) I (If there is no counter CN at 5TIEP9
After resetting T2, proceed to 5TIEP 11.

そして、5TEP 10でカウンタCN T 2のカラ
ン1〜値が予め定めたカウント値n1以上か否かを判別
し、カラン1〜値1n以上であれば後述する5TEP 
12にジャンプしてホーム位置及びホイール種別判別動
作に入り、カウント値I11以上でなげれは、S T 
l: PllでカウンタCNT1か0″か否か、すなわ
ち活字ホイール23をステップ・エラー・ステップSE
S分回転したか否かをニックして、0′であればエラー
処理ルーチンに入り、” o ”でなけれは5TEP 
3に戻る。
Then, at 5TEP 10, it is determined whether or not the count value n1 of the counter CN T 2 is greater than or equal to the predetermined count value n1.
12 and enters the home position and wheel type discrimination operation, and if the count value I11 or more falls, ST
l: Pll determines whether the counter CNT is 1 or 0'', that is, the type wheel 23 is set to step error step SE.
Check whether it has rotated by S minutes, and if it is 0', enter the error processing routine, and if it is not "o", proceed to 5TEP.
Return to 3.

すなわち、ここでは、ホームパルスP Hのパルス幅を
カウントシて、そのホー11パルスpHかマーク45に
対応するホーム位置パルスP LI Mか否かを判別す
る。
That is, here, the pulse width of the home pulse P H is counted and it is determined whether the home pulse pH is the home position pulse P LI M corresponding to the mark 45 or not.

次に、5TEP 10 テカウンタCN ’r 2のカ
ラン1−値がカラン1〜値【n以」二になっており、ホ
ーム位置パルスP I−I Mを検知できたときには、
 5TIEP I 2でカウンタCNT1にステップ・
ストップ・ステップSSSをセラ1へする。
Next, when the 5TEP 10 counter CN'r 2's 1-value is between 1 and 2 and the home position pulse P I-I M can be detected,
5TIEP I 2 steps the counter CNT1.
Set stop step SSS to Sera 1.

ソノ後、S1’EP] 3−15 テ、S1’[EP 
3−5 ト1i71 rnの処理をしてセレクションモ
ータ26を1ステツプ分回転させ、5TEP16でカウ
ンタCN Tlをテクリメン+−<−1)し、5TEP
 17でホーム位jαパルスP HMを検知したときに
セラ1−する( ” l ′にする)フラグFがF二〇
 か否かを判別する。
After Sono, S1'EP] 3-15 Te, S1'[EP
3-5 Process step 1i71rn, rotate the selection motor 26 by 1 step, and increase the counter CN Tl +-<-1) at 5TEP16.
At step 17, when the home position jα pulse PHM is detected, it is determined whether the flag F is set to F20 or not.

この判別結果がF=Oでなければ、後述するST[EP
21にジャンプし、)7二〇であれは、S1’EP I
 8でカウンタCNT3をインクリメンl−(+1)し
た後、5TE131.9でホームパルスIBMが入力さ
れているか否かをチェックし、ボームパルスPMが無け
れば5TIEI) l 3に戻り、ホームパルスl) 
Mが有、IシはフラグFをセットする( l ”にする
)。
If this determination result is not F=O, ST[EP
Jump to 21, ) 720 is S1'EP I
After incrementing the counter CNT3 by l-(+1) at step 8, check whether the home pulse IBM is input at 5TE131.9, and if there is no Baum pulse PM, return to 5TIEI)l and return to home pulse l)
If M exists, I set the flag F (make it "l").

そして、Sl’lミP21でカウンタCNTlがO″に
なったか否かをチェックして、0″でなけれは5TEP
13に戻って、次の1ステツプ分の回転動作に入る。
Then, check whether the counter CNTl has become O'' in Sl'lmiP21, and if it is not 0'', 5 TEP
Returning to step 13, the rotation operation for the next one step is started.

すなわち、ここでは、ホイール位置パルスP HMを検
知した後、活字ホイール26を予め定めたステップ数r
I分回転したか歪かを判別して、そのステップ数n分回
転した時に、その位置を活字ホイール23のホーム位置
とする。
That is, here, after detecting the wheel position pulse PHM, the type wheel 26 is moved by a predetermined number of steps r.
It is determined whether the type wheel has rotated by I or is distorted, and when the type wheel has rotated by the number of steps n, that position is set as the home position of the type wheel 23.

その後、S1’EP22で、カウンタCN T 3のカ
ウント値を参照して、ホーム位置用マーク45とホイー
ル種別用マーク46との間隔によって活字ホイール26
の種別を判別し、この判別結果に応してスペースピッチ
をセツトシて処理を終了する。
After that, in S1'EP22, the count value of the counter CN T 3 is referred to, and the type wheel 26 is determined according to the interval between the home position mark 45 and the wheel type mark 46.
The type of space is determined, and the space pitch is set according to the result of this determination, and the process ends.

次に、第25図を参照して、印字動作及びキャリッジリ
ターンのタイミンクを説明する。
Next, the timing of printing operation and carriage return will be explained with reference to FIG. 25.

まず、第25図の時点[1で、印字文字テークに対応す
る活字を選択するために、マイコン82は同図(イ)に
示す駆動信号D I’t V Sと、指令速度テークV
DC8及び回転方向信号L) ]、 RSとをセレクシ
ョンサーボ゛ドライブ回路99に出力して、活字ホイー
ル2ろを所定の方向に所定は回転する。
First, at time [1 in FIG. 25], in order to select the printed character corresponding to the printed character take, the microcomputer 82 sends the drive signal D I't V S shown in FIG.
DC8 and rotational direction signals L) and RS are outputted to the selection servo drive circuit 99 to rotate the type wheel 2 in a predetermined direction.

そして、活字選択か終了した時点t2から同図(ロ)に
示す所定のセレクションヒジ・r時間S LBが経過し
た時点t3で、マイコン82は同図(ハ)に示すハンマ
ドライブパルスI) Hを出力してl’−,11字ハン
マ25の駆動を開始すると共し二、同図(1−)に示す
リボンドライブパルスD Rを出力してインクリボン9
8の送りを開始する。
Then, at time t3, when a predetermined selection elbow time SLB shown in FIG. 3(B) has elapsed from time t2 when the type selection is completed, the microcomputer 82 sends the hammer drive pulse I)H shown in FIG. At the same time, the ribbon drive pulse DR shown in FIG.
Start feeding 8.

その後、マイコン81は、印字が終了した後の時点t4
で、同図(ホ)に示す駆動信号D RV Cと、指命速
度テークVDAC及び回転方向イn号DIRCをスペー
スサーボドライブ回路91に出力して、キャリッジ21
を次の印字位置に移動する。
Thereafter, the microcomputer 81 prints at a time t4 after printing is completed.
Then, the drive signal D RV C, commanded speed take VDAC and rotational direction in number DIRC shown in FIG.
Move to the next print position.

一方、印字ハンマ25の駆動を開始した時点t4から同
図にうに示す所定のハンマビジィ時間HM Bか経過し
た時点t5で、マイコン82は前述と同様にして次の印
字活字を選択するセレクション動作を開始し、また、所
定の時点t6でリボンフィード終了する。
On the other hand, at time t5, when a predetermined hammer busy time HM B shown in FIG. Furthermore, the ribbon feeding ends at a predetermined time point t6.

そして、今回のセレクションか終了した時点L7でスペ
ースが終了していなければ、スペースが終了した時点[
8から同図(へ)に示す所定のスペースビジィ時間SP
Bか経過した時点t9でマイコン82は印字ハンマ25
の駆動を開始する。
Then, if the space has not ended at the time L7 when this selection ends, the time when the space ends [
8 to the predetermined space busy time SP shown in the figure (to)
At time t9 when B has elapsed, the microcomputer 82 activates the printing hammer 25.
Start driving.

その後1例えば時点t toで次のスペースがギヤリッ
ジリターンであれは、マイコン81は、キャリッジ21
の移動を開始すると共に、同図(チ)に示すラインフィ
ードドライブパルスDI−の出力を開始して、改行する
After that, if the next space is the gear carriage return at time t to, the microcomputer 81 controls the carriage 21.
At the same time, the output of the line feed drive pulse DI- shown in FIG.

なお、リボンフィートドライブパルスDR及びラインフ
ィードドライブパルスDLは、実際には所定の時間間隔
て出力されるか、第25図では駆動中を示すために連続
的に示している。
Note that the ribbon foot drive pulse DR and line feed drive pulse DL are actually output at predetermined time intervals, or are shown continuously in FIG. 25 to indicate that they are being driven.

また、マイコン81は、スペース動作+1i冒こはキャ
リッジ21の現在位置と1」的位置との距m1(に応じ
てスペースモータ2Bの速度を変化させる制御をする。
Further, the microcomputer 81 controls the speed of the space motor 2B to be changed in accordance with the distance m1 between the current position of the carriage 21 and the 1'' target position (space operation +1i).

同様に、マイコン82は、セレクション動(i: If
、’rには活字ホイール26の現在位置と1」的位1i
j)どの距mfに応してセレクションモータ26の速度
を変化させる制御をする。
Similarly, the microcomputer 82 performs a selection operation (i: If
, 'r indicates the current position of the type wheel 26 and 1' target position 1i.
j) Control is performed to change the speed of the selection motor 26 according to which distance mf.

このように、プリンタコン1−ロール回路80のマイコ
ン81.82は各種の制御を行なう。
In this way, the microcomputers 81 and 82 of the printer controller 1-roll circuit 80 perform various controls.

この場合、マイコン81.82は、メインルーチンで、
第260に示すように、内部タイマ(タイマ/カウンタ
〕をスター1−どして、テークをt売込み、そのテーク
に応した動作を開始する等の処理をする。
In this case, the microcontroller 81.82 is in the main routine,
As shown in No. 260, the internal timer (timer/counter) is set to 1, the take is set to t, and an operation corresponding to the take is started.

また、マイコン81.82は、夕・17割込みルーチン
で、第27図に示すように、後述するタイマ割込み開始
処理をした後、ドライブ、ヒシイ制御をして、後述する
タイマ割込み終了処理ケする。
Further, in the evening 17 interrupt routine, the microcomputers 81 and 82 perform timer interrupt start processing, which will be described later, as shown in FIG.

そのドライブ、ビジィ制御処理では、タイマのオーバフ
ロー回数をカウントシて、所定の時間間隔で前述したリ
ボンフィードのためのドライブパルスDRを出力し、所
定の時間間隔でラインフィートのためのドライブパルス
DLを出力する(第25図参照)。
In the drive and busy control processing, the number of overflows of the timer is counted, and the drive pulse DR for ribbon feeding described above is output at a predetermined time interval, and the drive pulse DL for line foot is output at a predetermined time interval. (See Figure 25).

また、同様にして、セレクションドライブ時。Also, in the same way, when driving selection.

スペースドライブ11S、ハンマ1くライブ時、リボン
1くライブ時、ラインフィートドライブ時に各ビジィ時
間(SLB、HMB、5PB)が経過したときにビジィ
オフにする(第25図参照)。
Space drive 11S turns busy off when each busy time (SLB, HMB, 5PB) elapses during hammer 1 live, ribbon 1 live, and line foot drive (see Figure 25).

さらに、同様にして、セレクションドライブ時。Furthermore, in the same way, when driving selection.

スペースドライブ時に所定時間内に位置信号が入力さA
しないどきに、セレクションエラー(第23図参照)、
スペースエラーとする。
A position signal is input within a predetermined time during space drive.
When I didn't, a selection error (see Figure 23) occurred.
A space error occurs.

また、マイコン81.82は、外部割込みルーチンで、
第28図に示すように、サーボモータのスピード(速度
)制御をする。この処理では、セレクションセンサ2G
、スペースセンサ29からの位置信号1〕Δ、PBをカ
ラン1−シて、所定カラン1〜数になる毎に速度を変化
させる。
In addition, the microcontroller 81.82 has an external interrupt routine.
As shown in FIG. 28, the speed of the servo motor is controlled. In this process, selection sensor 2G
, the position signal 1] from the space sensor 29, Δ, PB, and change the speed every predetermined number of times.

このように、マイコン81.82は、タイマ割込みで各
種の1〜ライブ、ビシ・r制御をし、外部割込みでサー
ボモータの速度制御をする。
In this way, the microcomputers 81 and 82 perform various types of 1-live, bi-r control using timer interrupts, and control the speed of the servo motor using external interrupts.

この場合、前述したように、例えはキャリッジリターン
制御とラインフィート制御、あるいはセレクション制御
とリボンフィー1く制御は競合することかある(第25
121参照)。つまり、スペースセンサ29.セレクシ
ョンセン→ノ26かr?1の位117I“信号PA、P
I3による外部割込み処理(七〜りの速度制御)とタイ
マ割込み処理(1−ライブ、ヒシイ制御ンとが競合する
ことがある。
In this case, as mentioned above, for example, carriage return control and line foot control, or selection control and ribbon fee control may conflict (No. 25).
121). In other words, space sensor 29. Selection Sen → No 26 r? 1 digit 117I “signal PA, P
External interrupt processing (7-1 speed control) by I3 and timer interrupt processing (1-live, HISHII control) may conflict with each other.

ところが、マイコン81.82とし、て1・14用して
いるr3048Jは、前述したように、外部割込みとタ
イマ割込みとが競合した場C1割込み要、1(か受(−
Jけられた方の処理か終了するまで、他方の処理を開始
できない。
However, as mentioned above, in the R3048J, which uses a microcomputer 81.82 and 1.14, when an external interrupt and a timer interrupt conflict, the C1 interrupt is required and 1 (received).
The other process cannot be started until the other process is finished.

そのため、このままではタイマ割込みの時間間隔が間延
びしたり、外部割込み処理が遅、11たりする。そこで
、第27図に示したタイマ割込み開始処理及びタイマ割
込み終了処理をする。
Therefore, if left as is, the time interval between timer interrupts will be extended, and external interrupt processing will be delayed. Therefore, the timer interrupt start process and timer interrupt end process shown in FIG. 27 are performed.

第29図は、このタイマ割込み開始処理及びタイマ割込
み終了処理を示すフロー図である。
FIG. 29 is a flow diagram showing this timer interrupt start processing and timer interrupt end processing.

まず、タイマ割込み処理中の外部割込み処理を可能にす
る部分について説明すると、タイマ割込みルーチン(T
 INT)を開始して、第27図に示すタイマ割込み開
始処理に入り、第30図及び第16図をも参照して、ア
キュームレータACCの値を、データメモリ中のワーキ
ンクレシスタのS A V E 3にストアし、またR
AMポインタレジスタRO,R1の値を通常のRA !
14領域の5AVEO,]にストアする。
First, to explain the part that enables external interrupt processing during timer interrupt processing, the timer interrupt routine (T
INT) and enters the timer interrupt start process shown in FIG. 27. Referring also to FIG. 30 and FIG. 3 and R again.
Change the values of AM pointer registers RO and R1 to normal RA!
14 area, 5AVEO,].

こ肛は、タイマ処理中でもバンクスイッチBS=0を使
用するため、メインルーチンでのアキュームレータAc
c、RAMポインタレジスタRO。
Since the bank switch BS=0 is used even during timer processing, the accumulator AC in the main routine is
c, RAM pointer register RO.

R1の値L[i護するためである。This is to protect the value L of R1.

そして、現在のスタックポインタS、、S、。and the current stack pointer S,,S,.

S3で示されるプログラムカウンタ・スタックのレジス
タ (データメモリ〕にタイマ処理(1−ライブ、ビジ
ィ制御)の開始ア1−レス(T 、]MP O)E T
1えを実行する。
The start address (T, ]MP O) for timer processing (1-live, busy control) is stored in the register (data memory) of the program counter stack indicated by S3.
Execute step 1.

そ」しによって、ブロクラムカウンタ・スタッタのPC
8−1)S、、て示されるタイマ処理の開始71−レス
(T JMI)O)にジャンプするので、タイマ処理で
ある1−ラ・rブ、ビジィ制御か開始される。
By doing so, the block counter/stutter PC
8-1) Start of timer processing indicated by S. Jumps to 71-Res (T JMI) O), so timer processing 1-R, busy control is started.

このとき、既に1?、■Σ’]’R命令か実行さ(しC
いるので、第20図に示す割込み進’(jIf’ Fl
’がリセットされ、外部割込みを受イ」(づて処理する
ことか可能になる。
At this time, is it already 1? ,■Σ']'R command is executed (C
Therefore, the interrupt progress '(jIf' Fl
' is reset, and it becomes possible to process external interrupts.

そして、タイマ処理か終了した後、第271”4のタイ
マ割込jJ、 g、B子処理に入り、ます、外部割込み
を禁止し・て、メインルーチンで使用していたアキュー
ムレータACC,RAMポインタレジスタYく0、R1
(7)I直を5AVE3.O,Iから人/7 ロー1−
する。
After the timer processing is finished, the 271st"4 timer interrupt jJ, g, B child processing is started, external interrupts are prohibited, and the accumulator ACC and RAM pointer registers used in the main routine are Yku0, R1
(7) 5AVE3. O, I to person/7 Row 1-
do.

その後、外部割込み及びタイマ割込みk fF −i’
J して、後述するカウント値読出し、タイマ値セット
の処理をした後、RETR命令を実行する。
After that, external interrupt and timer interrupt k fF −i'
After reading the count value and setting the timer value, which will be described later, the RETR command is executed.

それによって、タイマ割込み処理ルーチンから抜は出て
メインルーチンに戻る。
This exits the timer interrupt processing routine and returns to the main routine.

次に、この処理を具体的に説明すると、まず、タイマ割
込み直前のプログラムカウンタ(PC6〜PC11)、
ブロクラム・ステータス・ワード(PSW)のスタック
ポインタ5Irb2rS3及びバンクスツチBSの状態
か、PCo〜P CII −Xll、S、、S2.s3
=:ooo、BS=Oであったとする。
Next, to explain this process in detail, first, the program counter (PC6 to PC11) immediately before the timer interrupt,
The stack pointer 5Irb2rS3 of the block status word (PSW) and the state of the bank switch BS, PCo~PCII-Xll,S,,S2. s3
=:ooo, BS=O.

この状態でタイマ割込みが発生すると、プログラムカウ
ンタP Co−P Cnは(X+1)Ifになり、この
ときのブロクラム・ステータス・ワー1−I)SWの上
位4ピッ1−及びブロクラムカウンタPCg−PC++
は、第19図に示すように、スタックポインタl’oo
OJ(データメモリの8番地。
When a timer interrupt occurs in this state, the program counter P Co-P Cn becomes (X+1)If, and the upper 4 pins 1- of the blockrum status word 1-I)SW and the blockrum counter PCg-PC++ at this time
is the stack pointer l'oo, as shown in FIG.
OJ (address 8 of data memory.

9番地)に格納され、スタックポインタは「001」に
インクリメンh(+1)される。
9), and the stack pointer is incremented to "001" h (+1).

そして、第2S図に示すタイマ割込みルーチン(T I
NT)を開始して、前述のようにアキュームレータAC
C及びRA MポインタレジスタRO,R1(7)値を
、5AVE3,0.I にストアする。
Then, the timer interrupt routine (T I
NT) and start the accumulator AC as described above.
C and RAM pointer registers RO, R1 (7) values 5AVE3,0 . Store in I.

その後、現在のスタックポインタro01Jで示される
フ′ログラムカウンタ・スタックのレジスタ、すなわち
データメモリの10番地、11帛地のブロクラムカウン
タPCo〜PC++のストア1リアに、タイマ処理の開
始ア1−レス(T 、J〜I PO)をストアして、ス
タックポインタをインクリメンh(+l)すると、スタ
ックポインタは[002Jを示す。
After that, the register of the program counter stack indicated by the current stack pointer ro01J, that is, the store 1 rear of the program counters PCo to PC++ at addresses 10 and 11 of the data memory, is set to the start address of the timer process. When (T, J~IPO) is stored and the stack pointer is incremented by h(+l), the stack pointer indicates [002J.

そして、タイマ割込みを禁止して、R[E 71’ R
命令を実行すると、スタックポインタかro 02Jか
らrooIJにテクリメン1〜(−1)さAしる。
Then, disable timer interrupts and write R[E 71' R
When the instruction is executed, the stack pointer is transferred from ro02J to rooIJ by 1 to (-1).

したがって1、ブロクラムカウンタp Co〜■)31
1で示されるタイマ処理の開始アドレス(I゛J M 
)) O)にジャンプするので、タイマ割込み処理が開
始され、このとき、RETR命令を実tTしているので
、外部割込みを受(;]けてクル理することか可能にな
る。
Therefore, 1, brocrum counter p Co ~ ■) 31
The start address of timer processing indicated by 1 (I゛J M
)) Since the program jumps to O), timer interrupt processing is started, and at this time, since the RETR instruction is actually executed, it becomes possible to receive and process an external interrupt.

そして、タイマ処理が終了した後、外部割込みを禁止し
て、アキュームレータへ〇〇、RAMポインタレジスタ
RO,R1の値を5AVE3,0゜1から夫々ロートし
、外部割込み及びタイマ割込みを許可して、カラン1−
値読出し、タイマ値セットの処理をした後、RE T 
R命令を実行する。
After the timer processing is completed, external interrupts are disabled, the values of RAM pointer registers RO and R1 are loaded into the accumulator from 5AVE3 and 0°1, respectively, and external interrupts and timer interrupts are enabled. Karan 1-
After reading the value and setting the timer value, RET
Execute R command.

このRE T R命令の実行によって、スタックポイン
タはr o o (i 」にテタリメン+−(−1,>
 されるので、メインルーチンにリターンする。
By executing this RETR instruction, the stack pointer changes to r o (i) +-(-1, >
The program returns to the main routine.

このようにし、て、タイマ割込みの処理中に外部割込み
か発生したときには、その外部割込みを受イ」けて処理
することかできる。
In this way, if an external interrupt occurs during timer interrupt processing, the external interrupt can be received and processed.

ぞして、上述のような処理をするために、タイマ割込み
開始時に20バr+−、終了時に7ハーr1〜要するた
けであり、この期間のみ外部割込みか禁止さ九るた番プ
であるので、外部割込み処理の週、ltは殆んどないと
考えらJ+、る。
Therefore, in order to perform the above-mentioned processing, it takes 20 bar + - to start the timer interrupt and 7 bar r1 to finish it, and external interrupts are prohibited only during this period. It is thought that there is almost no external interrupt processing during the week.

次に、タイマ割込みの発生間隔を正確にする部分の処理
について説明する。
Next, a description will be given of the processing for making the timer interrupt occurrence interval accurate.

ます、このプリンタでは、第16図に示すように、マイ
コン81.82のハ1.. JE端子かI−)の信号を
174分周した信号、すなわ10μsecの外部クロッ
クパルスを端子T1に入力して、WS21図に示すカウ
ンタに入力している。
First, in this printer, as shown in FIG. 16, the microcontroller 81. .. A signal obtained by frequency-dividing the signal at the JE terminal (I-) by 174, that is, a 10 μsec external clock pulse, is input to the terminal T1 and input to the counter shown in the WS21 diagram.

また、マイコン81 、 ’82のクリスタルとしてG
 M l−[Zを使用するので、マイコンは1人テップ
を2.5μsecで実行している。
Also, G as a crystal for microcomputer 81 and '82.
Since M l-[Z is used, the microcomputer executes a one-person step in 2.5 μsec.

そして、前述したようにタイマ/カウンタ(以下「タイ
マ」と称す)のカウンタ(第21図9は、第31図に示
すように、υJ期値X1(0011≦X≦F” F I
I )がらクロックパルスが人力さ71シるブσにイン
クリメンh (+’I ) サh、r l” F’ I
I J カIEJ r 0QIIJにオーバフローした
ときに、りfマ割込みか発生し、カウンタはrooll
」から引IjLきインクリメンl−(+1)される。
As mentioned above, the counter of the timer/counter (hereinafter referred to as "timer") (FIG. 21, 9, as shown in FIG. 31, υJ period value X1 (0011≦X≦F"
I ), the clock pulse is manually increased by 71 times σ.
I J KAIEJ r When 0QIIJ overflows, an interrupt occurs and the counter rolls.
'' is subtracted by IjL and incremented by l-(+1).

そこで、例えはI m5ec毎にタイマ割込みを発生さ
せるとすると、 l m5ec/ l Oμ5ec= l OOであるの
で、初期値Xは、 X = 25 G +1−100 = 157 (9D
 [1)となる。
For example, if a timer interrupt is generated every I m5ec, then l m5ec/ l Oμ5ec = l OO, so the initial value X is X = 25 G + 1-100 = 157 (9D
[1] becomes.

そこで、この初期値r 9 D II Jをプリセット
すると、第32図に示すように、roollJて夕・1
7割込みか発生し、前述したように7番地(ADD7)
からスタートして、A番地で次のタイマ値をセラ1−す
ると、その時点では既に10μsec経過しているので
、この時点でr 9 L) It jをセラ)・すると
、次のタイマ割込みはl+n5ecより10μsec長
くなる。
Therefore, if this initial value r 9 D II J is preset, as shown in FIG.
7 interrupt occurs, and as mentioned above, address 7 (ADD7)
Starting from 1-, the next timer value is set at address A. At that point, 10 μsec has already elapsed, so at this point, r 9 L) It j is set, then the next timer interrupt is set to l+n5ec. It is 10 μsec longer.

したがって、2回目以降の初期値Xを、9 D n +
 1 = 9 EIf とす九は、1 m5ec毎にタイマ割込みを発生させる
ことができる。
Therefore, the initial value X from the second time onwards is 9 D n +
1 = 9 EIf and 9 can generate a timer interrupt every 1 m5ec.

しかしながら、外部割込み中はその処理か終るまでタイ
マ割込みの処理を開始できない。
However, while an external interrupt is in progress, timer interrupt processing cannot be started until that processing is completed.

そのため、第36図に示すように、カウント値がr O
OLI Jになってタイマ割込みが発生したときに、外
部割込み中であれば、その外部割込み処理が終了したと
きに、カラン1−値がrxllJLこなっていたとする
と1次のタイマ割込み発生までの時間は、 1 ’Oμ5ecXx= L Oxμsec分1m5e
cよりも長くなり、所定の時間間隔でドライブパルスを
出力する等の処理かできなuAoそこで、第29図に示
したように、タイマ割込み終了夕曳理で、ます、カウン
タのカラン1−(直をn5’e出して、そのときのカウ
ント1直に応した)JJ III IIfi(タイマ値
)をタイマのカウンタにセラ1−する処理をする。
Therefore, as shown in FIG. 36, the count value is r O
When OLI J is activated and a timer interrupt occurs, if an external interrupt is in progress, the time until the first timer interrupt occurs if the callan 1-value is rxllJL when the external interrupt processing is completed. is 1'Oμ5ecXx= L Oxμsec min 1m5e
Therefore, as shown in FIG. 29, when the timer interrupt ends, the counter starts running 1-( A process is performed in which a value of 1 (timer value) corresponding to the count 1 at that time is output to the counter of the timer.

すなわち、前述の例で説明すると、第54図に示すよう
に、カラン1〜値r X II Jて外部割込みか終了
して、タイマ割込み処理を開始し、例えば4ステツプ(
カラン1−値てro]IIJ)て必要な処Jqj lf
i終了シ(x II −1−I II <1) II’
、’j、+、”、j) 、カウント値の読出しにカウン
ト値で「α11」(処理時間/10μsec )要し、
その「αl目の終りの時点でvJ 1tJI値を設定す
るとすAしは、 9 D II + x II + I II + a 
IIを初期値としてセットする。
That is, to explain using the above-mentioned example, as shown in FIG.
Karan 1 - value ro] IIJ) and the necessary place Jqj lf
i end (x II -1-I II <1) II'
,'j,+,'',j), "α11" (processing time/10 μsec) is required for reading the count value,
If we set the vJ 1tJI value at the end of the αlth period, then A is 9 D II + x II + I II + a
Set II as the initial value.

それによって、次のタイマ割込み発生までの時間が、r
 9 D H十x II + I II十αHJ分短く
なるので、前回の割込み発生から1 m5ec経過した
ときに次のタイマ割込みが発生する。
As a result, the time until the next timer interrupt occurs becomes r
9 DH x II + I II x αHJ, so the next timer interrupt occurs when 1 m5ec has elapsed since the previous interrupt occurred.

したがって、正確な時間間隔でタイマ割込みを発生させ
ることができる。
Therefore, timer interrupts can be generated at accurate time intervals.

第65図は、サーボモータの速度制御とドライブ(リボ
ンドラ・rブ9制御が競合した場合のマイコンの処理の
流れを示すフロー図及びサーボモータの速度変化の状態
を示すタイミングチャート図である。
FIG. 65 is a flow diagram showing the process flow of the microcomputer when the speed control of the servo motor and the drive (ribbon driver/r drive 9 control conflict), and a timing chart showing the state of the speed change of the servo motor.

なお、この図は、ドライブパルスの出力が必要なタイマ
割込みの発生時点及び速度変化が必要な外部割込みの発
生時点のみを示し、てあり、実際はこの間に前述したよ
うに1m5ec毎にタイマ割込みか発生し、また位置信
月P A又はF Bが入力される毎に外部割込みが発生
する。
Note that this diagram only shows the time point at which a timer interrupt occurs that requires the output of a drive pulse, and the time point at which an external interrupt that requires a speed change occurs; Furthermore, an external interrupt occurs every time the position signal P A or F B is input.

これを簡単に説明すると、メイル−チンでサーボモータ
の1−ライブ(速度V3)を開始した後、時点[0で、
タイマ割込みか発生してリボンドライブパルスの発生処
理をしているときに、その途中の時点t]で外部割込み
が発生すると、そのタイマ割込みを中断して外部割込み
処理を実行し1、速度v2に減速する処理をした後、中
断していたタイマ割込み処理に戻り、このタイマ割込み
処理が終了するとメインルーチンにリターンする。
To explain this simply, after starting the 1-live (speed V3) of the servo motor with mail-chin, at time point [0,
When a timer interrupt occurs and ribbon drive pulse generation processing is being performed, if an external interrupt occurs at time t], the timer interrupt is interrupted, external interrupt processing is executed, and the speed is set to 1 and speed v2. After performing the deceleration process, the process returns to the suspended timer interrupt process, and when the timer interrupt process is completed, the process returns to the main routine.

以後、内部(タイマ)割込みと外部割込みか競合したと
きには、外部割込みを優先して実行し、内部割込みのみ
のときは、内部割込みを天fFし、例えば、時点L2で
は速度■1に;威速処理し、時点[3でドライブパルス
の出力処理を開始し、その途中の時点E4てモータ停止
処理をした後、再度ドライブパルス出力処理に戻り、時
点[5てモータの停止確認処理をし、時点t6てドライ
ブパルスの出力処理をする。
From then on, when there is a conflict between an internal (timer) interrupt and an external interrupt, the external interrupt is executed with priority, and when there is only an internal interrupt, the internal interrupt is set to zero.For example, at time L2, the speed is set to 1; At time [3], the drive pulse output process is started, and at time E4, the motor is stopped. Then, the process returns to the drive pulse output process, and at time [5], the motor is confirmed to have stopped, and then At t6, drive pulse output processing is performed.

なお、モータのII¥正確;18は、セレクションセン
サ27¥fからモータ停止時に出力される位置信号とは
別の信号をチェックして行なう。
Incidentally, the motor II precision; 18 is performed by checking a signal different from the position signal output from the selection sensor 27 f when the motor is stopped.

このようにして、タイマ割込み処理中Cも夕1部割込み
を受イζ」け、またタ、イマ割込みの発生間隔は前述し
たように正確な時間間隔txで発生する。
In this way, the timer interrupt processing C also receives the evening interrupt, and the timer interrupts occur at accurate time intervals tx as described above.

このように、このプリンタの制御部を構成するマイコン
は、タイマ割込みを発生させるためのカウンタの初期値
を設定するときに、そのときのカウントに基づいて初期
値を設定するので、外部割込み処理中に内部割込み要求
が発生しても、正確な時間間隔で内部割込みを発生させ
ることができる。
In this way, when the microcomputer that makes up the control unit of this printer sets the initial value of the counter for generating a timer interrupt, it sets the initial value based on the count at that time. Even if an internal interrupt request occurs at any time, the internal interrupt can be generated at accurate time intervals.

そJしによって、ドライブ、ビジィ等のタイムシーケン
ス制御を正確に行なうことができる。
By doing so, time sequence control of drive, busy, etc. can be performed accurately.

また、実施例のように、内部割込み処理でスタックポイ
ンタを操作することによって、本来内部(タイマ)割込
み処理をしているときには外部割込みを受(=Jけて処
理できないにもががわらず、内部割込み処理中でも外部
割込を受rtJけて処理できる。なお、同様にして例え
ば内部割込み処理中の内部割込み処理、外部割込み処理
中の内部割込み処理や外部割込み処理をも可能にするこ
ともできる。
In addition, as in the example, by manipulating the stack pointer in internal interrupt processing, when an internal (timer) interrupt is originally being processed, the internal External interrupts can be received and processed even during interrupt processing.In addition, it is also possible to similarly enable internal interrupt processing during internal interrupt processing, internal interrupt processing during external interrupt processing, and external interrupt processing.

また、この発明を実施するマイコンも上記実施例のもの
に限るものではなく、例えば他のMcs−48フアミリ
ー(8748)、(8041)。
Further, the microcontroller implementing the present invention is not limited to the one of the above embodiments, but may also be used with other McS-48 families (8748) and (8041), for example.

(8741) 、(8021)、(8035j。(8741), (8021), (8035j.

(8039)にも実施でき、その他のマーfコンにも実
施できる。
(8039), and can also be implemented for other mark-cons.

また、プリンタの活字ホイールとして、活字を外周と内
周に二重に形成したダブル活字ホイールを使用する場合
には、活字ホイールの外周と内周とのいずれかを選択す
るシフ1−1りうイブとセレクションドライブとが競合
することになるが、上述と同様にして、シフトドライブ
制御を行なうことができる。
In addition, when using a double type wheel in which type is formed double on the outer and inner peripheries as the type wheel of the printer, there is a shifter 1-1 that selects either the outer or inner periphery of the type wheel. However, shift drive control can be performed in the same manner as described above.

さらにまた、」二記実施例では、この発明をプリンタの
制御部を構成するマイコンに実施した例について述べた
が、これに限るものではなく、復数の割込み制御が競合
する制御をする制御部に使用するマイコンのすべてに実
施できる。
Furthermore, in Embodiment 2, an example was described in which the present invention was implemented in a microcomputer that constitutes a control unit of a printer, but the present invention is not limited to this, and the present invention is not limited to this. It can be applied to all microcontrollers used in

勿−米一 以上説明したように、この発明によれば、外部割込み処
理を実行しているときに、ター17割込みが発生したと
きには、外部割込み処理終了後にタイマ割込み処理をす
るマイコンであっても、正確な時間隔でタイマ割込みを
発生させることができる。
As explained above, according to the present invention, when a timer interrupt occurs while executing external interrupt processing, even if the microcontroller performs timer interrupt processing after the external interrupt processing is completed, , it is possible to generate timer interrupts at precise time intervals.

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

第1図は、この発明の実施例を機能的に示すブロック図
、 第2図及び第3図は、この発明を実施したプリンタの一
例を示す外観斜視図及びその外筐部の分解斜視図、 第4図は、同しくその印字機構部の一例を示す平面図、 第5図及び第6図は、第4図のカセツ1〜ボイールの一
例を示す正面図及びその■−Vl線に70う断面図、 第7図は、第5図の活字ホイールの一例を示す正面図で
ある。 第8図乃至第12図は、それぞJLLi2Oキャリッジ
の側面図、側断面図7分解斜視図、要部拡大図及びカセ
ツi〜交換時の状態を示す側面図、 第13図は、プリンタの制御部を示すブロック図、第1
4V:21乃至第21図は、それぞれ第13図のマイク
ロコンピュータの説明に供するフロック11■成図、ブ
ロクラムメモリマツプ図、データメモリマツフ′図、ブ
゛ログラ11カウンタのテーク(I〜!成図、プロクラ
lトステータス・ワードのデータ構成図、ブロクラムカ
ウンタ・スタックの説明図2割込みロジックのブロック
構成図及びタイマ/カウンタのブロック構成図である。 第22図は、プリンタの動作の概要の説明に倶するフロ
ー1司、 第23図及び第24図は、第13図のマイクロコンピュ
ータが実行するボーム位置及びホ・r−ル種別判別動作
の一例を示すフロー図、第25図は、印字動作のタイミ
ンクの一例を示すタイミングチャー1〜14、 第26図、第27図及び第28図は、そ4℃、それ第1
6図のマイクロコンピュータのメインルーチン、タイマ
割込みルーチン及び外部割込みルーチンを示すフロー図
、 第29図は、第27図のタイマ割込み開始処理及びタイ
マ割込み終了処理の詳細を示すフロー図。 第60図は、第29図の説明に供するデータメモリマッ
プ図、 第31図乃至第64図は、それぞれタイマ値の設定処理
の説明に供するタイミングチャー1、図。 第35図は、第1乙図のマイクロコンピュータが実行す
るドライブ、ビジィ処理及びモータの速度制御処理の流
4tの一例を示すフロー図及びり・rミンクチャー1〜
図である。 11・・プラテン 21・・・キャリッジ22・・・カ
セツトポイール 23・・・活字ホイール25・・・印
字ハンマ 26・・・セレクションモー928・・・ス
ペースモータ 80・・・プリンタコン1−ロール回路81.82・・
・マイクロコンピュータ第2図 第3し・・ 第 4 、ツj 第 5 図 Σ引ヨ 6トゾ1 ■ 第°71)り 斧、15図 アドレス 第16図 /rVノへ 第22図 第23図 エアー処理 i・26図 メインルーチノヘ 不29図
FIG. 1 is a block diagram functionally showing an embodiment of the invention; FIGS. 2 and 3 are an external perspective view and an exploded perspective view of the outer casing of an example of a printer embodying the invention; FIG. FIG. 4 is a plan view showing an example of the printing mechanism, and FIGS. 5 and 6 are front views showing an example of the cassette 1 to boiler shown in FIG. 7 is a front view showing an example of the type wheel of FIG. 5; FIG. Figures 8 to 12 are a side view of the JLLi2O carriage, a side sectional view, an exploded perspective view, an enlarged view of the main parts, and a side view showing the state when replacing the cassette i. Figure 13 is the printer control. Block diagram showing parts, 1st
4V: 21 to 21 show the block 11 configuration diagram, block diagram memory map diagram, data memory map diagram, and block diagram 11 counter take (I~! configuration diagram), respectively, which serve to explain the microcomputer shown in FIG. Figure 22 is a data configuration diagram of a programmer status word, an explanatory diagram of a block counter stack, a block diagram of an interrupt logic, and a block diagram of a timer/counter. Flowchart 1 for explanation: FIGS. 23 and 24 are flowcharts showing an example of the Baume position and hole type discrimination operation executed by the microcomputer in FIG. 13; FIG. Timing charts 1 to 14, FIGS. 26, 27, and 28 showing examples of operation timing are shown at 4°C and 1st.
6 is a flowchart showing the main routine, timer interrupt routine and external interrupt routine of the microcomputer; FIG. 29 is a flowchart showing details of the timer interrupt start process and timer interrupt end process of FIG. FIG. 60 is a data memory map diagram for explaining FIG. 29, and FIGS. 31 to 64 are timing charts 1 and 1 for explaining the timer value setting process, respectively. FIG. 35 is a flowchart showing an example of the flow 4t of drive, busy processing, and motor speed control processing executed by the microcomputer in FIG.
It is a diagram. 11...Platen 21...Carriage 22...Cassette wheel 23...Type wheel 25...Printing hammer 26...Selection mode 928...Space motor 80...Printer controller 1-roll circuit 81.82...
・Microcomputer Fig. 2 Fig. 3... Fig. 4, Tsuj Fig. 5 Air treatment i/Fig. 26 Main routine flow Fig. 29

Claims (1)

【特許請求の範囲】 1一定周期のパルスをカウントするカウンタ牟オーバフ
ローしたときにタイマ割込みを発生すると共に、外部割
込み処理中に中に前記タイマ割込みが発生したときには
前記外部割込み処理終了後タ、イマ割込み処理をするマ
イクロコンピュータにおいて、前記タイマ割込み処理で
カウンタの初期値を設定するときに、この時の前記カウ
ンタの力ラン1−値に基づいてカウンタの初期値を設定
することを特徴とするマイクロコンピュータにおけるタ
イマ割込み処理方法。 2 前記タイマ割込み処理がプリンタのドライブ制御で
、前記外部割込み処理がプリンタのモータの速度制御で
ある特許請求の範囲第1項記載のマイクロコンピュータ
におけるタイマ割込み処理方法。
[Scope of Claims] A timer interrupt is generated when a counter that counts pulses of one fixed period overflows, and when the timer interrupt occurs during external interrupt processing, a timer interrupt is generated after the external interrupt processing is completed. A microcomputer that performs interrupt processing, wherein when setting the initial value of the counter in the timer interrupt processing, the initial value of the counter is set based on the power run 1-value of the counter at this time. A method for handling timer interrupts in computers. 2. The timer interrupt processing method in a microcomputer according to claim 1, wherein the timer interrupt processing is printer drive control, and the external interrupt processing is printer motor speed control.
JP58201059A 1983-10-28 1983-10-28 Timer interruption processing method in microcomputer Pending JPS6095635A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP58201059A JPS6095635A (en) 1983-10-28 1983-10-28 Timer interruption processing method in microcomputer
DE19843439560 DE3439560A1 (en) 1983-10-28 1984-10-29 Interrupt-processing method using a microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58201059A JPS6095635A (en) 1983-10-28 1983-10-28 Timer interruption processing method in microcomputer

Publications (1)

Publication Number Publication Date
JPS6095635A true JPS6095635A (en) 1985-05-29

Family

ID=16434699

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58201059A Pending JPS6095635A (en) 1983-10-28 1983-10-28 Timer interruption processing method in microcomputer

Country Status (1)

Country Link
JP (1) JPS6095635A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62109246U (en) * 1985-12-26 1987-07-11

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62109246U (en) * 1985-12-26 1987-07-11

Similar Documents

Publication Publication Date Title
JP3654101B2 (en) Game machine
US4096578A (en) Data system with microprocessor featuring multiplexed data transfer and repeat cycle driving arrangement
JPH0121718B2 (en)
US4224869A (en) Parallel line printer
US4489260A (en) Method of driving a stepping motor and a drive circuit thereof
US4277191A (en) Printer system having microprocessor control
JPS6095635A (en) Timer interruption processing method in microcomputer
EP1413448B1 (en) Tape printer
CA1130463A (en) Dot matrix character printer with variable speed control
US4681470A (en) Bidirectional serial printer
JPS6135980A (en) Paper feed control apparatus of dot printer
JPS60112475A (en) Printing-controlling method for printer
JPS6095634A (en) Interruption processing method in microcomputer
JPS6038169A (en) Microprogrammed controller for dot matrix serial printer
JP2552830B2 (en) Printer device with bar code printing function
JPH08238352A (en) Reel controller for slot machine
US4175488A (en) Printer
JPS6043528B2 (en) electronic typewriter
AU607258B2 (en) Automatic function control for an electronic typewriter
JP2867211B2 (en) Recorder and hitting start method in the recorder
JPS62158071A (en) Printer
JPS58148684A (en) Stop controller for motor
JP2633636B2 (en) Printer motor driver protection system
JPH03158249A (en) Printing control system for dot matrix serial printer
JPS6148360B2 (en)