Electronic apparatus with controllable power supply

Abstract: The power supply of electronic apparatus is controlled according to the operational state of a power on switch and a power off switch. A first detector detects that the power supply voltage falls below a first predetermined voltage and a second detector detects that the power supply voltage falls below a second predetermined voltage. A device produces the same operational state as that in which the power off switch is actuated in response to the detection output of the first detector and prohibits the operation of the power on switch in response to the detection output of the second detector. A predetermined protection process is performed when the power supply voltage falls below a prescribed voltage in which the supply voltage is compared with the two predetermined voltages to produce the same state as when the power on or the power off switch is put into a predetermined condition in response to the comparison result.

Description: The present invention relates to an electronic apparatus having a controlled power supply, and also to measures to be taken in such an electronic apparatus having a battery as a power supply when the battery voltage falls. Conventional electronic apparatus driven by a battery as a power supply, such as an electronic learning machine, an electronic notebook or a word processor, have a reset IC for detecting the state of the battery to prevent data destruction, and controls the battery by the following two methods when the voltage of the battery is lowered: 1) protecting a RAM by an interrupt process in response to an output signal of the reset IC; and 2) comparing the battery voltage with a predetermined reference voltage at regular intervals by timer interrupts, and issuing a warning to replace the battery when the battery voltage becomes lower than a predetermined voltage. However, in the above method 1), since the interrupt process can occur at any moment, a data updating process and the interrupt process are complicated. In method 2), the timer interrupt process and switchover process from the timer interrupt process to a RAM protection process are complicated, the adjustment of a comparison circuit for the voltage comparisons is necessary, and the cost is high. Furthermore, method 2) needs an input port for monitoring the battery voltage which is sometimes difficult to realize the comparison circuit in a single chip microcomputer since the number of ports of the microcomputer may not be sufficient. In particular, an apparatus using a memory card or the like needs some input ports to monitor the state of predetermined signals of a bus between the battery and the card when memory protection is performed in accordance with the state of the battery, and such an apparatus is difficult to design. From document US-A-4 096 560 there is known a protection circuit disabling a microprocessor and an electronic memory during periods of power line interruption or unacceptable power deviations. Moreover, document FR-A-2 638 867 discloses a method and a circuit for re-initialization of a microprocessor, wherein different restoration procedures are performed, depending on whether the processor was interrupted by a power supply drop or by any other reason. In addition, the IBM Technical disclosure bulletin "Loose Connector Detection" by R.C. Mattern, Vol. 15, No. 1, June 1972, pages 33, 34 discloses a device for initiating a processor shutdown procedure upon detection of loosening or removing / replacing, respectively, a card. EP-A-273 322 relates to a power supply with a built-in microcomputer for use in a computer system, and discloses a power control section and a power supply regulator being arranged between a power source and a body of a computer system, with the power supply control being performed by the regulator as a special means. According to the above prior art arrangement known from EP-A-273 322, when a power OFF is requested, a power supply is controlled by receiving the OFF information with a power supply control section arranged between a power supply section and a computer system and by inhibiting the power supply from the power supply section to the computer system with a power supply regulator arranged between the power supply section and the computer system. However, this known arrangement thus apparently necessitates additional complex circuitry arrangements, i.e. the power supply control section and the power supply regulator. It is therefore an object of the present invention to provide an electronic apparatus having a controlled power supply, which has a less complex circuitry. It is an aim of the present invention to simplify protection processes when the battery voltage is lowered, and to certainly carry out the protection processes. It is a further aim of the present invention to simplify the production process and reduce the production cost by using an unregulated voltage detector (comparison circuit) in the above protection processes. The present invention still further aims to produce an inexpensive apparatus without any special input port. The above object and aims of the present invention are achieved by an electronic apparatus having a controlled power supply, as defined in claim 1. Advantageous further developments are as set out in the dependent claims. In particular, the invention is directed to electronic apparatus having a controllable power supply in which the power supply is controlled according to the operational state of a power on switch and a power off switch. The same control state as that in which the power off switch is actuated is produced upon detection that the power supply output falls below a first predetermined value and the operation of the power on switch is inhibited upon detection that the power supply output falls below a second predetermined value. Fig. 1 is a circuit diagram of the periphery of a power supply in an electronic apparatus according to the present invention; Fig. 2 is a diagram of explanatory view of a key matrix; Fig. 3 is a block diagram of a display control circuit; Fig. 4 is a block diagram of the periphery of a CPU and a memory; Fig. 5 is a timing chart of a battery voltage and main control signals; Fig. 6 is a timing chart of other main control signals; Fig. 7 is a flow chart showing control procedures of the CPU; Fig. 8 is a detailed flow chart of a RAM check process; Figs. 9 and 10 are drawings showing other battery circuitry; and Fig. 11 is a detailed flow chart of another RAM check process. The present invention will now be described in detail with reference to the illustrated embodiments. An electronic apparatus of the present invention is driven by a battery and has a plurality of IC cards as external storage means, at least a keyboard as a user interface means and a display. Fig. 1 shows a power supply portion and a circuit for performing control operations based on the detection of the supply voltage in the electronic apparatus. Referring to Fig. 1, BATT1, BATT2 and REG designate a battery serving as a power supply, a backup battery for a RAM, and a voltage regulator, respectively. The regulator REG is composed of a well-known integrated circuit and so on, stabilizes an output voltage of the battery BATT1, and outputs a fixed voltage VDD1. Schottky barrier diodes D1 and D2 apply one of the VDD1 and the voltage of the battery BATT2 to generate a battery voltage VDD2. The battery voltage VDD2 is supplied as a battery voltage of the circuit shown in Fig. 1 and a battery voltage of ic2 shown in Fig. 4. Slide switches SW1, SW2 and SW3 are a battery replacement switch, an IC card 1 replacement switch, and an IC card 2 replacement switch, respectively. These switches are operated in mechanical relation to the replacement of the battery and the IC cards (or manual manipulation) and are shown positioned to the left in the figure. Ic5 (ic5-1 to ic5-3) is a Schmitt-input NAND circuit to detect the operation states of the slide switches SW1, SW2 and SW3. Ic6 (ic6-1 to ic6-3) and ic7 (ic7-1 to ic7-4) are a NOR circuit and an analog switch, respectively. Voltage detectors DET1 and DET2 each output a signal of 'L' level from a Vo terminal when the battery voltage VDD2 is lowered. The relation between detected voltages VDET1 and VDET2 of the voltage detectors DET1 and DET2 is VDET1 > VDET2. Ic5-1 outputs a signal of 'L' level to ic6-1 and ic6-2 only when both the switches SW2 and SW3 (the IC card replacement switches) are positioned to the left in the figure. Ic5-2 and ic5-3 invert and transmit outputs of the voltage detectors DET1 and DET2 to ic6-1 and ic6-2 only when the switch SW1 (the battery replacement switch) is positioned to the left in the figure. Ic6-1 and ic6-2 each output a signal of 'L' level only when outputs of both ic5-1 and ic5-3 are of 'H' level. Ic6-2 controls the analog switch ic7-2 in response to the output. Ic6-3 generates a signal obtained by inverting the output of ic6-1, and controls the analog switch ic7-1 in response to the signal. The analog switches ic7-3 and ic7-4 are directly controlled by the output of the voltage detector DET2. The analog switch ic7-1 is placed so as to connect a key strobe signal KS1 and a key input signal Ki0 (a key matrix will be specifically described below in reference to Fig. 2). The analog switch ic7-1 is forced into the same state as that in which an OFF key disposed between the key strobe signal KS1 and the key input signal Ki0 is pressed down. The analog switch ic7-2 controls the connection of key strobe signals KS0 between a CPU and a key matrix, and prohibits the input of an ON key. Ic7-3 and ic7-4 control lines for a chip select signal CS9 (negative logic) of a RAM and a write enable signal of the RAM, and are controlled so as to be closed by a 'H' level input and opened by a 'L' level input (high impedance state). C1, C2, C10, C11, C17, C18 and C19 each designate a bypass capacitor, R2 designates a current limiting resistor, C12, C13, C14, C15 and C16 each designate a noise absorption bypass capacitor, and R6 and R7 each designate a pull-up resistor. Fig. 2 shows a key matrix KM of the electronic apparatus of the present invention. Referring to Fig. 2, Ki0 to Ki6 each denote a key input (scan) signal, and KS0 to KS11 each denote a key strobe signal. The ON key is placed at an intersection of a key strobe signal key KS0 and a key input signal key KiO, and the OFF key is placed at an intersection of a key KS1 and a key KiO. These ON and OFF keys are used to control ON/OFF of the main power supply. The ON key also has a function of displaying a predetermined menu. Fig. 3 shows a display circuit of the electronic apparatus of the present invention. Referring to Fig. 3, ic20, ic21 and ic22, Disp, C20 to C30, and R20 designate a common driver for an LCD, LCD segment drivers, an LCD display, bypass capacitors, and a resistor for controlling the oscillation of the common driver ic20. Fig. 4 shows a CPU and a memory circuit of the electronic apparatus of the present invention. Referring to Fig. 4, a CPU ic1 controls the execution of processes of the electronic apparatus, and a RAM ic2 functions as a memory for data storage and work of the CPU. ROMs ic3 and ic4 store a process program to be executed by the CPU ic1 and data for reference. XTAL, C1 and C2, R1, R8, and C6, C7, C8 and C9 designate an oscillator for generating operational clocks for the CPU ic1, capacitors for compensating the phase of the clocks, a damping resistor, a pull-up resistor, and bypass capacitors, respectively. C3, CN1 and CN2 designate a time constant capacitor for generating a reset signal of the electronic apparatus, a connector for the IC card 1, and a connector for the IC card 2. KM represents the key matrix shown in Fig. 2. Figs. 5 and 6 each show the timing of main signals on the circuit shown in Fig. 1. Referring to Fig. 5, when the voltage of the battery BATT1 is sufficiently high, the supply voltage VDD1 is set at a fixed voltage of 5V by the regulator REG. At this time, the supply voltage VDD2 through the diode D1 is 4.7V which is approximately 0.3V lower than the supply voltage VDD1. Outputs of both the detectors DET1 and DET2 are of 'H' level. When the voltage of the battery BATT1 falls below 5V, the voltage of the battery BATT1 and VDD1 become almost the same and change together. When the voltage VDD1 is lowered to approximately 4.5V, each ic shown in Figs. 3 and 4 reaches the lower limit of the operational voltage guaranteed by the manufacturer. At this time, VDD2 is approximately 4.2V and the output of the detector DET1 is set to 'L' level. Furthermore, when VDD1 and VDD2 reach approximately 3.8V and 3.5V, respectively, the output of the detector DET2 is also set to 'L' level. Fig. 6 shows the relationships between the switches SW1 to SW3 and the DET1, and between the DET2 and control signals of ic7-1 to 7-3. Referring to Fig. 6, if the switches SW1 to SW3 shown in Fig. 1 are positioned to the left and outputs of both the detectors DET1 and DET2 are of 'H' level, only the control signal of the analog switch ic7-1 is at the 'L' level, and the control signals of the analog switches ic7-2 and ic7-3 are at the 'H' level. Therefore, the analog switch ic7-1 is OFF and the analog switches ic7-2 and ic7-3 are ON. When the supply voltage VDD2 drops down below 4.2V shown in Fig. 5 and the output of only the detector DET1 is at the 'L' level, the control signal of the analog switch ic7-1 is at the 'H' level, the analog switch ic7-1 is put into the ON state, and the key strobe signal KS1 and the key input signal Ki0 shown in Fig. 1 are connected. Furthermore, when the supply voltage VDD2 falls below 3.5V shown in Fig. 5 and the outputs of both the detectors DET1 and DET2 go to the 'L' level, the control signals of the analog switches ic7-2 and ic7-3 go to the 'L' level, the analog switches ic7-2 and ic7-3 are put into the OFF state, the KS0s on the right and left in Fig. 1 are electrically opened (high impedance), and the chip select lines CS9(on the side of the CPU) and CE (on the side of the RAM) are also opened. Subsequently, when any of the switches SW1, SW2 and SW3 is positioned to the right while the outputs of the detectors DET1 and DET2 remain on 'H' level, that is, when any of the battery and the two IC cards is replaced, the analog switch ic7-1 is turned ON and the analog switch ic7-2 is turned OFF. Since the OFF key is placed at an intersection of KS1 and Ki0 as shown in Fig. 2, if the analog switch ic7-1 is turned on, the same state as when the OFF key is pressed is produced. When the analog switch ic7-2 is turned off, since KSO shown in Fig. 2 is electrically opened, the ON key shown in Fig. 2 remains open even if pressed. In other words, the input of the ON key is ineffective in hardware. Referring to Fig. 3, the display Disp performs display operations under the control of the drivers ic20, ic21 and ic22, and stops the display operations and goes into the standby state (ultra low current consumption mode) when a 'L' level input is applied as an STB signal from the CPU (ic1) shown in Fig. 4. In Fig. 4, the processes to be carried out by ic1 are stored in ic3 or ic4. Fig. 7 is a flow chart of one of the processes. WORK in the flow chart denotes a predetermined area of the RAM ic2, and I/O means an electronic circuit built in the CPU ic1 and the display circuit shown in Fig. 3. Referring to Fig. 4, when a RESET key is pressed or when the battery BATT1 shown in Fig. 1 is inserted and a power ON reset signal is input to the CPU, the processes in Fig. 7 are carried out one by one from Step S1. In Step S1, the register in the CPU and the interruption mode are initialized. In Step S2, the circuit I/O built in the CPU and the display circuit shown in Fig. 3 are initialized. In Step S3, it is checked whether or not the RAM can normally perform the access. If the RAM is normal(good), Step S4 is executed, and if the RAM is not normal (wrong), a reset operation is repeated in Step S1. The RAM check in Step S3 will now be described in more detail with reference to the flow chart shown in Fig. 8. A predetermined area (several bytes) of the RAM is secured as a dummy area, and it is checked whether or not normal access to the dummy area of the RAM is possible. First, in Step S31, the whole dummy area is cleared. In Step S32, a predetermined message (for example, the name of the manufacturer or the name of the software) is written in the dummy area. In Step S33, the dummy area is read. In Step S34, it is determined whether or not the read data accords with the written data. If both the data are the same, it is determined that the RAM is normal. If the data do not agree, it is determined that there is something wrong in the RAM. Returning to Fig. 7, the work area of the RAM is initialized in Step S4. In Step S5, the RAM is checked in the same manner as in Step S3. If the RAM is not normal, an OFF process is executed, and if the RAM is normal, Step S6 is executed. In Step S6, A set-up process of the CPU, for example, the minimum initialization of the register, is carried out. In Step S7, a set-up process of the circuit I/O, the minimum initialization of the circuit I/O or the return to the state immediately before the OFF state of the circuit I/O is executed and Step S7' is executed. The RAM is checked in Step S7' in the same manner as above. In Step S8, the work area of the RAM is initialized to a minimum. In Step S9, the OFF key is scanned. If the OFF key is pressed, Step S10 is executed, and if the OFF key is not pressed, Step S11 is executed. The press-down state of the OFF key is obtained through the analog switch ic7-1 not only when the OFF key is actually pressed down, but also when the supply voltage drops below 3.5V as described above, and when the IC card or the battery is replaced. If the OFF key is pressed, a message for indicating that the battery is running low (for example, "Low battery!") is displayed for approximately two seconds in Step S10 and the OFF process is executed. In Step S11, a set-up image is displayed. In Step S12, a wait for the key input by the key matrix shown in Fig. 2 is initiated. If the data key is pressed, Step S13 is executed, if one of keys other than the OFF key is pressed, Step S14 is executed, and if the OFF key is pressed, Step S15 is executed. In Step S13, a data input process is performed and a wait for the key input in Step S12 is repeated. In Step S14, a process corresponding to the pressed key other than the data key and the OFF key is performed. In Step S15, a terminate process (end process: process previous to OFF state) of the work area of the RAM is executed. In Step S16, the terminate process of the circuit I/O is executed, and Step S17 is executed. In Step S17, an interrupt enable operation of the CPU is performed and a halt instruction is executed, thereby putting the apparatus into the OFF state. The OFF state of the apparatus of the present invention means the state in which the CPU stops the generation of clocks and goes into the standby state (ultra low current consumption mode), the STB signal of the display circuit shown in Fig. 3 is turned to 'L' and the display circuit is on standby. When the RESET key shown in Fig. 4 is pressed in this state, the above processes are repeated from Step S1. Furthermore, when the ON key shown in Fig. 2 is pressed in this OFF state, the processes subsequent to Step S5 are executed again. In the above embodiment, since the voltage detectors DET1 and DET2 for detecting the supply voltage are mounted, the detected voltage of the voltage detector DET1 is set higher than that of the detector DET2, the OFF key is actuated in response to the output of the detector DET1, and the input of the ON key and the access to the RAM are prohibited in response to the output of the detector DET2, the configuration of the apparatus is simpler than the conventional one in which the CPU detects the voltage by using the input port. Furthermore, the replacement of the IC card and the batteries is detected by the switches SW1 to SW3, the ON and OFF keys are controlled in accordance with the replacement, and the RAM can be reliably and easily protected. Still further, according to the above configuration, since unregulated voltage detectors can be used, it is possible to greatly improve the production efficiency and to produce a relatively inexpensive apparatus compared to apparatus using a reset IC and the like. Since the access state of the memory is checked in the reset process when the system is started, and the reset process is repeated until the normal access becomes possible, even if the battery voltage is lowered, the RAM can be certainly protected and incorrect operations of the system due to the protection of the RAM can be prevented by replacing the battery, thereby making protection of the RAM extremely easy and inexpensive. Furthermore, if the same control state as that in which the power off switch is actuated by the above hardware means is produced in the reset process when the system is started, since a warning indicating that the battery voltage is lowered is displayed (the warning may be given by speech output), any special input port is unnecessary and the arrangement for monitoring and warning of the battery voltage fall is simple. Since the protection process can be executed by controlling the operational state of the ON and OFF keys even if there is an output from the switch operated when the IC card or the battery is replaced (switches other than the illustrated slide switch may be used), the protection of the memory during the replacement can be certainly achieved, thus preventing incorrect operations of the apparatus. Figs. 9 and 10 are variations of the above configuration of the electronic apparatus. Although the analog switches ic7-3 and ic7-4 for protecting the RAM are directly controlled by the output of the detector DET2 in the above description, there is provided a detector DET3 for detecting the battery voltage VDD2 in order to control the analog switches ic7-3 and 7-4 in Fig. 9. The other components are the same as those shown in Fig. 1. The relationship among VDET1, VDET2 and a detected voltage VDET3 (the output is an inverted voltage) of the third voltage detector DET3 is VDET1 > VDET2 > VDET3. The addition of the third voltage detector DET3 results in further protection of the RAM. Although a slide switch for replacement of the IC card is used in the above embodiment, such a switch is not always in an electronic apparatus which is not an IC card. An embodiment in which the slide switch is omitted is shown in Fig. 10. In this embodiment, the control of the battery voltage by the voltage detectors DET1 and DET2 and the control when the battery is replaced are performed in the same manner as above. Although the RAM is checked by confirming the agreement of the data written in the dummy area with the read data in the above embodiment, the correlation of the input and output data in a predetermined address may be performed by repeating pushing down and popping up the data to and from the stack as shown in Fig. 11. In Step S51 shown in Fig. 11, a predetermined counter register is set at the maximum number (in the case that msb to lsb of one word or one byte as a unit to be pushed/popped is 1), and the contents of the counter register are pushed down/popped up in Steps S52 and S53. At this time, a stack pointer is controlled to point a predetermined address to be checked. The popped data is stored in an accumulator. In Step S54, the contents of the accumulator and the counter register are correlated. If the contents do not agree, it is determined that an error occurred in the memory and the reset process is executed. The number of the counter register is decreased in Step S55, and it is checked in Step S56 whether or not the number reaches 0. If the number is not 0, the processes subsequent to Step S52 are repeated. According to the above processes, all bit patterns can be tested with respect to a word or byte data in one address. The above processes are repeated for each address of the RAM. As described above, an electronic apparatus, which executes a predetermined protection process when the supply voltage falls below a predetermined voltage, includes a control for controlling a power supply of the apparatus in accordance with the operational state of a power on switch and a power off switch, a first detector for detecting that the supply voltage falls below a first predetermined voltage, a second detector for detecting that the supply voltage falls below a second predetermined voltage lower than the first predetermined voltage, and hardware for producing the same control state as that in which the power off switch is actuated in response to the detection output of the first detector and prohibiting the operation and input of the power on switch in response to the detection output of the second detector. Therefore, a protection process can be performed by detecting the supply voltage with respect to the two predetermined voltages, and forming the same state as that in which the power on or off switch is put into a predetermined condition in accordance with the detection result. Furthermore, the protection process when the battery voltage falls can be simplified and reliably and easily executed. By using unregulated voltage detectors, the production and operation efficiency is greatly improved, and any special input port which is used in conventional CPU software is unnecessary. In addition, it is possible to produce an apparatus at relatively lower cost than that of the apparatus using a reset IC.

Claims: An electronic apparatus having a controlled power supply, comprising: a plurality of key switches arranged in an input circuit (KM) , said input circuit comprising a power ON switch for turning on the electronic apparatus and a power OFF switch for turning off the electronic apparatus; first detection means (DET 1) for producing a first detection output signal when it is detected that a supply voltage from the power supply falls below a first predetermined voltage in the first detection means (DET 1) ; second detection means (DET 2) for producing a second detection output signal when it is detected that the supply voltage from the power supply falls below a second predetermined voltage in the second detection means (DET 2) , said second predetermined voltage being lower than said first predetermined voltage; control means for controlling power ON and power OFF of said power supply in accordance with a power ON state and a power OFF state respectively of the input circuit (KM) , respectively produced by a press of the power ON switch or the power OFF switch of said input circuit (KM) ; controllable switch means (ic 7-1) in parallel connection with said power OFF switch for producing, in response to the first detection output signal of said first detection means (DET 1) , said power OFF state of said input circuit (KM) corresponding to a press of the power OFF switch; first prohibiting controllable switch means (ic 7-2) in serial connection with the power ON switch for prohibiting, in response to the second detection output signal of the second detection means (DET 2) , said input circuit (KM) from having said power ON state upon a press of the power ON switch; and second prohibiting controllable switch means (ic 7-3, ic 7-4) for prohibiting, in response to the second detection output signal of said second detection means (DET 2) , an access to a memory associated to the electronic apparatus by controlling a line of a chip select signal (CS9) and a line of a write enable signal supplied to the memory. An electronic apparatus according to claim 1, characterized by means (S1-S4; S31-S34; S51-S56) for checking a memory access state in a reset process when said electronic apparatus is started up and repeating said reset process until a normal memory access is available. An electronic apparatus according to claim 1, characterized by means (S5) for checking a memory access state when the electronic apparatus is turned on and performing a transit process to an OFF process when the memory access state is not normal. An electronic apparatus according to claim 1, characterized by means (S9) for warning of the fall of the supply voltage if the power OFF state of said input circuit (KM) corresponding to a press of the power OFF switch is produced when the apparatus is turned on. An electronic apparatus according to claim 1, characterized by switch means ( SW1, SW2, SW3 ) operated in response to replacement of a memory or replacement of a battery as said power supply, and means (ic 6-1, ic 6-3) for controlling the controllable switch means (ic 7-1) for producing said power OFF state of said input circuit (KM) corresponding to a press of the power OFF switch in accordance with an output of said switch means ( SW1, SW2, SW3 ). An electronic apparatus according to claim 1, characterized by third detection means (DET 3) for detecting that the supply voltage from the power supply falls below a third predetermined voltage in the third detection means (DET 3) lower than said second predetermined voltage and producing a detection output, wherein said second prohibitive controllable switch means (ic 7-3, ic 7-4) prohibits memory access in response to a detection output of said third detection means (DET 3) . An electronic apparatus according to claim 5, characterized in that said switch means comprise first switch means ( SW2, SW3 ) for detecting a replacement of a memory card in the electronic apparatus and outputting a signal, and second switch means ( SW1 ) for detecting a replacement of a battery in the electronic apparatus and outputting a signal. An electronic apparatus according to any one of claims 1, 2, 3, 5, 6, or 7 characterized in that said memory is a random access memory.

Inventors: ODAIRA ISAO, ODAIRA, ISAO, Odaira, Isao, c/o CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06F1
IPC codes: G06F1, H02J1