ELECTRONIC DEVICE WITH CALENDAR FUNCTION

Abstract: An electronic device with calendar function in­ cludes a timer for supplying a carry signal for every 24 hours in response to a clock signal and a date counter (33) for counting the carry signal. A CPU (21) reads out the calendar data stored in a memory (30) and adds the content of the date counter (33) to the calendar data so as to perform the processing such as the updat­ ing process of year, month and date and the updating process for the leap year, when the CPU (21) is operated in response to the start operation by means of a key­ board (12) or a reader/writer to which the electronic device is connected.

Description: The present invention relates to an electronic device such as an electronic calculator or IC card which has a calendar function (the function of counting and displaying the year, month and date (including the day of the week)) and which can be energized by an external power source or a built-in battery. Recently, with the development of microcomputers, various card-like calculators or IC cards have been developed. Some of the desk calculators and IC cards have a time counting or calendar function. For example, European Patent Publication EP-A-0 167 044 (inventor: K. Rikuna et al.), discloses an intelligent card which realizes the calendar function by hardware. However, since the calendar function of the above intelligent card is realized by a complete set of hardware circuits, the circuit arrangement becomes complex to adjust the month count depending on the number of days of the month, and the date count depending on the leap year. Therefore, the chip size is increased, which is undesirable for the thin card-like calculator or the IC card. The document US-A-4 240 150 discloses a timepiece calculator operating in a battery saving mode. During external operations, i.e. when it is used as a calculator, the timing pulse generator is halted. Since however the longest calculation takes at maximum 1 second, no updating of the timing is necessary. This mode therefore could not be used for longer interruptions. The calendar data may also be updated by a software. In this case, each time the date data is changed, the calendar data stored in a memory are read out. The calendar data is incremented by "1" to be updated. The updated calendar data are rewritten in the memory. In order to update the calendar data as described above, it is necessary to automatically turn on the power source once a day so as to operate the CPU which in turn updates calendar data. Therefore, even if a user does not use the card-like calculator or IC card, the device itself regularly operates, thus dissipating the power of the built-in battery. As a result, the service life of a capacity-limited built-in battery used in the card-like calculator or IC card is undesirably shortened. An object of the present invention is to provide an electronic device with calendar function which can reliably update the calendar data without increasing the chip size of the circuit and the dissipation of the battery power. To achieve the above object, an electronic device with calendar function includes a clock signal generating circuit for generating a clock signal; a memory for storing a calendar data; a time data generating circuit for generating a time data in response to the clock signal generated from the clock signal generating circuit; a date counter for counting the time data generated from the time data generating circuit to produce a count data; and a control unit for updating the calendar data stored in the memory based on the count data from the date counter when the control unit is operated in response to an external start operation. According to the electronic device with calendar function of this invention, the date counter is provided for counting a carry signal generated from a timer circuit for every 24 hours. For example, when an input operation is effected from a keyboard of the electronic device or when a power source voltage is externally supplied thereto by connecting the electronic device to an IC card reader/writer and performing a predetermined operation, for example, the count data of the date counter is added to the calendar data in the memory by utilizing the power required for performing the predetermined operation. Therefore, the CPU which consumes a relatively large power is not operated when the electronic device is not used by a user. As a result, the calendar data can be updated as if no power were required apparently therefor. Other objects and features of the present invention will be apparent from the following description taken in connection with the figures in which: Fig. 1 is a plan view showing an arrangement of an IC card to which the present invention is applied; Fig. 2 is a block diagram of an electronic device with calendar function according to one embodiment of the present invention; Fig. 3A is a flowchart showing a reset processing routine; and Fig. 3B is a flowchart showing a detail of the date updating subroutine shown in Fig. 3A. Fig. 1 is a plan view showing an arrangement of an IC card to which the present invention is applied. Contact portion 11 which is connected to an IC card reader/writer unit (not shown), keyboard section 12 and display section 13 constituted by liquid crystal display elements are provided on the upper surface of IC card 10. Keyboard section 12 includes function keys (F1, F2, F3, F4) 12a for specifying the processing mode; numeric keys 12b; arithmetic keys, or addition(+) key 12c, subtraction (-) key 12d, division (÷) key 12e and multiplication (×) key 12f; decimal point (.) key 12g; and equal (=) key 12h. Function keys 12a selects one of processings for desk calculator mode (F1), time display mode (F2), electronic passbook mode (F3) and purchasing mode (F4) in an off-line processing or when the processing is effected by IC card 10 alone. In the transaction mode, processings corresponding to the type of card such as a credit card and a cash card is selected in accordance with the combination of the F4 key and numeric keys 12b. Addition key 12c is also used as a key to advance the display state of display unit 13. In contrast, subtraction key 12d is also used as a BACK key to change the display state of display unit 13 to a previous one. Further, decimal point key 12g is used as a "NO" key, or a completion key, and equal key 12h is used as a "YES" key and a power source key. The functions of these keys are determined depending on the selected mode. Note that the mode selection and the key function are not directly related to the present invention and therefore the detailed explanation thereof is omitted. The circuit of IC card 10 is arranged as shown in Fig. 2. In Fig. 2, contact portion 11 comprises clock signal terminal 11a, reset signal terminal 11b, data input/output (I/O) terminal 11c, power source voltage supply terminal 11d, ground terminal 11e and open terminal 11f. Clock control circuit 22 and reset control circuit 23 are provided between terminals 11a and 11b, and central processing unit (CPU) 21, respectively. Crystal oscillator 24 for generating a signal of 1 MHz is connected to clock control circuit 22. One-bit I/O port (P) 25 is connected between terminal 11c and system bus 38 of CPU 21. Further, power source control circuit 26 to which built-in battery 27 is connected is connected to terminals 11d and 11e. System bus 38 of CPU 21 is connected to program memory 28 storing a control program, working memory 29, data memory 30 for storing 4-digit password, for example, and calendar data, display interface circuit 31, keyboard interface circuit 32, binary date counter 33 and timer circuit 34 which is connected to date counter 33. For example, date counter 33 and timer circuit 34 may be constructed by a universal counter. Interface circuit 31 is connected to display section 13 via display driving circuit 35, and keyboard interface circuit 32 is connected to keyboard section 12. Further, timer circuit 34 is connected to clock oscillation circuit 36 which is also connected to crystal oscillator 37 for generating a signal of 32.768 KHz, for example. When IC card 10 is standing by or in a key-input wait mode (no keys are depressed for a period of time) in an off-line mode in which the card operates using built-in battery 27, clock control circuit 22 stops the supplement of the clock signals to CPU 21 to completely cease the CPU operation. If, in the ceased state, power source key (equal key) 12h is depressed, clock signals are supplied to CPU 21. Reset control circuit 23 supplies a trigger signal to CPU 21 in response to a reset signal which is internally or externally supplied thereto. Upon receiving the external power source, power source control circuit 26 switches to the external power source from built-in battery 27 after a predetermined period of time. On the contrary, circuit 26 switches to built-in battery 27 from an external power source when the external power source voltage is lowered to a certain level or when the external power source is turned off. Program memory 28 stores an on-line processing program, an off-line processing program, and a test program (self-diagnosis program) to be executed when IC card 10 is manufactured. Display interface circuit 31 converts the display data supplied from CPU 21 into a character pattern by use of a character generator (not shown) which is formed of an internal ROM, and displays the character pattern on display unit 13 by means of display driving circuit 35. Keyboard interface circuit 32 supplies to CPU 21 a key input signal corresponding to a key actuated on keyboard section 12. Timer circuit 34 keeps counting an output signal from clock oscillator circuit 36 to produce time data representing hours, minutes and seconds. Date counter 33 counts a carry signal supplied from timer circuit 34 for every 24 hours. The calendar data updating operation of the electronic device with calendar function as described above will now be explained with reference to the flowcharts shown in Figs. 3A and 3B. Fig. 3A and 3B are flowcharts respectively showing the reset processing effected by reset control circuit 23 shown in Fig. 2 and the date updating processing effected by CPU 21. In step 41 shown in Fig. 3A, it is determined whether or not a power source voltage is externally supplied to the electronic device. Assume now that power source key ("YES" key) 12h of keyboard section 12 is actuated to turn on the power source, thus permitting an output voltage of built-in battery 27 to be supplied to CPU 21. In this case, it is determined in step 41 that the power source voltage is not externally supplied, and therefore CPU 21 waits in step 43 until the power is turned on. That is, CPU 21 is set in the idle state. If it is detected in step 45 that power source voltage is supplied to CPU 21, CPU 21 determines in step 47 whether or not date counter 33 is counted up. If "NO" in step 47, the date and the time (hours, minutes and seconds) are displayed on display unit 13 in step 51. That is, in this case, CPU 21 first reads out time data (hours, minutes and seconds) of timer circuit 34, count data of date counter 33 and calendar data (year, month and date) which have been stored in data memory 30 when the power source has been last turned on. Then, CPU 21 displays the time data and the date data from the read-out calendar data on display section 13 through display interface circuit 31 and display driving circuit 35. In contrast, if it is determined in step 47 that date counter 33 is counted up, CPU 21 performs the date updating process in step 49. That is, in step 59 shown in Fig. 3B, CPU 21 reads out calendar data (year, month, date and day of the week) from data memory 30. Then, CPU 21 reads out count data from date counter 33 in step 61. Next, CPU 21 adds the count data of date counter 33 to the calendar data read out from data memory 30. That is, the count data of date counter 33 is added to the date data included in the calendar data, and it is determined in step 65 whether or not the addition result exceeds the limit number of days for the month (30 or 31 days, for example). If the addition result is not in excess of the limit number of days, CPU 21 returns to step 51 in Fig. 3A and displays the time data and the date data. On the contrary, if it is determined in step 65 that the addition result exceeds the limit number of days, month data is incremented in step 67 and then it is determined in step 69 whether the added month data is more than 12 or not. If it is determined that the added month data is more than 12, the month data is set to "1" (indicating January) in step 71, and year data is incremented by "1" in step 73. The year updating processing described above includes the updating processing for the leap year. Calendar data attained by updating year, month and date is transferred to display unit 13 via display interface circuit 31 and display driving circuit 35 in step 51 shown in Fig. 3A, and is displayed on display section 13. Now, assume that the electronic device communicates with an external device via contact portion 11 in step 41 in Fig. 3A. In this case, it is determined in step 41 of Fig. 3A that a power source voltage is externally supplied. Therefore, CPU 21 supplies an "answer to reset" signal, which indicates that it is ready for receiving data, to the external device in step 53. Then, in step 55, date updating process as described with reference to Fig. 3B is effected. Thereafter, CPU 21 is set ready for receiving data from the external device in step 57. The succeeding processings are the same as those of an ordinary on-line processing, and therefore the explanation thereof is omitted. In the above embodiment, date counter 33 is provided which is incremented by means of timer circuit 34 for every 24 hours. The calendar data attained when the power source is last turned on are stored in data memory 30. When the power source of the IC card is turned on, the count data of date counter 33 is added to the calendar data to update data of year, month and date, thereby providing correct calendar data. Thus, unlike the prior art, it becomes unnecessary to operate CPU 21 for every 24 hours in order to update the calendar data, thereby reducing the power consumption of built-in battery 27. Further, when the power source of the IC card is turned off, the power of built-in battery 27 is consumed by timer circuit 34 and data counter 33. However, since timer circuit 34 and date counter 33 are formed of simple-structured circuits, the power consumption is considerably reduced in comparison with the case where the calendar function is realized all by hardware circuits. In the above embodiment, the present invention applies to an IC card. However, the present invention is not limited to the above embodiment and can apply to various electrical devices.

Claims: An electronic device having a memory for storing calendar data; a clock signal generating circuit (36, 37) for generating clock signals; and time data generating means (33, 34) for generating time data in response to the clock signal generated from said clock signal generating circuit (36, 37); characterized in that said time data generating means includes a timer circuit (34) for supplying a carry signal for every predetermined period of time in response to the clock signal and a date counter (33) circuit for counting the carry signal generated from said timer circuit (34), and characterized by further comprising control means (21) for updating the calendar data stored in said memory means based on the count data from said counter circuit when said control means is operated in response to an external start operation. An electronic device according to claim 1, characterized by further comprising a power source (26, 27) for supplying an electric power and a keyboard (12) having a group of keys for inputting data and characterized in that said control means updates the calendar data when the key of said keyboard is operated and said power source means is turned on. An electronic device according to claim 1, characterized by further comprising a contact portion (11) to be connected with an external device, and characterized in that said control means updates the calendar data when a power source voltage is supplied from the external device via said contact portion. An electronic device according to claim 1, characterized in that said control means (21) clears the content of said counter means after the calendar data updating operation is completed. An electronic device according to claim 1, characterized in that said time data generating means (33, 34) includes timer means (34) for counting the time data in response to the clock signal and supplying a carry signal for every predetermined period of time; and date counting means (33) for counting the carry signal supplied from said timer means. An electronic device according to claim 1, characterized in that the calendar data stored in said memory means (30) includes data of year, month, date and day of the week. An electronic device according to claim 1, characterized in that the calendar data updating operation includes the process of updating the date, month and year and updating process for the leap year. An electronic device according to claim 2, characterized in that said power source (26, 27) includes a battery. An electronic device according to claim 1, characterized in that said electronic device is an IC card. An electronic device according to claim 2, characterized in that the key of said keyboard includes a power on key and said control means performs the calendar data updating operation by use of power supplied to said control means for processing key-in data input from said keyboard. An electronic device according to claim 10, characterized by further comprising display means (13) and characterized in that said control means (21) reads out the calendar data from said memory means (30) in response to the operation of said power on key and drives said display means to display the read-out calendar data. An electronic device according to claim 1, characterized in that said control means (21) is a microcomputer. An electronic device according to claim 1, characterized by further including means (21) for setting the calendar data to be stored in said memory means (30) to an initial value and then storing the calendar data into said memory means. An electronic device according to claim 1, characterized in that said memory means (30) is a non-volatile memory.

Inventors: KAWAGISHI,TOSHIYUKI C/O PATENT DIVISION, NARA, SEIETSU C/O PATENT DIVISION
Applicants: KABUSHIKI KAISHA TOSHIBA
Application year: 1988
Main classification: G09D3
IPC codes: G04G3, G09D3