Abstract:
An n-byte buffer is able to store n bytes of data. A interrupt request signal generating circuit interrupts the processor of the peripheral apparatus after receiving the nth byte of the data. Accordingly, only one interrupt operation is needed to receive and input n bytes of data. Consequently, the number of interrupt operations is reduced and the data processing speed is improved.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to a parallel interface circuit for communicating data between a external host computer and a processor of a peripheral apparatus. Specifically, this invention relates to using the parallel interface circuit with an internal C.P.U. in a information processing apparatus such as a printer, the parallel interface circuit provided in the information processing apparatus. More particularly, this invention relates to a parallel interface circuit providing improve receiving data speed. 
     2. Description of the Related Art 
     Heretofore, a parallel interface circuit, provided, for example, in a printer, a calculator, an office automation machine, etc., for providing data communication between an external host computer and an internal C.P.U. in an information processing apparatus is well known. The internal C.P.U. receives data from the external host computer through this conventional parallel interface circuit one byte at a time. 
     When a strobe signal is input, a receiving circuit of the information processing apparatus latches 1 byte of data, a interrupt request signal is input to the internal C.P.U., and a busy signal is output to the host computer. Subsequently, the internal C.P.U. receives the data from the host computer by executing an interrupt process, and then cancelling the busy signal and outputting a acknowledge signal to the host computer. Subsequent data bytes are received by repeating this process. 
     However, the information processing apparatus provided with the conventional parallel interface circuit is not able to receive data at high speed. Thus, the processing speed is low because the internal C.P.U. receives data from the host computer in 1 byte units. Information processing apparatus with improved processing speed appear in the market in succession with the progress of high speed technology of the internal C.P.U. Nevertheless, even if the width of the internal data bus of the information apparatus is 16 bits or 32 bits, because the reception unit at the parallel interface circuit can receive only a 1 byte unit, only 8 bits of the 16- or 32-bit-wide data bus are used and thus the internal data bus is not effectively used. 
     SUMMARY OF THE INVENTION 
     This invention thus overcomes the above and other deficiencies and disadvantages of the conventional parallel interface circuit, by providing a parallel interface circuit enabling speed high data reception. 
     According to one embodiment of the invention, a parallel interface circuit is provided in the information processing apparatus for communicating data between an internal C.P.U. of the information processing apparatus and an external host computer comprising: a handshake signal generating circuit generating a handshake signal indicating data reception corresponding to a strobe signal from the host computer; data storing means for storing more than two 1-byte units of data received from the host computer; an interrupt request signal generating circuit generating and outputting an interrupt request signal to the internal C.P.U. when the data stored in the data storing means fills the data storing means. 
     In a second embodiment of the invention, a parallel interface circuit as described above is provided, wherein said interrupt request circuit generates and outputs an interrupt request signal to the internal C.P.U. when the next byte of data is not stored within a predetermined time period from the time the current byte of data is stored in the data storing means, even if the received bytes of data do not fill the data stored means. 
     More generally, the parallel interface circuit can be used between the host computer and the peripheral processor of any peripheral device connectable to the host computer. 
     In the operation of the first embodiment of the invention, when the C.P.U. inside the information processing apparatus receives the data from the external host computer, the strobe signal is input to the parallel interface circuit from the host computer. Then, the handshake generating circuit generates the handshake signal, which indicates the reception of the data corresponding to the strobe signal, and outputs it to the host computer. Further, the data received from the host computer is stored in the data storing means, which has a storage capacity of at least 2 bytes. When the data stored in the data storing means reaches the capacity of the data storing means, the interrupt request circuit generates and outputs the interrupt request signal to the internal C.P.U. 
     For example, when the data storing means is capable of storing 4 bytes, the data is received sequentially from the host computer. Only after the 4th byte of the data is received does the interrupt request circuit starts to interrupt the internal C.P.U. Therefore, the internal C.P.U. receives all 4 bytes of the data at once. 
     Thus, only one interrupt operation is needed to receive and input 4 bytes of the data. Accordingly, the number of receiving operations is reduced and the speed of the data processing is improved. Moreover, in the conventional apparatus, the interrupt operation occurred after each byte of data was received, and after receiving the byte of data, the internal C.P.U. sent a handshake signal such as a busy signal or a acknowledge signal by a software procedure to the host device. However, the above apparatus of this invention sends only the handshake signal from the handshake generating circuit in response to the strobe signal until the fourth byte of the data is received. Thus, improvement in the data processing speed is achieved by this apparatus. 
     In the second embodiment of the invention, the interrupt request circuit generates and outputs an interrupt request signal to the internal C.P.U. when the next byte of data is not stored within a predetermined time period after the current byte of data was stored in the data storing means, even if the number of bytes of data received from the host computer doesn&#39;t fill the data storing means. When the internal C.P.U. sends the data after, for example, 4 bytes of data is stored in the data storing means, this second embodiment of the invention prevents the data processing speed from becoming low, by avoiding waiting for the next byte of data when only 1-3 bytes of data have been received from the host computer. 
     That is, after 1-3 bytes of data are stored, without the next byte of data being received, the interrupt operation of the internal C.P.U. is started once the predetermined time period elapses. Accordingly, for example, if 10 bytes of data are received, after the transmitting operations to the internal C.P.U, after the 4th and 8th bytes of data are performed, only 2 additional bytes of data are transmitted to the internal C.P.U. Thus, after the predetermined time period elapses, the interrupt process is performed, even if no data after the last 2 bytes of data is received or stored. 
     In other words, the parallel interface circuit of this embodiment generates and outputs the interrupt request signal to the C.P.U. even if the data storing means is not filled, when the next byte of data is not stored within the predetermined time period after the current byte of data is stored. By doing this, if the number of bytes of data from the host computer is not an exact multiple of n when using an n-byte data storage means, it prevents an unnecessary wait for the next byte of data and thus prevents unnecessarily delaying the data processing. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The preferred embodiments of the present invention will be described in detail with the reference to the figures, wherein: 
     FIG. 1 shows a parallel interface circuit of this invention; 
     FIG. 2 is a timing chart indicating the operation of a parallel interface circuit when the 1st byte of the data is input; 
     FIG. 3 is a timing chart indicating the operation of a parallel interface circuit when the 4th byte of the data is input; and 
     FIG. 4 is a timing chart indicating the operation of a parallel interface circuit when the 5th byte of the data is input. 
    
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
     A preferred embodiment of the invention will now be described with reference to the accompanying drawings. FIG. 1 is a construction of a parallel interface circuit of the embodiment of this invention. 
     A parallel interface circuit 1 is provided in a information processing apparatus, such as a printer, to communicate data between a internal C.P.U. 50 of the information processing apparatus and an external host computer 60. The parallel interface circuit 1 comprises a buffer selector 11, a 4-byte buffer 13, a busy signal generating circuit 15, a first busy counter 17, a second busy counter 19, acknowledge signal generating circuit 25, a first acknowledge counter 27, a second acknowledge counter 29, an interrupt request signal generating circuit 31, a timeout counter 33 and a counter control circuit 35. 
     The buffer selector 11 is connected to the host computer 60 through a parallel data bus 37, and selects one byte of the 4-byte buffer 13 by the order of the data input from the host computer 60. 
     A strobe signal from the host computer 60 is input to the buffer selector 11 and a counter control circuit 35 when the host computer 60 wants to output a byte of data to the information processing apparatus. Then, a busy signal from the busy signal generating circuit 15 and an acknowledge signal from the acknowledge signal generating circuit 25 are sent as handshake signals to the host computer 60 signal to acknowledge receipt of the data byte from the host computer 60. 
     The busy signal generating circuit 15 is connected to the first busy counter 17 and the second busy counter 19. The acknowledge signal generating circuit 25 is connected to the first acknowledge counter 27 and the second acknowledge counter 29. These counters 17, 19, 27, 29 generate timing signals which change the busy signal and the acknowledge signal from &#34;0&#34; to &#34;1&#34; or from &#34;1&#34; to &#34;0&#34;. 
     The 4-byte buffer 13 comprises first through fourth byte-buffers 41-43 which store data byte-by-byte and a data register 45 which indicates what byte number of the data is currently being input. This 4-byte buffer 13 is connected to the C.P.U. 50 through a 32-bit internal data bus 51. After all data inputs to the first through fourth byte-buffers 41-44 is completed, the 4-byte buffer 13 outputs a input complete signal to the interrupt request generating circuit 31. 
     The interrupt request signal to the C.P.U 50 is output by the interrupt request signal generating circuit 31. This interrupt request signal generating circuit 31 outputs the interrupt request signal to the C.P.U. 50 in response to either the input complete signal from the 4-byte buffer 13 or the time-out signal from the timeout counter 33. The timeout counter 33 causes data stored in the 4-byte buffer 13 to be sent to the C.P.U. when the data from the host computer 60 doesn&#39;t completely fill the 4-byte buffer 13. The starting timing of the counters 17, 19, 27, 29, 33 described above is controlled by the counter control circuit 35. The C.P.U. 50 can adjust a set-up time for counting. 
     The operation of the parallel interface circuit 1 having the above construction is described below. FIG. 2 is a timing chart indicating the operation of the parallel interface circuit 11 when the first byte of data is input. 
     At time T1, the strobe signal from the host computer 60 is input to the buffer selector 11, which writes the data present on the parallel data bus 37 into the first buffer 41 of the 4-byte buffer 13. The strobe signal is also input to the counter control circuit 35. The counter control circuit 35 starts all of the counters 17, 19, 27, 29, and 33 in response to the strobe signal. 
     At time T3, the busy signal generating circuit 15 changes the busy signal to &#34;1&#34; in response to the first busy counter 17 counting down to zero (or overflowing if the counter counts up instead of down). Then, at time T9, the busy signal generating circuit 15 changes the busy signal to &#34;0&#34; in response to the second busy counter 19 counting down to zero (or overflowing). Between times T3 and T9, the acknowledge signal generating circuit 25 changes the acknowledge signal to &#34;0&#34; in response to the first acknowledge counter 27 counting down to zero (or overflowing), and changes the acknowledge signal to &#34;1&#34; in response to the second acknowledge counter 29 counting down to zero (or overflowing). 
     The above description is a timing concerning the input operation of the first byte of the data. The timing concerning the input operation of the second and the third bytes of data is the same as the timing for the first byte. The only difference is that the buffer selector 11 writes the second byte of the data into the second buffer 42 of the 4-byte buffer 13 and the third byte of the data into the third buffer 43 of the 4-byte buffer 13. The data register 45 in the 4-byte buffer 13 is set to &#34;1&#34; when the first byte of data is input and is set to &#34;2&#34; when the second byte of data is input. Thus, the data register 45 always indicates how many current bytes of data are stored in the 4-byte buffer 13. 
     The input operation of the fourth byte of data is described with the reference to the accompanying timing chart shown in FIG. 3. 
     When the strobe signal is input from the host computer 60 at time T21, the buffer selector 11 writes the data present on the parallel data bus 37 into the fourth buffer 44 of the 4-byte buffer 13. Then, at time T23, interrupt request generating circuit 31 outputs an interrupt request signal to the C.P.U. 50 and to the counter control circuit 35 in response to the input complete signal from the 4-byte buffer 13. When the interrupt request signal is input, the counter control circuit 35 operates only the first busy counter 17. 
     The busy generating circuit 15 sets the busy signal to &#34;1&#34; and terminates the data input process when the first busy counter 17 counts down to zero (or overflows) at time T25. Then, the C.P.U. 50 enters the interrupt process in response to the interrupt request signal, outputs the read signal to the 4-byte buffer 11, and reads the 4 bytes of data from the 4-byte buffer 13 simultaneously at time T27. The read signal from the C.P.U. 50 is output to the timeout counter 33 and the counter control circuit 35. When the read signal is received, the timeout counter 33 is reset and the counter control circuit 35 operates the second busy counter 19, the first acknowledge counter 27 and the second acknowledge counter 29. 
     The busy generating circuit 15 sets the busy signal to &#34;0&#34; when the second busy counter 19 counts down to zero (or overflows) at time T33. The acknowledge generating circuit 25 sets the acknowledge signal to &#34;0&#34; when the first acknowledge counter 27 counts down to zero (or overflows) at time T29, and sets the acknowledge signal to &#34;1&#34; when the second acknowledge counter 29 counts down to zero (or overflows) at time T31. 
     The above mentioned description is the operation of the parallel interface circuit 1 when receiving the fourth data byte. However, it should be appreciated that the number of bytes sent from the host computer 60 does not have to be a multiple of 4. The operation of the parallel interface circuit 1 when the number of bytes of data received from the host computer 60 is not a multiple of 4 (for example, 5 bytes) will be described referring to FIG. 4. 
     As shown in FIG. 4, the parallel interface circuit 1 operates from the first byte to the fourth byte as described above mentioned (time T41). Next, when the strobe signal for the fifth data byte is input at time T43, the buffer selector 11 writes the data present on the parallel data bus 37 into the first buffer 41 of the 4-byte buffer 13. The counter control circuit 35 operates the all of the counters 17, 19, 27, 29 and 33. 
     Outputting of the busy signal and the acknowledge signal is terminated at time T45, when the second busy counter 19 counts down to zero (or overflows). In this case, since a sixth byte of data has not been input, the input complete signal from the 4-byte buffer 13 to the interrupt request generating circuit 31 is not output. Instead, when the timeout counter 33 counts down to zero (or overflows) a count termination (or time-out) signal is input to the interrupt request signal generating circuit 31. The interrupt request signal generating circuit 31 outputs the interrupt request signal to the C.P.U. 50 and the counter control circuit 35. 
     The counter control circuit 35 operates the first busy counter 17 by inputting the interrupt request signal. The busy signal generating circuit 15 sets the busy signal to &#34;1&#34; when the first busy counter 17 counts down (or overflows) at time T47. Later the C.P.U. 50 jumps to the interrupt routine in response to the interrupt request signal and outputs the read signal and reads the four bytes of data from the 4-byte buffer 13 at once at time T49. In contrast, once the fifth data byte is received, the data register 45 of the 4-byte buffer 13 is set to &#34;1&#34; and the C.P.U. 50 judges that only the first buffer 41 of the 4-byte buffer 13 stores current data. Accordingly, at time T49, only the fifth data byte of the data, which is stored in the first buffer 41, is read. 
     Then the counter control circuit 35 receives the read signal from the C.P.U. 50. At the time of the interrupt routine for the timeout counter 33, only the second busy counter 19 is operated. The busy signal generating circuit 15 sets the busy signal to &#34;0&#34; when the second busy counter 19 counts down (or overflows) at time T51. The timeout counter 33 generates the time-out signal when it counts down to zero (or overflows). The time-out counter 33 can begin counting after any event, including after the first busy counter 17 counts down, after the second busy counter 19 counts down, after the first acknowledge counter 27 counts down, after the second acknowledge counter 29 counts down, or after the counter control circuit 35 starts the counters, as in the preferred embodiment. The strobe signal input to the counter control circuit 35 causes the counter control circuit 35 to stop the time-out counter 33 and reset all of the counters 17, 19, 27, 29 and 33. The time-out counter 33 is also stopped when the read signal is output by the C.P.U. 50, or when the interrupt request signal generating circuit 31 outputs the interrupt request signal. 
     As described above, according to the this embodiment of the parallel interface circuit 1, only one interrupt operation is sufficient to receive 4 bytes of data. Accordingly, the number of receiving operations is reduced and the speed of data processing is improved. Moreover, in the conventional apparatus, the interrupt routine occurred after each data byte was received. After receiving the data, the internal C.P.U sent a handshake signal such as a busy signal or an acknowledge signal by software procedure. However the above apparatus adapted this invention need send only a handshake signal in response to the strobe signal, until the fourth data byte is received. 
     The conventional apparatus has an interrupt after each data byte reception. And after receiving the data, the internal C.P.U sends a handshake signal such as a busy signal and an acknowledge signal. In short, in the prior art, the operation after the fourth data byte of the this preferred embodiment is repeated after every byte. Instead, in this embodiment, after the first three data bytes, the busy signal generating circuit 15 or the acknowledge signal generating circuit 25 sends only the busy signal or the acknowledge signal in response to the strobe signal. Thus, an improvement in the data processing speed is achieved by hardware means. 
     Further, the parallel interface circuit 1 of this embodiment generates the interrupt request signal to the C.P.U, even if the data storing means is not filled, when the next byte is not stored within a predetermined time period after the previous data byte is stored. By doing this, when the number of the byte from the host computer is not a multiple of 4, the parallel interface circuit does not wait for the next data byte. Thus, the data processing is not unnecessarily delayed. 
     It should be understood that the invention is not restricted to the particular forms shown in the forgoing embodiment. Various modifications and alterations can be added thereto without departing from the scope and spirit of the invention encompassed by the appended claims. For example, this embodiment has a 4 byte buffer for storing 4 bytes of the data, but the buffer any number of data bytes. 
     According to this invention, only one interrupt operation is enough for receiving two or more bytes of the data. Accordingly the number of receiving operations is reduced and the speed of the data processing is improved. Further, when the number of bytes from the host computer is not multiple of the data storing amount, unnecessarily waiting for the next data and unnecessarily delaying the data processing is prevented.