Electronic apparatus for data input/output processing with supply voltage control

Abstract: An electronic apparatus which does not become inoperative due to a voltage drop during the inputting or outputting of data. The apparatus includes an analog-to-digital converter for measuring the voltage output from a power source and for inputting the voltage to a central processing unit and a control section so that during output of test data to a parallel port before substantial data is output, the voltage output from the power source is measured, and a value for the minimum voltage of the power source is stored. When the minimum supply voltage during the output of the test data is lower than a reference voltage, actual data output is inhibited, thereby preventing the apparatus from becoming inoperative during data output. The minimum voltage output from the power source can be intermittently detected by a timer interrupt procedure. In the configuration, the minimum main supply voltage is compared with the predetermined reference voltage during data input/output so that a voltage drop is detected during data input/output, and data input/output processing is restricted according to the results of detection.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to an electronic apparatus, and particularly to an electronic apparatus for data input/output processing to a predetermined input/output device. Description of the Prior Art Generally known electronic apparatuses such as personal computers, word processors and the like include electronic apparatuses which receive data from and transmit data to external printers and other electronic apparatuses. Such electronic apparatuses having the input/output function include various types of apparatuses such as desk-top computers, lap-top computers, hand held computers and the like. Lap-top computers and hand held types of apparatuses are frequently driven by a battery or supplied with electricity using DC electric power, such as an AC adapter, externally attached or the like, because importance is attached to portability. It is known that the above-described electronic apparatus have a printer interface or a communication interface such as RS232C, or the like, which is provided on the outside thereof, not in the apparatus body, in order to decrease the size and weight of the body or decrease the cost. In such a configuration, the interface is frequently supplied with electricity from the body side, like the case in which an interface is contained in the apparatus. This is designed for decreasing the size and weight of a communication interface of the like or decreasing the cost. As is generally known, a central processing unit, CPU and a memory which constitute a control section of the electronic apparatus cannot be normally operated until a stable supply voltage of at least a predetermined value is supplied thereto. However, the above-described conventional apparatus can become inoperative during communication due to a combination of a drop in the supply voltage caused by the operation of the body and a voltage drop caused by the operation of the communication interface externally attached to the body. In this case, there is also the danger of destroying important user data stored in the memory. An interface such as RS232C, a centronics port, or the like generally conducts a relatively large driving current and thus there is a higher probability that the above problems will be produced than that in the case where the body only is driven. Although the case where a communication interface is externally attached is described above, the case where the interface is contained in the apparatus body also has the same problem that the apparatus becomes inoperative during communication. Prior art document US-A-4 984 185, shows a portable computer having a battery voltage detecting circuit. It appears to be known from this reference to detect the amount of power delivered by the battery and to decide upon a further supply of data in accordance with the detection result. This is done during the battery's driving of a load. In particular, in column 3, line 53, to column 4, line 2, it is outlined that a printer operation may be automatically prohibited when the battery power is insufficient. Patent publication US-A-4 907 183, shows a battery powered computer system wherein a energy state of the power supply battery is determined by a voltage detector. Depending on the detection result the power consumption of the computer is decreased by shutting off any high power consumption peripherals. Prior art document WO-A-90/13079, shows a computing system with selective operating voltages. According to this document, it is checked by means of a self-test routine which the minimum operating voltage is necessary for the operation of the microcomputer. This is done by a stepwise decrease of the operating voltage as long as the microcomputer works and, after having detected the level at which the microcomputer does not longer work, by an addiion of a certain amount of power to this "non-working" voltage level to thereby define the minimum operating voltage of the microcomputer. SUMMARY OF THE INVENTION It is an object of the present invention to solve the problems of the prior art. It is still another object of the present invention to provide an electronic apparatus which does not become inoperative due to a voltage drop during inputting or outputting of data. According to one aspect, the invention as defined in independent claim 1, which achieves these objectives relates to an electronic apparatus comprising means for inputting and/or outputting data to or from a predetermined input and/or output device, detection means for detecting the minimum main supply voltage needed for the apparatus during data input and/or output to or from the input and/or output device, and control means for comparing the minimum main supply voltage detected by the detection means during the inputting and/or outputting of data to or from the input and/or output device with a predetermined reference voltage so that data input and/or output processing of the inputting and/or outputting means is restricted when the minimum main supply voltage is lower than the reference voltage. The detection means detects the minimum main supply voltage during the inputting and/or outputting of test data into or out of the predetermined input and/or output device. Another aspect of the present invention is defined in the independent method claim 3. Further embodiments of the present invention are specified in the respective dependent claims. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram of an electronic apparatus to which the present invention is applied; Fig. 2 is a flow chart showing the procedure of communication control of the apparatus shown in Fig. 1; Fig. 3 is a flow chart showing the timer interrupt routine of the apparatus shown in Fig. 1; and Fig. 4 is an explanatory view showing an example of display output of the apparatus shown in Fig. 1. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention is described in detail below with reference to the embodiment shown in the drawings. Fig. 1 shows the configuration of a control section common to electronic apparatuses such as a personal computer, a word processor and the like, all of which employ the present invention. In the drawing, reference numeral 101 denotes a control system contained in the apparatus body and having a central processing unit, CPU, 11 comprising a microprocessor, and a read only memory, ROM, 12 and a random access memory, RAM, 13 both of which are connected to the CPU 11 by an address bus and a data bus. The RAM 13 is used as a work area for the CPU 11 for storing user data. The ROM 12 is used for storing the control program of the CPU 11 described below. An input/output control section 21 is connected to the CPU 11. The input/output control section 21 comprises a control circuit for controlling input/output to an external circuit 104 comprising a centronics interface or parallel port 42 and an RS232C interface 41, which are contained in the apparatus body or are externally attached thereto. The power of the apparatus is supplied from a power source 32 of a power source section 103. The power source 32 comprises, for example, a battery or the like, for supplying power to the control section 101 of the body and for supplying power to the external circuit 104 comprising the external interfaces 41, 42 when the external circuit 104 is connected thereto. The operation of the above configuration is described below. The CPU 11 has an internal timer so that an interrupt routine is executed at predetermined time intervals on the basis of the timer control. In this embodiment, when the output voltage of the power source 32 is detected through an analog-to-digital, A/D converter 31 and the input/output control section 21, detection processing is performed at predetermined intervals according to a timer interrupt procedure. In this embodiment, in order to prevent the apparatus from becoming inoperative due to a voltage drop during input/output to an external apparatus through the external circuit 104, when data is input to and output from the external circuit 104, test data (which can be specific data, actual data, or calibration data) is output before actual data input and output so that a supply voltage during input and output of data to the external circuit 104 is detected for making a decision as to whether or not communication processing can be performed. Fig. 2 shows the control of input/output to the external circuit 104. Fig. 3 shows the interrupt routine which is executed according to a timer interrupt procedure at predetermined intervals (for example, several seconds to ten-odd seconds). These programs are stored as control programs for the CPU 11 in the ROM 12. The interrupt routine shown in Fig. 3 is described below. It is controlled by the CPU 11. Steps S31 to S34 show the process of reading the output voltage of the power source 32 through the A/D converter 31. The A/D converter 31 has a plurality of A/D channels. In Step S31, the channel to which the power source 32 is assigned by the CPU 11 is specified by the CPU 11. In Steps S32 and S33, the output voltage of the power source 32 is read through the A/D converter 31 when no signal is transmitted from the section 21 to the external circuit 104. The A/D converter outputs digitized data representing the output voltage of the power source 32. This digitized data is transmitted to the input/output control section 21, and the CPU 11 stores the digitized data in the work area of the RAM 13 in Step S34. In Step S35, a decision is made by the CPU 11 as to whether or not a flag ND, indicating whether or not the test data is presently output, is set. The flag ND is set during the output of the test data to the external circuit 104. If the flag ND is set, the digitized data representing minimum supply voltage of the power source 32 during the time the flag is set is stored in a specific region of the work area in Step S36. Data representing the minimum value is stored by comparing the value read in Step S34 with data representing a value stored in an area of the RAM 13, of one or more bytes, for the minimum voltage of the power source 32 during the output of the test data to the external circuit 104 read through the A/D converter 31. If the newly-read value of the voltage of the power source 32 read during the output of the test data is smaller than the previously stored value in Step S34, the newly-read value is stored, and if the stored value in Step S34 is smaller than the read value read during the output of test data, the area of the RAM 13 in which the previously-stored value in Step S34 is stored is left as it was without being rewritten. In an initialization step, the data representing maximum value output from the A/D converter is previously stored in this area. In Step S11 shown in Fig. 2, a key input using a key board (not shown) is detected by the CPU 11. This is because input and output to the external circuit 104 are generally started by input from the key board. If a key input is detected in Steps S12, S13, a decision is made by the CPU 11 as to whether or not input/output to the RS232C interface 41 or the parallel port 42 is directed by key input. If a key input is not detected in Step S11, the procedure returns to Step S11 to again determine whether a key input is detected. When it is decided by the CPU 11 in Step S12 that the RS232C interface 41 is selected, predetermined operations for specifying a communication speed, a parity/stop bit, and so on, are performed in Steps S14 to S16. When a key input is present in Step S14 and when communication start is directed in Step S15, the dummy operation of outputting the test data to the RS232C interface 41 is performed in Steps S17 to S111 before actual data is actually output in Step S112. During the dummy operation, the process of deciding the minimum supply voltage stored according to the procedure shown in Fig. 3 is performed. If a key input is not present at Step S14, the procedure returns to Step S14 to again determine if a key input is present, If a communication start is not directed in Step S15, the procedure goes to Step S16 to perform other processing operations. In Step S17, the test data output flag ND is set, and in Step S18, the dummy test data is output to the RS232C interface 41 through the input/output control section 21. In this operation, data of about 100 bytes is output to the RS232C interface 41. The test data preferably has no effect on the RS232C interface 41 or an external apparatus connected therethrough. For example, NULL () data is preferable. It is also thought that it is preferable to output a data pattern which increases, to the maximum value, the current consumed by an external circuit, such as the RS232C interface 41 or the like. In Step S19, a decision is made by the CPU 11 as to whether or not the test data is completely transmitted. If the output is completed, the flag ND is reset in Step S110. If not, the procedure returns to Step S17. In Step S111, data representing the minimum supply voltage during output of the test data, which is stored in the work area of the RAM 13 according to the procedure shown in Fig. 3, is compared with data representing a predetermined reference voltage. The reference voltage is the supply voltage value which enables the satisfactory operation of each of the necessary sections of the apparatus. If it is decided by the CPU 11 in Step S111 that the minimum supply voltage stored in the predetermined area of the RAM 13 is greater than the reference voltage, actual data is output to the RS232C interface in Step S112. On the other hand, if it is decided by the CPU 11 in Step S111 that the minimum supply voltage is smaller than the reference voltage, in Step S113, data output is inhibited, and the warning shown in Fig. 4 is displayed on a display or the like. Fig. 4 shows the message displayed on the display D shown in Fig. 1 in Step S113. The message states that the current capacity is insufficient for communication. In the above-described configuration, the minimum supply voltage during the test data output to the external circuit 104 is detected and compared with the predetermined reference voltage so that actual communication is simulated, and a decision is made by measuring the supply voltage during the communication as to whether or not the apparatus can be operated. It is thus possible to prevent the occurrence of the accident that the apparatus becomes inoperative, with the consequent destruction of data. In the above embodiment, the minimum supply voltage is measured by outputting dummy test data, and a protocol is used for transmitting the header potion before the substantial data portion is transmitted during the output of actual data. However, when a failure in transmission of the header portion has no effect on the entire communication processing operation, the minimum supply voltage may be measured by, for example, transmitting the header portion, not by outputting the dummy data. In addition, it is a matter of course that not only data output but also data input can be controlled in the same way as that described above. The input/output to the parallel port 42 can also be controlled by the same method as that described above. The invention thus can provide an excellent electronic apparatus which is capable of restricting data input/output processing in response to a voltage drop during data input/output and which is capable of preventing the apparatus from becoming inoperative due to the voltage drop during data input/output and thus preventing the occurrence of the accident that data is destroyed. The individual components represented by the blocks shown in Fig. 1 are well-known in the electronic apparatus art and their specific construction and operation is not critical to the invention or the best mode for carrying out the invention. Moreover, the operations illustrated in Figs. 2 and 3 can be easily programmed into well-known central processing units by persons of ordinary skill in the art and since such programming per se is not part of the invention, no further description is deemed necessary. The apparatus includes an analog-to-digital converter for measuring the voltage output from a power source and for inputting the voltage to a central processing unit and a control section so that during output of test data to a parallel port before substantial data is output, the voltage output from the power source is measured, and a value for the minimum voltage of the power source is stored. When the minimum supply voltage during the output of the test data is lower than a reference voltage, actual data output is inhibited, thereby preventing the apparatus from becoming inoperative during data output. The minimum voltage output from the power source can be intermittently detected by a timer interrupt procedure. In the configuration, the minimum main supply voltage is compared with the predetermined reference voltage during data input/output so that a voltage drop is detected during data input/output, and data input/output processing is restricted according to the results of detection.

Claims: An electronic apparatus processing digita data comprising: detection means ( 31 ) for detecting the voltage of a power source ( 32 ) powering said electronic apparatus; a storage region ( 13 ) for storing information representing the value of a minimum supply voltage; data output means ( 102 ) for outputting data to a predetermined input and/or output device ( 104 ); and control means ( 11 ) for restricting data output to the predetermined input and/or output device ( 104 ) when the value stored in said storage region ( 13 ) is smaller than a predetermined value representing a predetermined reference voltage being the supply voltage value which enables the satisfactory operation of each of the necessary sections of said electronic apparatus; characterized in that said data output means ( 102 ) outputs specific test data to said predetermined input and/ or output device ( 104 ) before actual data is output to said predetermined input and/ or output device ( 104 ) ; and said detecting means ( 31 ) detects and decides the minimum supply voltage which is to be stored as said information in said storage region ( 13 ) while the specific test data is outputted to said predetermined input and/ or output device ( 104 ). An electronic apparatus according to claim 1, characterized by display control means ( D ) for displaying a message when the voltage detected by said detecting means ( 31 ) is determined to be lower than the predetermined voltage. A data transfer method in an electronic apparatus processing digital data comprising the steps of: sending ( S112 ) data to an input and/or output device ( 104 ); storing ( S34 ) information representing the value of the minimum supply voltage; detecting ( S36 ) a value of voltage supplied by a power source ( 32 ) powering said electronic apparatus; and restricting ( S113 ) transmission of the data to the input and/or output device ( 104 ) when the voltage detected in said detecting step ( S36 ) is determined to be lower than a predetermined voltage representing a predetermined reference voltage being the supply voltage value which enables the satisfactory operation of each of the necessary sections of said electronic apparatus; characterized in that before sending ( S112 ) said data to said input and/or output device ( 104 ), specific test data is sent ( S18 ) to said input and/or output device ( 104 ) ; and said value of voltage supplied by said power source ( 32 ) is detected and decided in said detecting step during the operation of said input and/or output device ( 104 ) while sending ( S18 ) said specific test data to the input and/or output device ( 104 ). A data transfer method according to claim 3, characterized by the further step of displaying a message ( D ) when the voltage detected in said detecting step ( S36 ) is determined to be lower than the predetermined voltage.

Inventors: SAKAGUCHI KATSUHIKO, SHINKAI MICHINORI, SAKAGUCHI, KATSUHIKO, SHINKAI, MICHINORI
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1992
Main classification: G06F1
IPC codes: G06F11, G06F1