IC card

Abstract: An IC card (10) has data a transmission/receiving circuit (4, 5, 6) for conducting exchange of data with an external device, a data processing circuit (1, 2, 3) connected to said data transmission/receiving circuit for processing the data, a battery (8) for supplying said data transmission/receiving circuit and said data processing circuit with electrical power. A charge device (12) such as a capacitor is provided and is charged at a predetermined time constant by the power from said battery (8). A charging control circuit (11) controls the state of connection between said battery and said charge device in accordance with a control signal from said data processing circuit. A comparator circuit (14) compares the output voltage from said charge device (12) with a reference value, and a time measuring counter (16) measures the time from a moment at which an electrical connection between said battery (8) and said charge device (12) is completed by said charging control circuit (11) to a moment at which said comparator circuit (14) detects the output voltage from said charge circuit exceeding said reference value. It is possible to measure the time a plurality of times to determine a mean value to eliminate any fluctuation in the measured results. The rate of reduction in the voltage battery may be detected to inform any drastic drop of the battery voltage which occurs when the battery life is going to expire.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to an IC card and, more particularly, to a non-contact type IC card having a microcomputer incorporating a data memory, a battery and other built-in components. Description of the Related Art In recent years, non-contact type IC cards have been developed which have various built-in components such as a data processing CPU, a data memory for storing data, a transmission/receiving device for exchange of data with external devices, a battery for supplying power to internal circuits, and so forth. It is desirable that this type of IC card has a voltage detection circuit capable of detecting reduction in the voltage of the built-in battery. A voltage detection circuit for this purpose is already known for example from EP-A-316 517 (Toshiba). This known circuit has a Zener diode for generating a reference voltage by using the power of the built-in battery, a resistor for dividing the potential or output voltage of the battery, and means for comparing the measured divided voltage with the reference voltage so as to produce a signal when the measured voltage has become lower than the reference voltage. This known voltage detection circuit, however, has suffered from a problem in that different circuits have different levels of voltage detection so that the accuracy of the voltage detection is not so high, due to fluctuations in the properties of the components such as the Zener diode and the voltage-dividing resistor. SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide an IC card which can detect drop of voltage of the built-in battery with a high degree of accuracy, thereby overcoming the above-described problems of the prior art. To this end, according to a first aspect of the present invention, there is provided an IC card comprising: data transmission/receiving means for conducting exchange of data with an external device; data processing means connected to the data transmission/receiving means for processing the data; a battery for supplying the data transmission/receiving means and the data processing means with electrical power; characterised in that it comprises: charge means which is charged at a predetermined time constant by the power from the battery; charging control means for controlling the state of connection between the battery and the charge means in accordance with a control signal from the data processing means; comparator means for comparing the output voltage from the charge means with a reference value; and time measuring means for measuring the time from a moment at which an electrical connection between the battery and the charge means is completed by the charging control means to a moment at which the comparator means detects the output voltage from the charge means exceeding the reference value. According to a second aspect of the present invention, there is provided an IC card comprising: data transmission/receiving means for conducting exchange of data with an external device; data processing means connected to the data transmission/receiving means for processing the data; a battery for supplying the data transmission/receiving means and the data processing means with electrical power; characterised in that it comprises: a plurality of charge means which are charged with different time constants by the power from the battery; charging control means for selectively connecting the battery to one of the charge means in accordance with a control signal from the data processing means; comparator means for comparing the output voltage from the charge means connected to the battery by the charging control means with a reference value; and time measuring means for measuring the time from a moment at which an electrical connection between the battery and the charge means is completed by the charging control means to a moment at which the comparator means detects the output voltage from the charge means exceeding the reference value. In the first aspect of the invention, the charging control means connects the battery to the charge means in accordance with the control signal output from the data processing means, and the comparator means compares the output voltage of the charge means charged by the battery with the reference value. The time measuring means then measures the time from a moment at which the charging of the charge means is commenced till the moment at which the output voltage of the charge means exceeds the reference value. In the second aspect of the invention, the charging control means connects the battery to one of the plurality of the charge means in accordance with the control signal output from the data processing means, and the comparator means compares the output voltage of the charge means connected to and charged by the battery with the reference value. The time measuring means then measures the time from a moment at which the charging of the charge means is commenced till the moment at which the output voltage of the charge means exceeds the reference value. The invention is specified in the appended claims. The preamble of claim 1 and claim 2 is based on EP-A-316 157 BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram of an IC card in accordance with a first embodiment of the present invention; Fig. 2 is a circuit diagram of a voltage detection circuit incorporated in the IC card shown in Fig. 1; Fig. 3 is a flowchart illustrative of the operation of the voltage detection circuit shown in Fig. 2; Fig. 4 is a flow chart illustrative of the operation of a second embodiment of the invention; Fig. 5 is a flow chart illustrative of the operation of a third embodiment of the invention; Fig. 6 is a flow chart illustrating a process for setting a timer initial value or standard time in the second and third embodiments; Fig. 7 is a circuit diagram of a major portion of a voltage detection circuit used in a fourth embodiment; Fig. 8 is a flow chart illustrative of the operation of a fifth embodiment of the invention; and Fig. 9 is a flow chart illustrative of the operation of a sixth embodiment of the invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will be described hereinunder with reference to the accompanying drawings. Referring first to Fig. 1, an IC card 10 has a central processing unit (CPU) which conducts various controls in the card 10. A BUS 7 leading from the CPU 1 is connected to a read only memory (ROM) 2 for storing the programs of controls to be performed by the CPU 1, a random access memory (RAM) 3 for storing various data, and an input/output control circuit 4 for controlling exchange of serial data between the IC card 10 and external devices (not shown). A modulation/demodulation circuit 5 is connected at its one end to the input/output control circuit 4 and at its other end to an antenna 6. The IC card 10 also incorporates a built-in battery 8 for supplying various internal electric circuits with electric power. A voltage detection circuit 9 for monitoring the voltage of the battery 8 is connected to the BUS 7. In the IC card 10 having the described components, all the circuits or components except the battery 8 are formed on a single IC chip. The modulation/demodulation circuit 5 and the antenna 6 in cooperation form data transmission/receiving means, while CPU 1 serves as data processing means. The CPU 1 also serve as alarm means, mean value computing means and reduction rate computing means. A description will now be given of a data transmission/receiving operation performed by the IC card 10. When an electric magnetic wave carrying an input signal from an external device (not shown) is received by the antenna 6, this signal is digitized by the modulation/demodulation circuit 5 and is then input to the CPU 1 through the input/output control circuit 4. The CPU 1 processes the input signal in accordance with the program stored in the ROM 2 and stores the data in the RAM 3 as required. Data for responding to the external device, e.g., result of computation, is input to the modulation/demodulation circuit 5 through the input/output control circuit 4 so as to be changed into an analog signal. The analog signal is then transmitted in the form of an electromagnetic wave from the antenna 6. As a result of the repeated transmission and receipt data, the power stored in the built-in battery 8 of the IC card 10 is progressively consumed so that the voltage of the battery 8 becomes lower. The IC card 10 can no more operate safely when the voltage of the battery 8 comes down below a predetermined level. The voltage of the battery 8 is therefore continuously monitored by the voltage detection circuit 9. Fig. 2 shows the internal structure of the voltage detection circuit 9. The voltage detection circuit 9 has a transmission gate 11 connected to the battery 8 and forming a charging control means. A control signal for controlling the operation of the voltage detection circuit 9 is delivered by the CPU 1 to the transmission gate 11. When the level of this control signal is "L", the transmission gate 11 is turned off, whereas, when the signal level is "H", it becomes conductive and exhibits a predetermined load resistance R. A capacitor 12 serving as charging means and a transistor 13 for discharging are connected between the output of the transmission gate 11 and the ground. A voltage comparator gate 14 serving as comparator means is connected to the output terminal of the transmission gate 11. When the input voltage V in supplied to the voltage comparator gate 14 is lower than a predetermined threshold voltage V th , the voltage comparator gate 14 produces an output voltage V out of "L" level, whereas, when the input voltage V in is equal to or higher than the threshold voltage V th , it delivers an output voltage V out of "H" level. The threshold voltage V th is determined in relation to the initial voltage V B0 of the battery 8 so as to meet the following condition: 0 < V th < V B0 A timer 16 is connected to the output terminal of the voltage comparator gate 14 through a logical gate 15 which receives a signal formed by inversion of the output from the voltage comparator gate 14, as well as a control signal and a clock signal from the CPU 1. A re-load register 17 for setting the initial value of the timer 16 is connected to the timer 16. The logical gate 15 and the timer 16 in cooperation form time measuring means, while the re-load register 17 serves as initial value setting means. The timer 16 also serves as an overflow signal generating means. The operation of the voltage detection circuit 9 will be described with reference to a flow chart shown in Fig. 3. In Step 31, an input data signal is delivered from the CPU 1 to the timer 16 and the re-load register 17 so as to set "0" in the timer 16 and the re-load register 17. In Step 32, the CPU 1 sets the control signal to "L" level so as to turn off the transmission gate 11. In this state, Step 33 is executed in which a discharge signal pulse is delivered from the CPU 1 to the transistor 13 so as to temporarily turn the transistor 13 on, thus allowing the capacitor 12 to discharge. As a consequence, the input voltage V in of the voltage comparator gate 14 is reduced to zero. Since the input voltage V in becomes lower than the threshold voltage V th , the output voltage V out of the voltage comparator gate 14 is set to "L" level. In Step 34, the CPU 1 delivers a clock signal to the logical gate 15 and in Step 35, it delivers a control signal of "H" level both to the transmission gate 11 and the logical gate 15. Consequently, the transmission gate 11 becomes conductive, so that an electric current of a level determined by the load resistance R set in the transmission gate 11 is supplied to the capacitor 12, thus initiating the charging of the capacitor 12. Meanwhile, since both the control signal and the inverted output from the voltage comparator gate 14 received by the logical circuit 15 are of "H" level, the clock signal is supplied to the timer 16 through the logical gate 15, so that the timer 16 starts its count-up operation in accordance with the clock signal in Step 36. Representing the voltage of the battery 8 by V BE and the electrostatic capacitance of the capacitor 12 by C, the voltage V c of the capacitor 12, which is being charged by the charging current supplied through the transmission gate 11, is represented by the following function of time. Thus, the voltage increases as the time elapses. V C = V BE (1 - e (-t/CR) ) This voltage V c of the capacitor 12 is received by the voltage comparator gate 14. Therefore, when the voltage V c reaches the threshold voltage V th of the voltage comparator gate 14, the output voltage V out of the voltage comparator gate 14 is changed to "H" level. As the output voltage V out is set to "H" level in Step 37, the output of the logical circuit 15 is set to "L" level so that the timer 16 stops the counting operation in Step 38. Subsequently, the CPU 1 stops the delivery of the clock signal in Step 39 and sets the control signal to "L" level in Step 40. Then, Step 41 is executed in which the CPU 1 reads the measured time value t m from the timer 16. The following condition is obtained by substituting the measured time value t m in the formula (1). V th = V BE (1 - e (-tm/CR) ) The voltage V BE of the battery 8 is therefore expressed as follows: V BE = V th /( 1 - e (-tm/CR) ) It is thus possible to compute the voltage V BE of the battery 8. In the first embodiment described hereinbefore, the measured time value t m is read directly from the timer 16. In a second embodiment which will be described hereinafter, whether the time measured by the timer 16 exceeds a predetermined value is determined and an alarm signal is produced in accordance with the result of the determination. The second embodiment will be described with reference to a flowchart shown in Fig. 4. An initial value t 1 of the timer 16 is beforehand stored in a predetermined area of the RAM 3. In Step 42, the CPU 1 reads this initial value t 1 from the RAM 3 and sets the initial value t 1 in the timer 16 and in the re-load register 17 by delivering an input data signal. Subsequently, in Step 43, the CPU 1 sets the control signal to "L" level to turn off the transmission gate 11 and, in Step 44, the CPU 1 delivers a discharge signal pulse to the transistor 13 thereby causing the capacitor 12 to discharge. Subsequently, in Step 45, the CPU 1 applies a clock signal to the logical gate 15 and applies a control signal of "H" level to the transmission gate 11 and the logical gate 15 in Step 46. As a consequence, the charging of the capacitor 12 is commenced and in Step 47, the timer 16 commences the counting operation in accordance with the clock signal. In Step 48, whether the output voltage V out of the voltage comparator gate 14 has been set to "H" level is determined. If the answer is NO, i.e., if the output voltage V out has not been changed to "H" level, the process proceeds to Step 49 in which a judgment is conducted as to whether an overflow signal has been produced by the timer 16. Thus, the timer 16 continues the counting operation until the output voltage Vout of the voltage comparator gate 14 becomes "H" level or until the timer 16 overflows. If the output voltage V out of the voltage comparator circuit 14 is changed to "H" level before an overflow of the timer 16, the CPU 1 judges that the voltage V BE of the battery 8 is still high, and delivers a normal signal indicative of normal state of the battery 8 to the unillustrated external device in Step 50. In this state, the output of the logical gate 15 is set to "L" level so that the timer 16 stops the counting operation in Step 51. Furthermore, the CPU 1 stops the clock signal in Step 52 and sets the control signal to "L" level in Step 53. Conversely, if the timer 16 overflows before the change of the output voltage V out of the voltage comparator circuit 14 to "H" level, the CPU 1 judges that too long time is required for charging the capacitor 12. i.e., that the voltage V BE of the battery 8 has been lowered. The process then proceeds to Step 54 in which the CPU 1 delivers to the external device an alarm signal indicative of the abnormal state of the battery 8. The process then proceeds to Step 51. In the second embodiment as described, the external device can detects the reduction of voltage of the battery 8 in the IC card through the reception of the alarm signal delivered from the IC card, thus facilitating execution of a suitable countermeasure such as replacement of the battery 8, storage of the data stored in the IC card,and so forth. Fig. 5 shows the operation of a third embodiment of the present invention. In this embodiment, a standard time t L for generating an alarm signal is beforehand stored in a predetermined area of the RAM 3. The time value t m is measured in Step 55, in the same way as the measurement of the first embodiment, i.e., the flowchart shown in Fig. 3. In Step 56, the CPU 1 reads the standard time t L from the RAM 3 and then compares it with the measured time value t m in Step 57. When the condition tm ≦ t L is met, the CPU 1 determines that the voltage V BE of the battery 8 is still high and delivers a normal signal to the external device (not shown) in Step 58. However, when the condition tm > t L is met, the CPU 1 determines that the voltage V BE of the battery 8 is low and delivers an alarm signal to the external device in Step 59. A description will now be given of the method for setting the initial value t 1 used in the second embodiment or the standard time t L used in the third embodiment, with specific reference to a flow chart shown in Fig. 6. This setting is executed only once in the course of the production of the IC card. In Step 60, the threshold voltage V th of the voltage comparator circuit 14 in the state before connection in the voltage detection circuit 9 is measured. This Step 60 is executed for the purpose of effecting compensation for any error between the design value and the actual value of the threshold voltage V th and, therefore, may be omitted when the error is negligibly small. In Step 61, the initial voltage V B0 of the battery 8 before the mounting in the IC card is measured. Subsequently, in Step 62, the battery 8 and the circuits are mounted on the circuit board of the IC card in Step 62. In Step 63, the time value t m0 in this initial state is measured by the voltage detection circuit 9. This measurement is conducted in accordance with the flowchart shown in Fig. 3. The threshold voltage V th , the initial voltage V B0 and the time value t m0 are substituted in formula (2) so that the time constant τ is computed as the product CR of the capacitance C of the capacitor 12 and the load resistance R of the transmission gate 11. It will be seen that the initial voltage V B0 and the initial time value t m0 are substituted for the voltage V BE and the time value t m in the formula (2), respectively. The computation of the time constant τ has been done in consideration of the difference between the design value and the actual value. Therefore, Steps 61 to 64 may be omitted if the error is negligible. In Step 65, the initial value t 1 of the timer 16 or the standard time t L is calculated in accordance with the formula(2) by using the threshold voltage V th and the time constant τ computed in Steps 60 and 64, on an assumption of the battery voltage V B1 at which the alarm is to be produced. The initial value t 1 or the standard time t L is then written in the RAM 3. The time value t m measured in accordance with the flow chart of Fig. 3 becomes progressively greater than the initial time value t m0 as the power of the battery 8 is consumed. It is therefore possible to determine the standard time t L by computing a predetermined fixed value t c from the design value and adding it to the initial time value t m0 obtained in Step 63 of the flow chart shown in Fig. 6. It is also possible to determine the initial timer value t 1 from this standard time t L . It is also possible to store plurality of the timer initial values t 1 or the standard times t L in the RAM and to arrange such that different types of alarm signals are generated in accordance with different values of the timer initial value t 1 or the standard time t L . This arrangement makes it possible to observe and monitor the state of reduction of the battery of the voltage 8 in a plurality of stages. Fig. 7 shows the major portion of the voltage detection circuit in the fourth embodiment of the present invention. In this fourth embodiment, three transmission gates 11a, 11b, 11c having different load resistance values Ra, Rb, Rc are connected in parallel with one another so as to be controlled by independent control signals S 1 , S 2 , S 3 , respectively. At the same time, three capacitors 12a, 12b, 12c having different capacitance values are connected in parallel with one another and transistors 18a, 18b, 18c are connected in series to the respective capacitors 12a, 12b, 12c. The transistors 18a, 18b, 18c are adapted to be turned on and off in accordance with independent selection signals S 4 , S 5 , S 6 . It is therefore possible to change the time constant τ by selecting one of the control signals S1, S2, S3 and one of the selection signals S 4 , S 5 , S 6 by the operation of the CPU 1. Thus, the level of detection of battery voltage can be freely changed in accordance with a change in the factors such as the range of the timer 16, clock frequency, type of the battery 8 and the detection accuracy. Fig. 8 illustrates the operation of a fifth embodiment of the present invention. In this embodiment, the voltage detection circuit 9 consecutively conducts the measurement of the time a plurality of times and determines the mean of the measured time values. In Step 66, the CPU 1 sets a value i = 1 and, in Step 67, conducts the first cycle of measurement to measure a time value t mi . This measurement is executed in accordance with the flow chart shown in Fig. 3. In Step 68, the CPU 1 stores the measured time value t mi in the RAM 3 and, in Step 69, the CPU 1 increments the value of i by one. Then, Steps 67 to 69 are repeatedly conducted until the value of i exceeds a predetermined number n . In Step 70, when the CPU 1 has judged that the value of i has exceeded the predetermined value n , the CPU determines that the n cycles of time measurement has been completed, and proceeds with the process to Step 71. In this Step, the CPU 1 reads the measured time values t m1 to t mn from the RAM 3 and computes the mean of these time values. By using the mean value over the measuring cycles, it is possible to accurately detect the voltage reduction without being influenced by any fluctuation in the measurement in each measuring cycle. Fig. 9 is a flow chart showing a method for measuring the rate of reduction in the battery voltage in a sixth embodiment of the invention. In Step 72, the CPU 1 operates periodically or in accordance with an instruction from an external device (not shown) so as to enable the voltage detection circuit 9 to measure the time t mi . The suffix i indicates an i-th cycle of measurement. This measurement is conducted in accordance with the flow chart shown in Fig. 3. In Step 73, the CPU 1 operates to record, in the RAM 3, the measured time value t mi obtained in Step 72 and the time T mi at which the measurement was conducted. Then, in Step 74, the CPU 1 reads the measured time value t mi-1 and the measuring time T mi-1 which were stored in the RAM 3 after the completion of preceding cycle of measurement, and computes the rate D of reduction of the battery voltage in accordance with the following formula in Step 75: D = (t mi - t mi-1 )/(T mi - T mi-1 ) By computing the rate D of reduction of the battery voltage, it is possible to detect a drastic drop of the battery voltage which occurs when the life of the battery 8 is going to expire. Thus, prediction of the life of the battery 8 is facilitated, so that the battery voltage can be detected with a higher degree of accuracy.

Claims: An IC card (10) comprising: data transmission/receiving means (5, 6) for conducting exchange of data with an external device; data processing means (1, 2, 3) connected to said data transmission/receiving means for processing the data; and a battery (8) for supplying said data transmission/receiving means and said data processing means with electrical power; characterised in that it comprises: charge (12) means which is charged at a predetermined time constant by the power from said battery; charging control means (11) for controlling the state of connection between said battery (8) and said charge means (12) in accordance with a control signal from said data processing means; comparator means (14) for comparing the output voltage from said charge means with a reference value; and time measuring means (16) for measuring the time from a moment at which an electrical connection between said battery and said charge means is completed by said charging control means to a moment at which said comparator means detects the output voltage from said charge means exceeding said reference value. An IC card comprising: data transmission/receiving means (5, 6) for conducting exchange of data with an external device; data processing means (1, 2, 3) connected to said data transmission/receiving means for processing the data; and a battery (8) for supplying said data transmission/receiving means and said data processing means with electrical power; characterised in that it comprises: a plurality of charge means (12a, 12b, 12c) which are charged with different time constants by the power from said battery; charging control means (11a, 11b, 11c; 18a, 18b, 18c) for selectively connecting said battery to one of said charge means in accordance with a control signal from said data processing means; comparator means (14) for comparing the output voltage from said charge means connected to said battery by said charging control means with a reference value; and time measuring means (16) for measuring the time from a moment at which an electrical connection between said battery and said charge means is completed by said charging control means to a moment at which said comparator means detects the output voltage from the charge means exceeding said reference value. An IC card according to Claim 1 or 2, further comprising alarming means (1) for generating an alarm signal when the time measured by said time measuring means has exceeded a predetermined value. An IC card according to Claim 1, 2 or 3 further comprising: initial value setting means (17) for setting an initial value in said time measuring means; an overflow signal generating means for generating an overflow signal when the time measured by said time measuring means has exceeded a predetermined value; and alarming means (1) for generating an alarm signal in response to the overflow signal generated by the overflow generating means. An IC card according to Claim 1, 2, 3 or 4 further comprising mean value computing means (1) for causing said time measuring means to execute the measurement of the time at least two times consecutively and computing the mean value of the time values measured in the consecutive measuring cycles. An IC card according to any preceding Claim, further comprising voltage reduction rate computing means (1) for causing said time measuring means to execute the measurement of the time at least two times consecutively and computing the rate of reduction of the voltage of said battery from the time values measured in the consecutive measuring cycles. An IC card according to any preceding Claim, wherein said charge means, said charging control means, said comparator means and said time measuring means are formed in a chip. An IC card according to any preceding Claim, wherein said charging control means (11) includes a transmission gate connected between said battery and said charge means.

Inventors: TAKAHIRA KENICHI, TAKAHIRA, KENICHI, TAKAHIRA, KENICHI, C/O KITAITAMI SEISAKUSHO
Applicants: MITSUBISHI ELECTRIC CORP, MITSUBISHI DENKI KABUSHIKI KAISHA
Application year: 1991
Main classification: G06K19
IPC codes: B42D15, G06K19