JPH08263234A - Data receiver, control method for the same and printer using the same - Google Patents

Data receiver, control method for the same and printer using the same

Info

Publication number
JPH08263234A
JPH08263234A JP7067566A JP6756695A JPH08263234A JP H08263234 A JPH08263234 A JP H08263234A JP 7067566 A JP7067566 A JP 7067566A JP 6756695 A JP6756695 A JP 6756695A JP H08263234 A JPH08263234 A JP H08263234A
Authority
JP
Japan
Prior art keywords
data
received
pointer
receiving
setting
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.)
Granted
Application number
JP7067566A
Other languages
Japanese (ja)
Other versions
JP3327723B2 (en
Inventor
Noriyuki Suzuki
範之 鈴木
Masafumi Wataya
雅文 綿谷
Yoshiaki Kamuragi
義明 冠木
Sohei Tanaka
壮平 田中
Hiroshi Uemura
寛 植村
Nobuyuki Tsukada
伸幸 塚田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP06756695A priority Critical patent/JP3327723B2/en
Publication of JPH08263234A publication Critical patent/JPH08263234A/en
Application granted granted Critical
Publication of JP3327723B2 publication Critical patent/JP3327723B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Record Information Processing For Printing (AREA)

Abstract

PURPOSE: To improve the efficiency of reception processing by transferring data in a reception buffer to a memory without performing polling. CONSTITUTION: When the reception of data is started, those data are fetched into the reception buffer. When the data are received, a CPU investigates the contents in the reception buffer, namely, performs polling and when there are any data, length data at the prescribed position of received data are set to a register 26. Next, a comparator 27 is enabled and polling is stopped. Afterwards, the generation of a second interruption request is waited. During this waiting, data are successively received and when difference between a write pointer 17 and a read pointer 18, namely, the amount of received data is made equal with the register 26, a signal showing such a state is outputted from the comparator 27 and becomes the request of interruption to the CPU. When the interruption request is generated, the CPU reads data from the reception buffer and transfers them to a RAM.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、例えばパーソナルコン
ピュータ等のホスト装置と周辺装置間などでデータ伝送
を行う場合の、データ受信装置及びその制御方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data receiving device and a control method thereof when data is transmitted between a host device such as a personal computer and peripheral devices.

【0002】[0002]

【従来の技術】パーソナルコンピュータ等のホスト装置
と周辺装置間でデータを伝送するのに、例えば、周辺装
置がプリンタの場合は、セントロニクス社仕様のパラレ
ルI/F(以下、セントロニクスI/F)、モデムなど
の場合はRS−232C仕様のシリアルI/F(以下、
RS−232CI/F)が広く用いられているのは周知
の通りである。
2. Description of the Related Art For transmitting data between a host device such as a personal computer and a peripheral device, for example, when the peripheral device is a printer, a parallel I / F specified by Centronics (hereinafter, Centronics I / F), In the case of a modem etc., RS-232C serial I / F (hereinafter,
It is well known that RS-232C I / F) is widely used.

【0003】プリンタの場合の構成例が特開昭58−1
17036、特開平5−150914に開示されてい
る。図9を用いてこれら従来技術での伝送データの受信
動作について説明する。図中、1はCPU、2はRO
M、3はRAM、4はセントロニクスI/FやRS−2
32CI/F等の1バイト単位でデータ伝送を行うI/
F部、5はDMAコントローラ、6は印字部である。R
AM3上には、受信バッファ、印字バッファ、ライトポ
インタ、リードポインタとして用いられる領域が設定さ
れている。ライトポインタおよびリードポインタ(それ
ぞれプットポインタ、ゲットポインタと呼ぶ場合もあ
る。)はそれぞれ、受信バッファ領域のオフセットアド
レスを指定するものである。
A configuration example of a printer is disclosed in Japanese Patent Laid-Open No. 58-1.
17036 and JP-A-5-150914. The operation of receiving the transmission data in these conventional techniques will be described with reference to FIG. In the figure, 1 is a CPU, 2 is a RO
M, 3 RAM, 4 Centronics I / F and RS-2
I / F for transmitting data in 1-byte units such as 32 CI / F
F section, 5 is a DMA controller, and 6 is a printing section. R
Areas used as a reception buffer, a print buffer, a write pointer, and a read pointer are set on the AM3. The write pointer and the read pointer (sometimes called the put pointer and the get pointer, respectively) specify the offset address of the reception buffer area.

【0004】I/F4に外部のホスト装置からデータが
伝送されると、I/F4はCPU1に対して割込をかけ
る。CPU1は、当該割込処理の中でI/F4からデー
タを読出して受信バッファに格納するとともに、ライト
ポインタを1増加させる。一方、CPU1のメインのプ
ログラム部は、リードポインタが示す位置からデータを
取り込むとともに、リードポインタを1増加させる。ラ
イトポインタおよびリードポインタは、初めに0に初期
化されているので、メインおプログラム部はライトポリ
ンタとリードポインタを比較することで、受信バッファ
に未取り込のデータがあるか否かを判定する。
When data is transmitted to the I / F 4 from an external host device, the I / F 4 interrupts the CPU 1. The CPU 1 reads the data from the I / F 4 in the interrupt process, stores the data in the reception buffer, and increments the write pointer by 1. On the other hand, the main program unit of the CPU 1 fetches data from the position indicated by the read pointer and increments the read pointer by 1. Since the write pointer and the read pointer are initially initialized to 0, the main program section compares the write pointer with the read pointer to determine whether or not there is unacquired data in the reception buffer.

【0005】さて、受信バッファから取り込んだデータ
は、フォント展開等の処理を行なった後、印字バッファ
に転送する。印字バッファに必要なデータがそろった
ら、DMAコントローラ5によって、印字バッファ内の
データを印字部6にDMA転送して、印字を実行する。
The data fetched from the receive buffer is transferred to the print buffer after being subjected to processing such as font expansion. When all the necessary data is stored in the print buffer, the DMA controller 5 DMA-transfers the data in the print buffer to the printing unit 6 to execute printing.

【0006】上記割込処理の回数を軽減させる目的で、
伝送データを数バイトからなるFIFOメモリに一旦格
納し、該FIFOメモリが一杯になったらCPUに割込
を掛けて受信バッファに取り込む例が、特開平3−20
8121に開示されている。
For the purpose of reducing the number of times of the interrupt processing,
An example in which transmission data is temporarily stored in a FIFO memory consisting of several bytes, and when the FIFO memory is full, the CPU is interrupted and fetched in a reception buffer is disclosed in Japanese Patent Laid-Open No. 3-20.
8121.

【0007】さらに、伝送データがDMA転送で直接受
信バッファに転送し、上記割込処理をなくしてしまう方
法も考案されている。
Further, a method has been devised in which the transmission data is directly transferred to the reception buffer by DMA transfer and the above interrupt processing is eliminated.

【0008】それぞれの例は、伝送データを受信バッフ
ァに取り込む際の違いであり、受信バッファからデータ
を取り込む部分については、いずれの場合でも上述した
ライトポインタ、リードポインタによる方法を用いてい
る。
The respective examples are the differences in fetching the transmission data into the receiving buffer, and in any case, the method using the write pointer and the read pointer described above is used for the portion fetching the data from the receiving buffer.

【0009】[0009]

【発明が解決しようとする課題】さて上記従来技術で
は、受信バッファに格納したデータの取り込に関しては
受信バッファの状態をポーリングする必要があった。す
なわち、 1)リードポインタとライトポインタを読み込む。 2)両者を比較する。 3)リードポインタの値≠ライトポインタの値である場
合に、リードポインタが示す受信バッファのアドレスか
ら1バイトのデータを取り込み、次いでリードポインタ
を1増加させる。リードポインタの値=ライトポインタ
の値である場合には、取り込むべきデータがないので何
もしない。
In the above-mentioned prior art, it was necessary to poll the status of the receiving buffer for fetching the data stored in the receiving buffer. That is, 1) Read the read pointer and the write pointer. 2) Compare both. 3) When the value of the read pointer is not equal to the value of the write pointer, 1 byte of data is fetched from the address of the reception buffer indicated by the read pointer, and then the read pointer is incremented by 1. If the value of the read pointer is equal to the value of the write pointer, there is no data to be fetched and nothing is done.

【0010】という処理を、定期的に実行しなければな
らない。
The above process must be executed periodically.

【0011】このことは、伝送されるデータ量が比較的
少ない時はさほど問題とならないが、画像データなどの
ように、伝送されるデータ量が多くなった場合には、上
記の如き1バイトの伝送データ毎にポーリング動作を行
っていたのではCPUのオーバヘッドが大きくなりすぎ
て、実質的な通信速度の低下を招く原因となっていた。
この欠点は、図9に示したように単一のCPUで他の制
御の処理も行う装置においては、単に実質的な通信速度
が低下するだけでなく、当該オーバヘッドの時間分だけ
CPUパワーが浪費されてしまうので、結果として装置
全体の動作速度を低下させてしまう原因ともなってい
た。
This is not a serious problem when the amount of data to be transmitted is relatively small, but when the amount of data to be transmitted is large, such as image data, the 1-byte data as described above is used. If the polling operation is performed for each transmission data, the overhead of the CPU becomes too large, which causes a substantial decrease in communication speed.
This drawback is that, in a device in which a single CPU also performs other control processing as shown in FIG. 9, not only the actual communication speed is lowered, but also the CPU power is wasted for the time of the overhead. As a result, the operation speed of the entire apparatus is lowered.

【0012】本発明は上記従来技術の欠点に鑑みてなさ
れたものであり、ポーリング動作を行なわないでも伝送
データの取り込が可能なデータ受信装置の提供を目的と
する。
The present invention has been made in view of the above-mentioned drawbacks of the prior art, and an object of the present invention is to provide a data receiving apparatus capable of taking in transmission data without performing a polling operation.

【0013】[0013]

【課題を解決するための手段】及び[Means for Solving the Problems] and

【作用】上記目的を達成するために本発明のデータ受信
装置は次のような構成から成る。すなわち、データを受
信する受信手段と、前記受信手段により受信したデータ
を格納する格納手段と、前記受信手段によりデータの受
信が終了したことを判定する判定手段と、前記判定手段
による判定の結果に基づいて、前記格納手段に格納され
たデータの転送を要求する要求手段と、該要求手段によ
る要求に応じて、前記格納手段により格納されたデータ
を所定の記憶領域に転送する転送手段とを備える。
In order to achieve the above object, the data receiving apparatus of the present invention has the following configuration. That is, the receiving means for receiving the data, the storing means for storing the data received by the receiving means, the determining means for determining that the receiving means has finished receiving the data, and the result of the determination by the determining means. Based on the above, there is provided requesting means for requesting transfer of the data stored in the storing means, and transfer means for transferring the data stored in the storing means to a predetermined storage area in response to a request from the requesting means. .

【0014】あるいは、データを受信する受信手段と、
受信しようとするデータ長を設定する設定手段と、前記
受信手段により受信したデータを格納する格納手段と、
前記設定手段に設定されたデータ長と、受信したデータ
の量との一致を判定する判定手段と、該判定手段による
判定の結果に基づいて、前記格納手段に格納されたデー
タの転送を要求する要求手段と、該要求手段による要求
に応じて、前記格納手段により格納されたデータを、前
記設定手段に設定されたデータ長分まとめて所定の記憶
領域に転送する転送手段とを備える。
Alternatively, receiving means for receiving data,
Setting means for setting the data length to be received, storage means for storing the data received by the receiving means,
A determination unit that determines whether the data length set in the setting unit matches the amount of received data, and requests transfer of the data stored in the storage unit based on the result of the determination made by the determination unit. The data processing device further comprises requesting means and transfer means for collectively transferring the data stored in the storage means to a predetermined storage area for the data length set in the setting means in response to a request from the requesting means.

【0015】あるいは、制御用のCPUと、データを受
信するインターフェースと、受信したデータを格納する
受信バッファと、前記受信バッファ中の任意の位置を指
示する第1ポインタおよび第2ポインタと、前記インタ
ーフェースを介して受信したデータを、第1ポインタの
指示する位置に格納するとともに前記第1ポインタを格
納したデータ量に相当する値分増加させるデータ格納手
段と、前記受信バッファからデータが読み出された場
合、読み出されたデータ量に相当する値分、前記第2ポ
インタを増加させる第2ポインタ加算手段と、前記第1
ポインタの値と第2ポインタの値との差を求める残量算
出手段と、所望の値を設定し得るデータ長設定レジスタ
と、該データ長設定レジスタの設定値と前記残量算出手
段の出力値とを比較し、一致している場合、前記CPU
に対して割込を要求する割込み要求手段と、該割込み要
求手段による割込みを契機として、前記受信バッファよ
りデータを読み出して所定の記憶領域に転送する読み出
し手段とを備える。
Alternatively, a control CPU, an interface for receiving data, a reception buffer for storing the received data, a first pointer and a second pointer for pointing an arbitrary position in the reception buffer, and the interface. The data read via the receiving buffer is stored in the position designated by the first pointer, and the data is read from the receiving buffer. The data storing means increases the value corresponding to the amount of data stored in the first pointer. In this case, second pointer adding means for increasing the second pointer by a value corresponding to the read data amount; and the first pointer
Remaining amount calculating means for obtaining the difference between the pointer value and the second pointer value, a data length setting register for setting a desired value, a setting value of the data length setting register and an output value of the remaining amount calculating means. And if they match, the CPU
An interrupt requesting means for requesting an interrupt to the device, and a reading means for reading data from the reception buffer and transferring the data to a predetermined storage area when triggered by the interrupt by the interrupt requesting means.

【0016】また、本発明の印刷装置は次のような構成
から成る。すなわち、前記データ受信装置と、前記デー
タ受信装置により所定領域に転送されたデータを印刷出
力する印刷手段とを備える。
The printing apparatus of the present invention has the following structure. That is, it is provided with the data receiving device and a printing unit for printing out the data transferred to the predetermined area by the data receiving device.

【0017】また、本発明のデータ受信方法は次のよう
な構成から成る。すなわち、受信しようとするデータ長
を設定する設定工程と、受信したデータをメモリに格納
する格納工程と、前記設定工程に設定されたデータ長
と、受信したデータの量との一致を判定する判定工程
と、該判定工程による判定の結果に基づいて、前記メモ
リに格納されたデータの転送を要求する要求工程と、該
要求工程による要求に応じて、前記メモリに格納された
データを、前記設定工程に設定されたデータ長分、所定
の記憶領域に転送する転送工程とを備える。
The data receiving method of the present invention has the following configuration. That is, a setting step of setting the data length to be received, a storing step of storing the received data in a memory, and a determination of determining whether the data length set in the setting step and the amount of the received data match And a request step for requesting the transfer of the data stored in the memory based on the result of the determination by the step and the determination step, and the data stored in the memory is set according to the request by the request step. And a transfer step of transferring the data length set in the step to a predetermined storage area.

【0018】[0018]

【第1実施例】以下に本発明の実施例を説明する。図1
は本発明を実施したデータ受信装置を内蔵したプリンタ
装置のブロック図である。図中10はCPUで、装置全
体の制御を行うものであり、16ビット(2バイト)の
データバスと24ビット(16Mバイトのメモリ空間)
のアドレスバスとを有している。11はROM/RAM
で、ROM部にはプログラム、フォントデータなどが記
憶されており、RAM部は、印字バッファのほか各種作
業領域として利用する。12は印字部で、モータや印字
ヘッドおよびそれらを駆動する回路などから構成され
る。20はCPU10から任意に設定可能なタイマイン
ターバル回路で、その出力はCPU10ヘの第1の割込
要求信号としてCPUバスに接続される。当該割込要求
信号に対応する割込処理(以下タイマ割込みと呼ぶ。)
では、印字部12を制御するために必要な時間計測など
の計測処理等の他、受信バッファの状態を監視するため
の処理が行なわれる。13はセントロニクスI/Fに準
拠したパラレルI/Fである。16は受信バッファとし
て用いるRAMであり、本実施例の場合64Kバイトの
容量を有する。
[First Embodiment] An embodiment of the present invention will be described below. FIG.
FIG. 1 is a block diagram of a printer device incorporating a data receiving device embodying the present invention. Reference numeral 10 in the figure denotes a CPU, which controls the entire apparatus, and has a 16-bit (2-byte) data bus and 24-bit (16-Mbyte memory space).
Address bus. 11 is a ROM / RAM
The ROM section stores programs, font data, etc., and the RAM section is used as various work areas in addition to the print buffer. A printing unit 12 includes a motor, a print head, a circuit for driving them, and the like. Reference numeral 20 denotes a timer interval circuit which can be arbitrarily set by the CPU 10, and its output is connected to the CPU bus as a first interrupt request signal to the CPU 10. Interrupt processing corresponding to the interrupt request signal (hereinafter referred to as a timer interrupt)
Then, in addition to measurement processing such as time measurement necessary for controlling the printing unit 12, processing for monitoring the state of the reception buffer is performed. Reference numeral 13 is a parallel I / F conforming to the Centronics I / F. Reference numeral 16 denotes a RAM used as a reception buffer, which has a capacity of 64 Kbytes in this embodiment.

【0019】図1ではRAM素子をROM/RAM11
とRAM16の双方に具備しているが、1ユニットのR
AM素子のみで、システムを構成する場合は、ROM/
RAM11にはRAM素子を具備せず、RAM16だけ
を有するようにしても良い。この場合は、RAM16の
一部を受信バッファとして利用し、他の部分は各種作業
領域として用いる。14はDMAコントローラで、パラ
レルIN13に伝送データが到来した時に、RAM16
に当該伝送データをDMA転送するものである。また、
ROM/RAM11の印字バッファ部に必要なだけデー
タがそろった時に、当該データを印字部12の印字ヘッ
ド(不図示)にDMA転送する際にも使用する。
In FIG. 1, the RAM element is a ROM / RAM 11
It is equipped with both RAM and RAM16, but 1 unit of R
When configuring the system with only AM elements, ROM /
The RAM 11 may include only the RAM 16 without including the RAM element. In this case, a part of the RAM 16 is used as a reception buffer, and the other part is used as various work areas. Reference numeral 14 is a DMA controller, which when the transmission data arrives in the parallel IN 13, the RAM 16
The DMA transfer of the transmission data is performed. Also,
It is also used for DMA transfer of the data to the print head (not shown) of the printing unit 12 when the print buffer unit of the ROM / RAM 11 has enough data.

【0020】17および18は、それぞれカウンタ回路
等からなるライトポインタ、リードポインタである。上
記DMA転送は、DMAコントローラ14内に設定され
るベースアドレスにライトポインタ17がオフセットし
て指し示すアドレスに実施される。また、DMAコント
ローラ14が、伝送データをDMA転送する度毎にライ
トポインタ17のポインタ値が1増加するように構成さ
れている。15はデータレングス設定レジスタ26が含
まれた受信バッファ監視回路であり、ライトポインタ1
7とデータレングス設定レジスタ26の値との比較結果
に応じてCPU10に割込をかけるようになっている。
また、受信バッファ監視回路15には、受信バッファを
リードした時にリードポインタ18のポインタ値を1増
加する回路も含まれている。つまりライトポインタ17
とリードポインタ18とで、受信バッファとしていわゆ
るリングバッファが構成される。
Reference numerals 17 and 18 are a write pointer and a read pointer, each of which is composed of a counter circuit or the like. The DMA transfer is performed at an address pointed by the write pointer 17 offset from the base address set in the DMA controller 14. Further, the DMA controller 14 is configured so that the pointer value of the write pointer 17 is incremented by 1 every time the transfer data is DMA-transferred. Reference numeral 15 is a receive buffer monitoring circuit including a data length setting register 26, and a write pointer 1
The CPU 10 is interrupted according to the result of comparison between 7 and the value of the data length setting register 26.
The reception buffer monitoring circuit 15 also includes a circuit that increments the pointer value of the read pointer 18 by 1 when reading the reception buffer. That is, the write pointer 17
The read pointer 18 constitutes a so-called ring buffer as a reception buffer.

【0021】19はバッファフル判定回路で、受信バッ
ファのオーバフローを防止するために、ライトポインタ
17とリードポインタ18のポインタ値を比較してその
差が一定値以上になった時に、パラレルI/F13のB
USY信号をアサートして、ホスト装置からのさらなる
データの伝送を抑制する。より詳しくは、BUSY信号
をアサートしっぱなしにするのではなく、0.1秒〜1
秒毎に短時間だけネゲートするようになっている。これ
はBUSY信号を長時間アサートしたままにしておく
と、ホスト装置がタイマアウトを起してデータの伝送を
断念してしまうからである。従って上記一定値は、受信
バッファの総容量より若干小さめの値とする。本実施例
では受信バッファの総容量は64Kバイトであるから、
上記一定値は例えば62Kバイト=F800hと設定す
ればよい。受信バッファからのデータの取り込みが進行
して、両ポインタの差が所定値以下(例えば14Kバイ
ト=3800h)になったら、BUSY信号をネゲート
する。BUSY信号はこれ以外にも、CPU10からソ
フトウェアによって任意にアサート/ネゲートできる。
なお、BUSY信号に限らず、プリンタ装置からホスト
装置へ向かうすべてのステータス信号は、ハードウェア
が自動的に設定する意外に、CPU10からソフトウェ
アによって任意にアサート/ネゲートできるようになっ
ている。また装置立上げ時等に、CPU10からの指示
に基づいて、ライトポインタ17、リードポインタ18
を0に初期化できるようになっている。
A buffer full determination circuit 19 compares the pointer values of the write pointer 17 and the read pointer 18 in order to prevent overflow of the reception buffer, and when the difference exceeds a certain value, the parallel I / F 13 is provided. B
Assert the USY signal to prevent further data transmission from the host device. More specifically, rather than letting the BUSY signal remain asserted, 0.1 seconds to 1 second
It negates for a short time every second. This is because if the BUSY signal is left asserted for a long time, the host device causes a timer out and abandons data transmission. Therefore, the fixed value is set to a value slightly smaller than the total capacity of the reception buffer. In this embodiment, the total capacity of the receiving buffer is 64 Kbytes,
The above-mentioned fixed value may be set to, for example, 62 Kbytes = F800h. When the data acquisition from the reception buffer progresses and the difference between the two pointers becomes equal to or less than a predetermined value (for example, 14 Kbytes = 3800 h), the BUSY signal is negated. In addition to this, the BUSY signal can be arbitrarily asserted / negated by the CPU 10 by software.
Not only the BUSY signal but also all status signals from the printer device to the host device can be arbitrarily asserted / negotiated by the software from the CPU 10 in addition to being automatically set by the hardware. The write pointer 17 and the read pointer 18 are also based on an instruction from the CPU 10 when the device is started up.
Can be initialized to 0.

【0022】図2に受信バッファ監視回路15の詳細な
ブロック図を示す。図中、31はアドレスコンパレータ
で、CPUバス上でメモリをリードする動作があった時
に、リードポインタアドレス生成回路21の出力信号と
CPUバス上のアドレス信号とを比較し、両者が一致し
た時にハイレベルを論理積ゲート22へ出力する。
FIG. 2 shows a detailed block diagram of the reception buffer monitoring circuit 15. In the figure, reference numeral 31 is an address comparator, which compares the output signal of the read pointer address generation circuit 21 with the address signal on the CPU bus when there is an operation to read the memory on the CPU bus, and outputs a high signal when they match. The level is output to the AND gate 22.

【0023】リードポイントアドレス生成回路21は、
受信バッファベースアドレス設定回路23とリードポイ
ンタ18の出力を繋ぎ合わせて24ビットのアドレス信
号を作り出すものである。受信バッファとして64Kバ
イトの容量を持つ場合に、リードポインタ18(および
ライトポインタ17)のビット数は16ビットであるか
ら、受信バッファベースアドレス設定回路23では、残
りの上位8ビット分を設定し、両者を合成して24ビッ
ト分の信号を生成する。追加される8ビット分のアドレ
ス情報は、前述したDMAコントローラ14内に設定さ
れるベースアドレスの上位8ビットと同一のものであ
る。ここで受信バッファベースアドレス設定回路23に
設定するアドレス情報は、回路的に固定的なものであっ
てよいのであるが、RAM16のアドレス領域をはみ出
さない範囲において、CPU10から適宜設定できるよ
うにしてもよい。この場合、DMAコントローラ14内
に設定されるベースアドレスと対応がとれていなければ
ならない。
The read point address generation circuit 21
The reception buffer base address setting circuit 23 and the output of the read pointer 18 are connected to generate a 24-bit address signal. When the reception buffer has a capacity of 64 Kbytes, the number of bits of the read pointer 18 (and the write pointer 17) is 16 bits. Therefore, the reception buffer base address setting circuit 23 sets the remaining upper 8 bits, Both are combined to generate a 24-bit signal. The added 8-bit address information is the same as the upper 8 bits of the base address set in the DMA controller 14 described above. Here, the address information set in the reception buffer base address setting circuit 23 may be fixed in terms of the circuit. However, the address information can be set appropriately by the CPU 10 within a range that does not overflow the address area of the RAM 16. Good. In this case, it must correspond to the base address set in the DMA controller 14.

【0024】24はライトポインタ17とリードポイン
タ18のそれぞれのポインタ値が等しいか否かを比較す
るコンパレータで、等しくない時にハイレベルを論理積
ゲート22へ出力する。論理積ゲート22の出力はリー
ドポインタ18に接続されている。リードポインタ18
では、論理積ゲート22の出力信号の立上がりエッジに
同期してポインタ値を1増加するようになっている。従
って、リードポインタ18は受信バッファに未取込みの
受信データがある場合に、受信バッファ中のリードポイ
ンタが指し示すアドレスへのリードアクセスの終了時点
でポインタ値が1増加し、受信バッファが空の場合には
ポインタ値は動かないようになっている。
Reference numeral 24 is a comparator for comparing whether the pointer values of the write pointer 17 and the read pointer 18 are equal, and outputs a high level to the AND gate 22 when they are not equal. The output of the AND gate 22 is connected to the read pointer 18. Read pointer 18
In the above, the pointer value is incremented by 1 in synchronization with the rising edge of the output signal of the AND gate 22. Therefore, the read pointer 18 increases by 1 at the end of the read access to the address pointed to by the read pointer in the receive buffer when there is unacquired receive data in the receive buffer, and when the receive buffer is empty. Does not move the pointer value.

【0025】25は、受信バッファの消費量を計算する
減算回路であり、具体的にはライトポインタ17のポイ
ンタ値からリードポインタ18のポインタ値を減算す
る。なお、リングバッファの性質上、演算の結果ボロー
が発生したか否かは関知しない。26はデータレングス
設定レジスタで、CPU10からアクセス可能な16ビ
ットのライトレジスタである。27は、減算回路25と
データレングス設定レジスタ26の出力値を比較するコ
ンパレータで、データレングス設定レジスタ26の設定
値が、減算回路25の出力値以上(等しいか、より大き
い)であるときに、ハイレベル信号を出力する。コンパ
レータ27は、コンパレータイネーブル設定レジスタ2
8を介して、CPU10からその動作のイネーブル/デ
ィスエーブルが設定できるようになっており、ディスエ
ーブルに設定されている時は比較結果に関わらず常にロ
ーレベル信号を出力する。29は、コンパレータ27の
出力の立上がりエッジでローレベルにセットされ、割込
要求信号クリアポート30からのクリア信号でハイレベ
ルにクリアされるフリップフロップ回路である。フリッ
プフロップ回路29の出力は、CPU10に対する第2
の割込要求信号(ローアクティブ)としてCPUバスに
接続される。割込要求信号ポート30は、CPU10か
ら当該ポートにアクセス(例:ダミーデータでのライト
動作)された時に、フリップフロップ回路28にクリア
信号、すなわちクリアパルスを1回出力するようになっ
ている。
Reference numeral 25 is a subtraction circuit for calculating the consumption amount of the reception buffer, and specifically, subtracts the pointer value of the read pointer 18 from the pointer value of the write pointer 17. Note that, due to the nature of the ring buffer, it does not care whether or not a borrow has occurred as a result of the operation. Reference numeral 26 is a data length setting register, which is a 16-bit write register accessible from the CPU 10. Reference numeral 27 is a comparator that compares the output values of the subtraction circuit 25 and the data length setting register 26. When the set value of the data length setting register 26 is equal to or greater than (equal to or greater than) the output value of the subtraction circuit 25, Output a high level signal. The comparator 27 is the comparator enable setting register 2
The operation can be enabled / disabled from the CPU 10 via 8, and when the operation is disabled, a low level signal is always output regardless of the comparison result. Reference numeral 29 is a flip-flop circuit which is set to a low level at the rising edge of the output of the comparator 27 and is cleared to a high level by a clear signal from the interrupt request signal clear port 30. The output of the flip-flop circuit 29 is the second output to the CPU 10.
The interrupt request signal (low active) is connected to the CPU bus. The interrupt request signal port 30 outputs a clear signal, that is, a clear pulse to the flip-flop circuit 28 once when the CPU 10 accesses the port (eg, a write operation with dummy data).

【0026】次に、図3および図4のフローチャートを
用いて全体の動作につき説明する。まず、初期化処理と
してステップS30でフリップフロップ回路29から出
力される第2の割込要求信号に対してはマスクを掛けて
おくと共にコンパレータ27をディスエーブルにする。
この状態で、パラレルI/F13にデータの伝送がある
と、DMAコントローラ14がRAM16(受信バッフ
ァ)の所定のアドレスにDMA転送する。CPU10
は、タイマ割込みでの割込処理でステップS31以下の
処理を実行する。
Next, the overall operation will be described with reference to the flow charts of FIGS. First, as initialization processing, the second interrupt request signal output from the flip-flop circuit 29 is masked and the comparator 27 is disabled in step S30.
When data is transmitted to the parallel I / F 13 in this state, the DMA controller 14 performs DMA transfer to a predetermined address of the RAM 16 (reception buffer). CPU10
Executes the processing after step S31 in the interrupt processing by the timer interrupt.

【0027】まずステップS31で受信バッファの状態
をポーリングし、受信バッファに取り込むべきデータが
存在した場合には、ステップS32でリードポインタ1
8のポインタ値が指し示すアドレスから、1バイトのデ
ータを読み込む。次にステップS33で当該データの種
別判定を行い、文字データであればステップS34で2
バイト文字コードの場合などに必要に応じてさらにもう
1バイト読み込み、ステップS35において当該文字デ
ータのフォント展開を行って、その結果をROM/RA
M11の印字バッファ112に書き込む。
First, in step S31, the state of the receiving buffer is polled, and if there is data to be taken into the receiving buffer, the read pointer 1 is read in step S32.
1-byte data is read from the address indicated by the pointer value of 8. Next, in step S33, the type of the data is determined.
In the case of a byte character code or the like, another byte is read if necessary, the font of the character data is expanded in step S35, and the result is stored in ROM / RA.
Write to the print buffer 112 of M11.

【0028】一方ステップS33において文字データ以
外と判定された場合は、ステップS36で続きのデータ
を1〜数バイト読み込み、ステップS37でコマンドデ
ータであるか画像データであるかを判定する。コマンド
データであればステップS38で続く数バイトのパラメ
ータ部を読み込み、ステップS39においてそのコマン
ドを実行する。受信バッファから取り込んだデータが、
文字および文字データの間は以上の処理を繰り返す。
On the other hand, if it is determined in step S33 that the data is not character data, the subsequent data is read in one to several bytes in step S36, and it is determined in step S37 whether it is command data or image data. If it is command data, the parameter portion of several bytes following is read in step S38, and the command is executed in step S39. The data acquired from the receive buffer is
The above process is repeated between characters and character data.

【0029】ところで、画像データの場合にはそのデー
タストリームのフォーマットは図5に示すように、先頭
に数バイトの画像データのヘッダ、次いでデータレング
ス(2バイト)、最後にビットマップの画像データとな
っている。なお、画像データストリームのフォーマット
は、上記以外のフォーマットであっても構わない。例え
ばデータレングスの部分は、画像データ部の画素数デー
タであってもよい。この場合、画素数データからデータ
レングスを算出することは非常に容易である。
In the case of image data, the format of the data stream is, as shown in FIG. 5, a header of image data of several bytes at the beginning, then a data length (2 bytes), and finally image data of bitmap. Has become. The format of the image data stream may be a format other than the above. For example, the data length portion may be pixel number data of the image data portion. In this case, it is very easy to calculate the data length from the pixel number data.

【0030】さて、取り込んだデータが画像データのヘ
ッダである場合は、ステップS40で続く2バイトのデ
ータレングスを読み込む。そしてステップS40で、こ
のデータレングスの内容をデータレングス設定レジスタ
26に書き込み、ステップS42でコンパレータ27の
動作をイネーブルにする。続いてステップS43で上記
ポーリング動作の停止を指示する。具体的にはROM/
RAM11上のRAM部に設定したポーリング動作フラ
グ111にオフを書き込んでおく。ポーリング動作フラ
グはタイマ割込み中に参照され、そのオン/オフにした
がってポーリング動作を行うか否かが決定される。もち
ろん、タイマ割込みをポーリング動作のためだけに用い
ているのであれば、タイマインターバル回路20からの
第1の割込要求信号そのものをマスクしてしまってもよ
い。最後にステップS44で第2の割込要求に対するマ
スクを解除する。この時点で、CPU10は受信バッフ
ァヘのポーリングを止め、他の処理に専念する。
If the fetched data is the header of the image data, the 2-byte data length that follows is read in step S40. Then, in step S40, the content of this data length is written in the data length setting register 26, and in step S42, the operation of the comparator 27 is enabled. Then, in step S43, an instruction to stop the polling operation is issued. Specifically, ROM /
Off is written in the polling operation flag 111 set in the RAM section on the RAM 11. The polling operation flag is referred to during the timer interrupt, and whether the polling operation is performed or not is determined according to its on / off. Of course, if the timer interrupt is used only for the polling operation, the first interrupt request signal itself from the timer interval circuit 20 may be masked. Finally, in step S44, the masking for the second interrupt request is released. At this point, the CPU 10 stops polling the reception buffer and concentrates on other processing.

【0031】画像データが全て、すなわち上記データレ
ングス分送信元から伝送されると、ライトポインタ17
の値がデータレングス設定レジスタにセットされた値と
同じになり、コンパレータ27が作用し、フリップフロ
ップ回路28を介してCPU10に対して第2の割込要
求信号が出力される。該割込要求信号を受けてCPU1
0は割込処理を開始する。その手順を図4に示す。
When all the image data, that is, the data length is transmitted from the transmission source, the write pointer 17
Becomes the same as the value set in the data length setting register, the comparator 27 operates, and the second interrupt request signal is output to the CPU 10 via the flip-flop circuit 28. CPU 1 receives the interrupt request signal
0 starts an interrupt process. The procedure is shown in FIG.

【0032】まずステップS50で割込要求信号クリア
ポートにダミーライトを行って、第2の割込要求信号を
クリアする。次いでステップS51で、受信バッファか
らデータレングス分のデータをブロック転送やDMA転
送など任意の方法でROM/RAM11に一気に取り込
む。すなわち受信バッファ中の画像データを印字バッフ
ァ部にそっくり転送してしまうわけである。そしてステ
ップS52で、コンパレータ27をディスエーブルに
し、ステップS53で上記割込要求のマスクを再度設定
する。最後にステップS54で、図3ステップS43で
オフにセットされたポーリング動作フラグ111をオン
にしてポーリング動作の再開を指示し、割込処理を終了
する。
First, in step S50, a dummy write is performed to the interrupt request signal clear port to clear the second interrupt request signal. Next, in step S51, the data of the data length is loaded from the reception buffer into the ROM / RAM 11 at once by an arbitrary method such as block transfer or DMA transfer. That is, the image data in the reception buffer is transferred to the print buffer unit. Then, in step S52, the comparator 27 is disabled, and in step S53, the mask of the interrupt request is set again. Finally, in step S54, the polling operation flag 111, which is set to OFF in step S43 of FIG. 3, is turned on to instruct restart of the polling operation, and the interrupt processing is ended.

【0033】ところで、以上の動作フローは、ステップ
S44で第2の割込要求のマスクを解除した時点で既に
すべての画像データが伝送され終わっていて受信バッフ
ァに格納されている場合でも全く問題なく動作する。こ
の場合、ステップS42でコンパレータ27をイネーブ
ルにした時点で、コンパレータ27の出力がハイレベル
になり、フリップフロップ回路29からローレベル信号
を出力する。すなわちステップS44で第2の割込要求
のマスクを解除すると、直ちにステップS50からの割
込処理が実行される。そして次のタイマ割込みでは、ポ
ーリング動作フラグ111がオンになっているから、ふ
たたび受信バッファの状態をポーリングするステップS
31からの処理が繰り返されるわけである。
By the way, the above operation flow causes no problem even if all the image data has already been transmitted and stored in the reception buffer when the masking of the second interrupt request is released in step S44. Operate. In this case, when the comparator 27 is enabled in step S42, the output of the comparator 27 becomes high level, and the flip-flop circuit 29 outputs a low level signal. That is, when the masking of the second interrupt request is released in step S44, the interrupt process from step S50 is immediately executed. Then, in the next timer interrupt, the polling operation flag 111 is turned on, so that the status of the receiving buffer is polled again in step S.
The processing from 31 is repeated.

【0034】以上説明してきたように本実施例によれ
ば、画像データのようにデータ量が大きくかつ事前にそ
のデータ量を知り得る場合には、受信バッファへのポー
リング動作を省略することができ、その分だけCPUの
オーバヘッドタイムをなくすことが可能となる。
As described above, according to this embodiment, when the data amount is large and it is possible to know the data amount in advance like the image data, the polling operation to the receiving buffer can be omitted. Therefore, the CPU overhead time can be eliminated accordingly.

【0035】[0035]

【第2実施例】第1実施例では、受信バッファの容量が
例えば64Kバイトであり、受信したデータの1ブロッ
クのサイズがこれを越える画像データを伝送しようとし
た場合は、画像データの伝送が終了した時に、割込みに
よりこれをCPU10に報知することができない。もち
ろん受信バッファの容量を増やし、ライトポインタ1
7、リードポインタ18、データレングス設定レジスタ
27などの関連レジスタ群のビット数を受信バッファの
容量にあわせれば、上記実施例の装置により大きな画像
データを伝送することは可能である。
[Second Embodiment] In the first embodiment, if the capacity of the reception buffer is, for example, 64 Kbytes and the size of one block of the received data exceeds that size, the image data will not be transmitted. When it is finished, the CPU 10 cannot be notified of this by an interrupt. Of course, increase the capacity of the receive buffer, write pointer 1
7. If the number of bits of the related register group such as 7, the read pointer 18 and the data length setting register 27 is matched with the capacity of the receiving buffer, it is possible to transmit large image data by the apparatus of the above embodiment.

【0036】しかしながら、受信バッファの容量を増や
すことは、当然装置のコストアップにつながるので、容
易に採用するというわけにはいかない場合もある。本実
施例は、この点に鑑みてなされたものであり、受信バッ
ファの容量を増やさずに、より大きな伝送データを取り
扱えるようにした。
However, increasing the capacity of the reception buffer naturally increases the cost of the apparatus, and therefore it may not be easy to adopt. The present embodiment has been made in view of this point, and is capable of handling larger transmission data without increasing the capacity of the reception buffer.

【0037】本実施例では、画像データのサイズは最大
16Mバイトにまで拡張されている。したがって図8に
示すとおり、画像データストリームのデータレングスフ
ィールドは3バイトに拡張されている。さて、図6およ
び図7のフローチャートを用いて本実施例での全体の動
作を説明する。
In this embodiment, the size of the image data is expanded up to 16 Mbytes. Therefore, as shown in FIG. 8, the data length field of the image data stream is extended to 3 bytes. Now, the overall operation of this embodiment will be described with reference to the flowcharts of FIGS. 6 and 7.

【0038】図6は第1実施例における図3ステップS
37以下に対応する部分のフローチャートである。ステ
ップS30からステップS39まではまったく同一であ
るので省略する。
FIG. 6 shows step S of FIG. 3 in the first embodiment.
It is a flowchart of the part corresponding to 37 or less. Since steps S30 to S39 are exactly the same, description thereof will be omitted.

【0039】ステップS37において画像データと判定
された場合は、ステップS60で続く3バイトのデータ
レングスを読み込む。そしてステップS61で当該画像
データの残量を計算する。ここではまだ1バイトも受信
バッファから取り込んでいないので残量はデータレング
スの値そのものである。ステップS62で上記残量が受
信バッファがバッファフルになるまでの最大容量すなわ
ちF800h(=62K)より大きいか否かを判定す
る。該最大容量以下である場合はステップS63でデー
タレングス設定レジスタ26に残量の値を設定する。一
方、上記最大容量を越える場合はステップS63でデー
タレングス設定レジスタ26に、最大容量の値、すなわ
ちF800hを設定する。そしてステップS63コンパ
レータ27をイネーブルにし、ステップS64でポーリ
ング動作の停止の指示をして、最後にステップS65で
上記第2の割込要求のマスクを解除する。
If it is determined in step S37 that the data is image data, the data length of 3 bytes is read in step S60. Then, in step S61, the remaining amount of the image data is calculated. Since 1 byte has not yet been fetched from the reception buffer here, the remaining amount is the data length value itself. In step S62, it is determined whether the remaining amount is larger than the maximum capacity until the reception buffer becomes full, that is, F800h (= 62K). If it is less than or equal to the maximum capacity, the value of the remaining amount is set in the data length setting register 26 in step S63. On the other hand, if the maximum capacity is exceeded, the maximum capacity value, that is, F800h is set in the data length setting register 26 in step S63. Then, the comparator 27 is enabled in step S63, an instruction to stop the polling operation is issued in step S64, and finally the masking of the second interrupt request is released in step S65.

【0040】図7は第2実施例における第2割込み要求
に対する割込処理のフローチャートである。割込処理で
は、まずステップS70で第2の割込要求信号をクリア
し、ステップS71でデータレングス設定レジスタ26
に設定した分だけ受信バッファからデータを取り込む。
そしてステップS72で残量を更新する。具体的には現
在の残量から上記設定していた分を差し引いた値を、新
しい残量とする。
FIG. 7 is a flowchart of the interrupt processing for the second interrupt request in the second embodiment. In the interrupt processing, first, the second interrupt request signal is cleared in step S70, and the data length setting register 26 is cleared in step S71.
Data will be fetched from the receive buffer for the amount set in.
Then, in step S72, the remaining amount is updated. Specifically, a value obtained by subtracting the set amount from the current remaining amount is set as the new remaining amount.

【0041】次いでステップS73で、更新した残量が
0か否かを判定する。0であればステップS74でコン
パレータ27をディスエーブルにし、ステップS75で
上記割込要求のマスクを再度設定する。
Next, in step S73, it is determined whether or not the updated remaining amount is zero. If it is 0, the comparator 27 is disabled in step S74, and the mask of the interrupt request is set again in step S75.

【0042】最後にステップS76で上記ポーリング動
作の再開を指示して、割込処理を終了する。
Finally, in step S76, the restart of the polling operation is instructed, and the interrupt processing is ended.

【0043】一方、更新した残量が0でない場合はステ
ップS77で係る残量と上記最大容量とを比較する。上
記残量が上記最大容量以上である場合は、ステップS7
8でデータレングス設定レジスタ26に最大容量の値を
設定し、割込処理を終了する。また、上記残量が上記最
大容量より小さい場合はステップS79でデータレング
ス設定レジスタ26に残量の値を設定し、割込処理を終
了する。要するに、伝送される画像データのサイズが最
大容量以下の場合は、第1実施例の場合と同様1回の割
込処理でデータは取り込まれるが、最大容量を越える場
合は最大容量(=62Kバイト)が受信バッファに溜ま
る毎に第2の割込がかかって、全体を何回かに分割して
画像データの取り込を行うわけである。
On the other hand, when the updated remaining capacity is not 0, the remaining capacity in step S77 is compared with the maximum capacity. If the remaining amount is equal to or more than the maximum capacity, step S7
At 8, the value of the maximum capacity is set in the data length setting register 26, and the interrupt processing ends. If the remaining amount is smaller than the maximum capacity, the value of the remaining amount is set in the data length setting register 26 in step S79, and the interrupt process ends. In short, when the size of the image data to be transmitted is less than the maximum capacity, the data is captured by one interrupt processing as in the case of the first embodiment, but when the size exceeds the maximum capacity, the maximum capacity (= 62 Kbytes). ) Is accumulated in the reception buffer, a second interrupt is applied, and the whole is divided into several times to capture the image data.

【0044】以上説明してきたように、本実施例によれ
ば具備している受信バッファの容量を越えた画像データ
を受領する場合でも、受信バッファヘのポーリング動作
を省くことが可能となる。
As described above, according to the present embodiment, it is possible to omit the polling operation to the receiving buffer even when the image data exceeding the capacity of the receiving buffer provided is received.

【0045】すなわち、実施例では、必要であれば受信
バッファへのポーリング動作を省略して伝送データを取
り込むことが可能となる。したがって、その分だけCP
Uのオーバヘッドタイムをなくすことができるので、結
果として実質的な通信速度の高速化が実現される。また
実施例のように単一のCPUで装置全体の制御を行う装
置にあっては、CPUを効率的に使用できるので、装置
全体の動作速度を向上させることができるという優れた
効果を有するものである。なお上記第1及び第2の実施
例では画像データを例に説明を行なったが、本発明はこ
れに限定されるわけではなくデータレングスがわかるの
であれば、文字データやコマンド情報の場合であっても
その効果に変りはない。またパラレルI/Fでなくシリ
アルI/Fであっても同様の効果が期待できる。さらに
本発明はプリンタ装置に好適であるが、必ずしもそれに
限定されるわけではなく、他の周辺装置あるいはホスト
装置に応用可能であることは言うまでもない。
That is, in the embodiment, if necessary, the transmission data can be fetched by omitting the polling operation to the reception buffer. Therefore, that much CP
Since the overhead time of U can be eliminated, a substantial increase in communication speed is realized as a result. Further, in a device in which a single CPU controls the entire device as in the embodiment, since the CPU can be used efficiently, it has an excellent effect that the operation speed of the entire device can be improved. Is. Although the first and second embodiments have been described by using the image data as an example, the present invention is not limited to this, and if the data length can be known, it may be the case of character data or command information. However, the effect is the same. The same effect can be expected even if the serial I / F is used instead of the parallel I / F. Furthermore, although the present invention is suitable for a printer device, it is needless to say that the present invention is not necessarily limited to this and can be applied to other peripheral devices or host devices.

【0046】尚、本発明は、複数の機器から構成される
システムに適用しても、1つの機器から成る装置に適用
しても良い。また、本発明はシステム或は装置にプログ
ラムを供給することによって達成される場合にも適用で
きることはいうまでもない。
The present invention may be applied to a system composed of a plurality of devices or an apparatus composed of a single device. Further, it goes without saying that the present invention can be applied to the case where it is achieved by supplying a program to a system or an apparatus.

【0047】[0047]

【発明の効果】以上説明したように、本発明に係るデー
タ受信装置は、ポーリング動作を行なわないでも伝送デ
ータの取り込みが可能であり、高速のデータ伝送を実現
できるという効果を奏する。
As described above, the data receiving apparatus according to the present invention has an effect that it is possible to take in transmission data without performing a polling operation and realize high-speed data transmission.

【0048】[0048]

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

【図1】本発明に係るデータ受信装置を内蔵したプリン
タ装置のブロック図である。
FIG. 1 is a block diagram of a printer device incorporating a data receiving device according to the present invention.

【図2】受信バッファ監視管理部の詳細なブロック図で
ある。
FIG. 2 is a detailed block diagram of a reception buffer monitoring management unit.

【図3】第1実施例での動作を説明するフローチャート
である。
FIG. 3 is a flowchart illustrating an operation in the first embodiment.

【図4】第1実施例での動作を説明するフローチャート
である。
FIG. 4 is a flowchart illustrating the operation of the first embodiment.

【図5】画像データストリームのフォーマットを説明す
る図である。
FIG. 5 is a diagram illustrating a format of an image data stream.

【図6】第2実施例での動作を説明するフローチャート
である。
FIG. 6 is a flowchart illustrating the operation of the second embodiment.

【図7】第2実施例での動作を説明するフローチャート
である。
FIG. 7 is a flowchart illustrating the operation of the second embodiment.

【図8】第2実施例での画像データストリームのフォー
マットを説明する図である。
FIG. 8 is a diagram illustrating a format of an image data stream in the second embodiment.

【図9】従来技術を説明する図である。FIG. 9 is a diagram illustrating a conventional technique.

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

10 CPU 11 ROM/RAM 12 印字部 13 パラレルI/F 14 DMAコントローラ 15 受信バッファ監視回路 16 RAM(受信バッファ) 17 ライトポインタ 18 リードポインタ 19 バッファフル判定回路 20 タイマインターバル回路 10 CPU 11 ROM / RAM 12 Printing Unit 13 Parallel I / F 14 DMA Controller 15 Reception Buffer Monitoring Circuit 16 RAM (Reception Buffer) 17 Write Pointer 18 Read Pointer 19 Buffer Full Judgment Circuit 20 Timer Interval Circuit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 田中 壮平 東京都大田区下丸子3丁目30番2号 キヤ ノン株式会社内 (72)発明者 植村 寛 東京都大田区下丸子3丁目30番2号 キヤ ノン株式会社内 (72)発明者 塚田 伸幸 東京都大田区下丸子3丁目30番2号 キヤ ノン株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Sohei Tanaka, 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon Inc. (72) Inventor, Hiroshi Uemura 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon Incorporated (72) Inventor Nobuyuki Tsukada 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon Inc.

Claims (20)

【特許請求の範囲】[Claims] 【請求項1】 データを受信する受信手段と、 前記受信手段により受信したデータを格納する格納手段
と、 前記受信手段によりデータの受信が終了したことを判定
する判定手段と、 前記判定手段による判定の結果に基づいて、前記格納手
段に格納されたデータの転送を要求する要求手段と、 該要求手段による要求に応じて、前記格納手段により格
納されたデータを所定の記憶領域に転送する転送手段と
を備えることを特徴とするデータ受信装置。
1. A receiving means for receiving data, a storing means for storing the data received by the receiving means, a determining means for determining that the receiving of the data has been completed by the receiving means, and a determination by the determining means. Requesting means for requesting the transfer of the data stored in the storing means based on the result of 1. and transfer means for transferring the data stored in the storing means to a predetermined storage area in response to the request from the requesting means. A data receiving apparatus comprising:
【請求項2】 前記判定手段は、前記受信手段により受
信したデータの長さを示すデータと、受信したデータの
量とを比較して受信の終了を判定することを特徴とする
請求項1に記載のデータ受信装置。
2. The determining means compares the data indicating the length of the data received by the receiving means with the amount of the received data to determine the end of reception. The data receiving device described.
【請求項3】 データを受信する受信手段と、 受信しようとするデータ長を設定する設定手段と、 前記受信手段により受信したデータを格納する格納手段
と、 前記設定手段に設定されたデータ長と、受信したデータ
の量との一致を判定する判定手段と、 該判定手段による判定の結果に基づいて、前記格納手段
に格納されたデータの転送を要求する要求手段と、 該要求手段による要求に応じて、前記格納手段により格
納されたデータを、前記設定手段に設定されたデータ長
分まとめて所定の記憶領域に転送する転送手段とを備え
ることを特徴とするデータ受信装置。
3. A receiving means for receiving data, a setting means for setting a data length to be received, a storage means for storing the data received by the receiving means, and a data length set in the setting means. Determining means for determining a match with the amount of received data, requesting means for requesting transfer of the data stored in the storing means based on the result of the determination by the determining means, and requesting by the requesting means. Accordingly, the data receiving device is provided with a transfer unit that collectively transfers the data stored by the storage unit to a predetermined storage area for the data length set by the setting unit.
【請求項4】 前記転送手段はCPUにより制御され、
前記要求手段は前記CPUに対する割込み要求であるこ
とを特徴とする請求項1乃至3いずれかに記載のデータ
受信装置。
4. The transfer means is controlled by a CPU,
4. The data receiving device according to claim 1, wherein the requesting unit is an interrupt request to the CPU.
【請求項5】 受信したデータの種別を判別する判別手
段と、受信データが画像データでない場合には受信デー
タの有無を検知しつつ前記所定の記憶領域に受信データ
を転送するポーリング手段とを更に備えることを特徴と
する請求項1乃至4いずれかに記載のデータ受信装置。
5. A determination means for determining the type of the received data, and a polling means for transferring the received data to the predetermined storage area while detecting the presence or absence of the received data when the received data is not image data. The data receiving device according to any one of claims 1 to 4, further comprising:
【請求項6】 前記設定手段により設定できるデータ長
が、受信しようとするデータ長よりも短い場合には、前
記設定手段により設定できるデータ長ずつ分割して転送
すべく制御する制御手段を更に備えることを特徴とする
請求項2乃至5いずれかに記載のデータ受信装置。
6. When the data length that can be set by the setting means is shorter than the data length to be received, the control means further controls to divide and transfer the data length that can be set by the setting means. The data receiving device according to any one of claims 2 to 5, wherein
【請求項7】 受信しようとするデータ長を設定する設
定工程と、 受信したデータをメモリに格納する格納工程と、 前記設定工程に設定されたデータ長と、受信したデータ
の量との一致を判定する判定工程と、 該判定工程による判定の結果に基づいて、前記メモリに
格納されたデータの転送を要求する要求工程と、 該要求工程による要求に応じて、前記メモリに格納され
たデータを、前記設定工程に設定されたデータ長分、所
定の記憶領域に転送する転送工程とを備えることを特徴
とするデータ受信方法。
7. A setting step of setting a data length to be received, a storing step of storing the received data in a memory, and a matching of the data length set in the setting step with the amount of the received data. A determination step of determining, a request step of requesting transfer of the data stored in the memory based on a result of the determination in the determination step, and a data stored in the memory in response to the request of the request step. And a transfer step of transferring the data length set in the setting step to a predetermined storage area.
【請求項8】 前記転送工程はCPUにより制御され、
前記要求工程は前記CPUに対する割込み要求であるこ
とを特徴とする請求項7に記載のデータ受信方法。
8. The transfer process is controlled by a CPU,
8. The data receiving method according to claim 7, wherein the request step is an interrupt request to the CPU.
【請求項9】 受信したデータの種別を判別する判別工
程と、受信データが画像データでない場合には受信デー
タの有無を検知しつつ前記所定の記憶領域に受信データ
を転送するポーリング工程とを更に備えることを特徴と
する請求項7乃至8いずれかに記載のデータ受信方法。
9. A determination step of determining the type of the received data, and a polling step of transferring the received data to the predetermined storage area while detecting the presence or absence of the received data when the received data is not image data. The data receiving method according to claim 7, further comprising:
【請求項10】 前記設定工程により設定できるデータ
長が、受信しようとするデータ長よりも短い場合には、
前記設定工程により設定できるデータ長ずつ分割して転
送すべく制御する制御工程を更に備えることを特徴とす
る請求項7乃至9いずれかに記載のデータ受信方法。
10. If the data length that can be set in the setting step is shorter than the data length to be received,
10. The data receiving method according to claim 7, further comprising a control step of controlling so as to divide and transfer the data length that can be set by the setting step.
【請求項11】 請求項1乃至6いずれかに記載のデー
タ受信装置と、 前記データ受信装置により所定領域に転送されたデータ
を印刷出力する印刷手段とを備えることを特徴とする印
刷装置。
11. A printing apparatus, comprising: the data receiving apparatus according to claim 1; and a printing unit that prints out the data transferred to a predetermined area by the data receiving apparatus.
【請求項12】制御用のCPUと、 データを受信するインターフェースと、 受信したデータを格納する受信バッファと、 前記受信バッファ中の任意の位置を指示する第1ポイン
タおよび第2ポインタと、 前記インターフェースを介して受信したデータを、第1
ポインタの指示する位置に格納するとともに前記第1ポ
インタを格納したデータ量に相当する値分増加させるデ
ータ格納手段と、 前記受信バッファからデータが読み出された場合、読み
出されたデータ量に相当する値分、前記第2ポインタを
増加させる第2ポインタ加算手段と、 前記第1ポインタの値と第2ポインタの値との差を求め
る残量算出手段と、 所望の値を設定し得るデータ長設定レジスタと、 該データ長設定レジスタの設定値と前記残量算出手段の
出力値とを比較し、一致している場合、前記CPUに対
して割込を要求する割込み要求手段と、 該割込み要求手段による割込みを契機として、前記受信
バッファよりデータを読み出して所定の記憶領域に転送
する読み出し手段と、 を備えることを特徴とするデータ受信装置。
12. A control CPU, an interface for receiving data, a reception buffer for storing the received data, a first pointer and a second pointer for pointing an arbitrary position in the reception buffer, and the interface. The data received via
Data storage means for storing the data at the position indicated by the pointer and increasing the first pointer by a value corresponding to the stored data amount, and when the data is read from the reception buffer, corresponds to the read data amount. A second pointer adding means for increasing the second pointer by an amount corresponding to the value, a remaining amount calculating means for calculating a difference between the value of the first pointer and the value of the second pointer, and a data length capable of setting a desired value. The setting register, the setting value of the data length setting register and the output value of the remaining amount calculating means are compared, and if they match, an interrupt requesting means for requesting an interrupt to the CPU, and the interrupt request A data receiving device comprising: a reading unit that reads data from the reception buffer and transfers the data to a predetermined storage area when an interruption by the unit is triggered.
【請求項13】 前記第1ポインタと第2ポインタとを
比較することにより前記受信バッファ中のデータの有無
を調べ、データがあれば受信バッファから伝送データを
取り込むポーリング手段と、受信データの種類に応じて
前記ポーリング手段によるデータの取り込み停止するポ
ーリング停止手段とを更に備え、ポーリングを停止した
場合には前記割込み要求手段によりデータの読み出しを
行うべく制御することを特徴とする請求項12記載のデ
ータ受信装置。
13. A polling means for checking the presence / absence of data in the reception buffer by comparing the first pointer and the second pointer, and if there is data, polling means for fetching transmission data from the reception buffer. 13. The data according to claim 12, further comprising polling stop means for stopping data acquisition by the polling means, and controlling the interrupt request means to read data when polling is stopped. Receiver.
【請求項14】 前記データ長設定レジスタに設定する
値は、伝送データの長さ情報に基づく値であることを特
徴とする請求項12または13に記載のデータ受信装
置。
14. The data receiving apparatus according to claim 12, wherein the value set in the data length setting register is a value based on length information of transmission data.
【請求項15】 前記データ長設定レジスタに設定する
値は、受信バッファの実質的最大容量であることを特徴
とする請求項12または13いずれかに記載のデータ受
信装置。
15. The data receiving apparatus according to claim 12, wherein the value set in the data length setting register is a substantially maximum capacity of the receiving buffer.
【請求項16】 DMA転送を制御するDMA転送手段
を更に備え、前記インターフェースを介して受信したデ
ータは、前記DMA転送手段により前記受信バッファに
転送されることを特徴とする請求項12乃至15いずれ
かに記載のデータ受信装置。
16. The method according to claim 12, further comprising DMA transfer means for controlling DMA transfer, wherein the data received via the interface is transferred to the reception buffer by the DMA transfer means. The data receiving device as described in 1.
【請求項17】 前記インターフェースはパラレルI/
Fであることを特徴とする請求項12乃至16いずれか
に記載のデータ受信装置。
17. The interface is parallel I /
17. The data receiving device according to claim 12, wherein the data receiving device is F.
【請求項18】 前記インターフェースはシリアルI/
Fであることを特徴とする請求項12乃至16いずれか
に記載のデータ受信装置。
18. The interface is a serial I / O
17. The data receiving device according to claim 12, wherein the data receiving device is F.
【請求項19】 当該データ受信装置はプリンタ装置に
内蔵されるものであることを特徴とする請求項12乃至
18いずれかに記載のデータ受信装置。
19. The data receiving device according to claim 12, wherein the data receiving device is built in a printer device.
【請求項20】 当該データ受信装置はホスト装置に内
蔵されるものであることを特徴とする請求項12乃至1
8いずれかに記載のデータ受信装置。
20. The data receiving device is built in a host device.
8. The data receiving device according to any one of 8.
JP06756695A 1995-03-27 1995-03-27 Data receiving apparatus, control method therefor, and printing apparatus using the same Expired - Fee Related JP3327723B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP06756695A JP3327723B2 (en) 1995-03-27 1995-03-27 Data receiving apparatus, control method therefor, and printing apparatus using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP06756695A JP3327723B2 (en) 1995-03-27 1995-03-27 Data receiving apparatus, control method therefor, and printing apparatus using the same

Publications (2)

Publication Number Publication Date
JPH08263234A true JPH08263234A (en) 1996-10-11
JP3327723B2 JP3327723B2 (en) 2002-09-24

Family

ID=13348646

Family Applications (1)

Application Number Title Priority Date Filing Date
JP06756695A Expired - Fee Related JP3327723B2 (en) 1995-03-27 1995-03-27 Data receiving apparatus, control method therefor, and printing apparatus using the same

Country Status (1)

Country Link
JP (1) JP3327723B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1727361A2 (en) * 2005-05-27 2006-11-29 Samsung Electronics Co.,Ltd. Digital broadcasting reception terminal and method for processing digital broadcasting data using the same
JP2013214168A (en) * 2012-03-30 2013-10-17 Fujitsu Ltd Information processing apparatus, arithmetic unit and information transfer method
JP2016021123A (en) * 2014-07-14 2016-02-04 株式会社デンソー Microcomputer

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1727361A2 (en) * 2005-05-27 2006-11-29 Samsung Electronics Co.,Ltd. Digital broadcasting reception terminal and method for processing digital broadcasting data using the same
EP1727361A3 (en) * 2005-05-27 2009-03-04 Samsung Electronics Co.,Ltd. Digital broadcasting reception terminal and method for processing digital broadcasting data using the same
JP2013214168A (en) * 2012-03-30 2013-10-17 Fujitsu Ltd Information processing apparatus, arithmetic unit and information transfer method
US9003082B2 (en) 2012-03-30 2015-04-07 Fujitsu Limited Information processing apparatus, arithmetic device, and information transferring method
JP2016021123A (en) * 2014-07-14 2016-02-04 株式会社デンソー Microcomputer

Also Published As

Publication number Publication date
JP3327723B2 (en) 2002-09-24

Similar Documents

Publication Publication Date Title
EP0386935B1 (en) Apparatus capable of varying number of wait states for access
US4638428A (en) Polling control method and system
US5287471A (en) Data transfer controller using direct memory access method
KR100349791B1 (en) Semiconductor integrated circuit device
JP3020699B2 (en) Printing equipment
JP3327723B2 (en) Data receiving apparatus, control method therefor, and printing apparatus using the same
US6952276B2 (en) Printer detecting data precisely in response to change in data transmission speed
CA2289192C (en) Communication dma device
JP3276844B2 (en) Multi-function peripheral
EP0410382A2 (en) Data transfer controller using direct memory access method
JPH1063617A (en) Serial communication device
JP3585052B2 (en) Interface control device
JP2835487B2 (en) Printer buffer
JP3268644B2 (en) DMA controller
JP3199624B2 (en) Facsimile machine
JP2765267B2 (en) Direct memory access transfer controller
JP3787869B2 (en) Terminal device
JPH0962613A (en) Data transfer device
JP2691031B2 (en) Memory controller
JPH11184646A (en) Printer interface device and control method
JPH0561617A (en) Printing control system
JPH03294951A (en) High speed data transfer system in personal computer system
JPS6012668B2 (en) Direct memory access device interface circuit
JPH02299052A (en) Dma controller
JP2005100247A (en) Dma controller

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20020617

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

Free format text: PAYMENT UNTIL: 20080712

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20080712

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090712

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090712

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100712

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100712

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110712

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20120712

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20120712

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20130712

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees