Circuit device and real time clock device
The circuit device addresses the challenge of flexible charging control in real-time clock devices by using a voltage detection circuit and a processing circuit to compare and manage charging based on threshold voltage data, enhancing adaptability to various backup elements.
Patent Information
- Application Number
- JP2023164648
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-04-08
AI Technical Summary
Conventional real-time clock devices struggle with flexible charging control for backup elements due to the use of fixed reference voltages for voltage detection, making it difficult to accommodate various types of backup elements.
A circuit device with a voltage detection circuit, a register unit for storing threshold voltage data, a processing circuit for comparing backup voltage data with threshold voltage data, and a power supply control circuit to manage charging of the backup element based on the comparison results, allowing for flexible charging control.
This solution enables flexible charging control that corresponds to various backup elements by allowing the threshold voltage data to be set according to the specific backup element, reducing the circuit scale and improving adaptability.
Smart Images

Figure 2025055363000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a circuit device, a real-time clock device, and the like. [Background technology]
[0002] Patent Document 1 discloses a real-time clock device that detects voltage by intermittently turning on a switch provided between a terminal of a main power supply and a terminal of a backup power supply, and switches between the main power supply and the backup power supply. A backup element to which the backup power supply voltage is supplied is charged by the main power supply according to the result of the voltage detection. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP2014-017965A Summary of the Invention [Problem to be solved by the invention]
[0004] In the conventional technology of Patent Document 1, voltage detection is performed by comparing the backup power supply voltage with a fixed reference voltage using a comparator circuit, which makes it difficult to realize flexible charging control compatible with various backup elements. [Means for solving the problem]
[0005] One aspect of the present disclosure relates to a circuit device including a main power supply terminal to which a main power supply voltage is supplied, a backup power supply terminal to which a backup power supply voltage from a backup element is supplied, a voltage detection circuit that detects the backup power supply voltage and outputs backup voltage data corresponding to the backup power supply voltage, a register unit that stores threshold voltage data to be compared with the backup voltage data, a processing circuit that compares the backup voltage data with the threshold voltage data, and a power supply control circuit that controls charging of the backup element by the main power supply voltage based on a comparison result in the processing circuit.
[0006] Another aspect of the present disclosure relates to a real-time clock device including the circuit device described above and an oscillator, the circuit device including an oscillator circuit that oscillates the oscillator to generate a clock signal, and a timing circuit that performs timekeeping processing based on the clock signal. [Brief description of the drawings]
[0007] [Figure 1] 2 shows an example of the configuration of a circuit device according to the present embodiment. [Diagram 2] 3 shows a detailed configuration example of the circuit device of the present embodiment. [Diagram 3] An example of a register in the register section. [Figure 4] 1 shows an example of a voltage detection circuit configuration. [Diagram 5] 2 shows an example of the configuration of a real-time clock device including a circuit device. [Figure 6] FIG. 4 is a diagram illustrating the operation of the power supply control circuit when the power is turned on. [Figure 7] FIG. 4 is an explanatory diagram of an example of switching control of a power supply control circuit. [Figure 8] FIG. 4 is an explanatory diagram of an example of switching control of a power supply control circuit. [Figure 9] FIG. 4 is an explanatory diagram of latch control of backup voltage data. [Figure 10] FIG. 4 is an explanatory diagram of latch control of backup voltage data. [Figure 11] An example of a register used in an interrupt generation circuit. [Figure 12]An example of a voltage sensor configuration. [Figure 13] FIG. 4 is a signal waveform diagram illustrating the operation of a voltage sensor. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] The present embodiment will be described below. Note that the present embodiment described below does not unduly limit the contents of the claims. Furthermore, not all of the configurations described in the present embodiment are necessarily essential configurations.
[0009] 1. Circuit device, real-time clock device FIG. 1 shows a configuration example of the circuit device 20 of this embodiment. The circuit device 20 includes a voltage detection circuit 30, a register unit 40, a processing circuit 50, a power supply control circuit 60, a main power supply terminal TVDD, and a backup power supply terminal TVBAT. The circuit device 20 may also include a ground terminal TGND. The circuit device 20 is, for example, an IC manufactured by a semiconductor process, and is a semiconductor chip in which circuit elements are formed on a semiconductor substrate. The circuit device 20 may also be a semiconductor device in which a semiconductor chip is mounted in a package. The circuit device 20 of this embodiment is not limited to the configuration of FIG. 1, and various modifications are possible, such as omitting some of the components, adding other components, or replacing some of the components with other components. The connection in this embodiment is an electrical connection. An electrical connection is a connection that allows an electrical signal to be transmitted, and is a connection that allows information to be transmitted by an electrical signal. The electrical connection may be a connection via a passive element or the like.
[0010] The main power terminal TVDD is a terminal to which the main power voltage VDD is supplied. The main power voltage VDD is, for example, a high-potential power voltage, and is supplied from an external power supply device or the like. The backup power terminal TVBAT is a terminal to which the backup power voltage VBAT from the backup element 12 is supplied. The backup power voltage VBAT is, for example, a power voltage due to the storage of electricity in the backup element 12. The ground terminal TGND is a terminal to which GND, which is a ground voltage, is supplied. GND can also be called VSS, and the ground voltage is, for example, a ground potential. Each of the terminals TVDD, TVBAT, and TGND is, for example, a pad of the circuit device 20. For example, in the pad region, a metal layer is exposed from a passivation film, which is an insulating layer, and the exposed metal layer constitutes a pad, which is a terminal of the circuit device 20.
[0011] The backup element 12 is an element for holding the backup power supply voltage VBAT. Examples of the backup element 12 include a secondary battery or a supercapacitor. A primary battery can also be used as the backup element 12. Examples of the secondary battery include a lithium ion battery, a metal lithium battery, a nickel-cadmium battery, a sodium ion battery, a lead-acid battery, a solid-state battery, or a semi-solid-state battery. A supercapacitor is also called a large-capacity capacitor. Examples of the supercapacitor include an electric double layer capacitor (EDLC), a pseudocapacitor, or a hybrid capacitor.
[0012] The voltage detection circuit 30 is a circuit that detects a voltage. In FIG. 1, the voltage detection circuit 30 detects a backup power supply voltage VBAT. The voltage detection circuit 30 outputs backup voltage data DVBAT corresponding to the backup power supply voltage VBAT. The backup voltage data DVBAT is digital data that represents the voltage value of the analog backup power supply voltage VBAT. The voltage detection circuit 30 can also detect the main power supply voltage VDD.
[0013] The register unit 40 stores various information. The register unit 40 can also be called a memory circuit. The register unit 40 includes a plurality of registers. The register unit 40 can be realized by, for example, a flip-flop circuit or a memory such as a RAM. In FIG. 1, the register unit 40 stores threshold voltage data DVT to be compared with the backup voltage data DVBAT. For example, the threshold voltage data DVT is stored in a register RG included in the register unit 40. The register unit 40 can store a plurality of threshold voltage data DVT to be compared with various voltages, and in this case, each of the plurality of registers included in the register unit 40 stores each threshold voltage data of the plurality of threshold voltage data DVT. The threshold voltage data DVT is data representing a threshold voltage to be compared with the backup power supply voltage VBAT represented by the backup voltage data DVBAT.
[0014] The processing circuit 50 is a circuit that performs various processes. The processing circuit 50 can be realized, for example, by an ASIC (Application Specific Integrated Circuit) circuit that is automatically placed and wired, such as a gate array, or by a processor, such as a CPU of a microcomputer. In FIG. 1, the processing circuit 50 compares the backup voltage data DVBAT with the threshold voltage data DVT. The processing circuit 50 performs a comparison process to determine whether the backup voltage data DVBAT exceeds the threshold voltage data DVT or whether the backup voltage data DVBAT falls below the threshold voltage data DVT. The comparison process of the backup voltage data DVBAT with the threshold voltage data DVT corresponds to a comparison between the backup power supply voltage VBAT represented by the backup voltage data DVBAT and the threshold voltage represented by the threshold voltage data DVT.
[0015] The power supply control circuit 60 is a circuit that performs various power supply controls, such as switching control of the power supply voltage. The power supply control circuit 60 can also be called a power supply switching control circuit or a charging control circuit. In FIG. 1, the power supply control circuit 60 controls charging of the backup element 12 with the main power supply voltage VDD based on the comparison result in the processing circuit 50. For example, the processing circuit 50 outputs a comparison result of the backup voltage data DVBAT with the threshold voltage data DVT. This comparison result is, for example, a comparison result as to whether the backup voltage data DVBAT exceeds the threshold voltage data DVT or whether the backup voltage data DVBAT falls below the threshold voltage data DVT. The power supply control circuit 60 performs charging control of the backup element 12 with the main power supply voltage VDD based on this comparison result. For example, based on the comparison result from the processing circuit 50, the power supply control circuit 60 electrically connects the main power supply terminal TVDD and the backup power supply terminal TVBAT to charge the backup element 12 with the main power supply voltage VDD, or electrically disconnects the main power supply terminal TVDD and the backup power supply terminal TVBAT to stop charging of the backup element 12 with the main power supply voltage VDD.
[0016] As described above, the circuit device 20 of the present embodiment includes the main power supply terminal TVDD, the backup power supply terminal TVBAT, the voltage detection circuit 30, the register unit 40, the processing circuit 50, and the power supply control circuit 60. The voltage detection circuit 30 detects the backup power supply voltage VBAT and outputs the backup voltage data DVBAT, and the register unit 40 stores the threshold voltage data DVT. The processing circuit 50 compares the backup voltage data DVBAT with the threshold voltage data DVT, and the power supply control circuit 60 controls the charging of the backup element 12 by the main power supply voltage VDD based on the comparison result in the processing circuit 50. In this way, the charging of the backup element 12 can be controlled based on the comparison result between the threshold voltage data DVT stored in the register unit 40 and the backup voltage data DVBAT from the voltage detection circuit 30 that detects the backup power supply voltage VBAT. For example, the charging of the backup element 12 can be controlled by comparing the threshold voltage data DVT, which is a variable value stored in the register unit 40, with the backup voltage data DVBAT. This makes it possible to realize flexible charging control of the backup element 12. For example, since various values of threshold voltage data DVT can be stored in the register unit 40, it becomes possible to flexibly set the threshold value for charging control. This makes it possible to support various backup elements 12.
[0017] For example, the conventional technology of Patent Document 1 mentioned above is configured to compare the backup power supply voltage with a fixed reference voltage using a comparator circuit. However, such a conventional technology configuration requires the provision of multiple comparators, such as a first comparator circuit that compares the backup power supply voltage with a threshold voltage for detecting full charging, a second comparator circuit that compares the backup power supply voltage with a threshold voltage for detecting recharging, and a third comparator circuit that compares the backup power supply voltage with a threshold voltage for detecting a voltage drop, resulting in a problem of increased circuit size.
[0018] In addition, there are various types of backup elements 12, such as lithium ion batteries, metallic lithium batteries, nickel-cadmium batteries, sodium ion batteries, all-solid batteries, or semi-solid batteries, and the threshold voltages used for full charge detection, recharge detection, and the like vary depending on the backup element 12. For example, the threshold voltage for full charge detection of a lithium ion battery is about 3 V, whereas the threshold voltage for a supercapacitor is often about 2.7 V. For this reason, it is difficult to accommodate such various types of backup elements 12 in a configuration in which a comparison circuit is used to compare the backup power supply voltage with a fixed reference voltage, as in the prior art of Patent Document 1 mentioned above.
[0019] In this embodiment, the threshold voltage data DVT is stored in the register section 40, and the stored threshold voltage data DVT and the backup voltage data DVBAT are compared by digital processing in the processing circuit 50 to control charging of the backup element 12. This eliminates the need to provide a large number of analog comparison circuits as in the conventional technology, and the circuit scale of the circuit device 20 can be significantly reduced compared to the conventional technology. In addition, in this embodiment, the threshold voltage data DVT corresponding to the backup element 12 is stored in the register section 40, and charging of the backup element 12 can be controlled by comparing the threshold voltage data DVT and the backup voltage data DVBAT. This makes it possible to realize flexible charging control corresponding to various types of backup elements 12.
[0020] Fig. 2 shows a detailed configuration example of the circuit device 20 of this embodiment. In Fig. 2, the circuit device 20 is provided with an interrupt generation circuit 70, an interface circuit 80, and a power supply voltage output terminal TVOUT in addition to the configuration of Fig. 1. Fig. 2 also shows detailed configuration examples of the voltage detection circuit 30, the register unit 40, and the power supply control circuit 60. Note that the circuit device 20 of this embodiment is not limited to the configuration of Fig. 2, and various modifications are possible, such as omitting some of these components, adding other components, or replacing some of the components with other components.
[0021] The power supply control circuit 60 includes a power supply switching circuit 62 and a switch control circuit 64. The power supply switching circuit 62 includes switches SW1, SW2, and SW3. Diodes D1, D2, and D3 are provided in parallel with the switches SW1, SW2, and SW3. The switches SW1, SW2, and SW3 are switches for switching the connection of the power supply. The diodes D1, D2, and D3 are diodes used for preventing reverse current, etc. The switch control circuit 64 outputs a control signal for controlling the on / off of the switches SW1, SW2, and SW3 based on the comparison result in the processing circuit 50. The power supply switching circuit 62 performs switching control of the connection of the power supply for charging control, etc. based on the control signal from the switch control circuit 64. Specifically, the on / off of the switches SW1, SW2, and SW3 is controlled based on the control signal from the switch control circuit 64, thereby performing switching control of the connection of the power supply for charging control, etc.
[0022] One end of the switch SW1 is connected to the main power supply terminal TVDD and the other end is connected to the power supply voltage output terminal TVOUT. The diode D1 has an anode connected to the main power supply terminal TVDD and a cathode connected to the power supply voltage output terminal TVOUT, and its forward direction is from the main power supply terminal TVDD to the power supply voltage output terminal TVOUT.
[0023] One end of the switch SW2 is connected to the power supply voltage output terminal TVOUT, and the other end is connected to the connection node of the diodes D2 and D3. The diode D2 has an anode connected to the connection node of the diodes D2 and D3, a cathode connected to the power supply voltage output terminal TVOUT, and a forward direction from the connection node to the power supply voltage output terminal TVOUT.
[0024] One end of switch SW3 is connected to the connection node between diodes D2 and D3, and the other end is connected to the backup power supply terminal TVBAT. Diode D3 has an anode connected to the connection node between diodes D2 and D3, a cathode connected to the backup power supply terminal TVBAT, and a forward direction from the connection node to the backup power supply terminal TVBAT.
[0025] The switches SW1, SW2, and SW3 can be configured, for example, by MOS transistors. The diodes D1, D2, and D3 can be configured, for example, by parasitic diodes of transistors. For example, the switches SW1, SW2, and SW3 can be configured by a first P-type transistor, a second P-type transistor, and a third P-type transistor. In this case, the diodes D1, D2, and D3 can be realized by a parasitic diode generated between one of the source or drain and the backgate of each of the first P-type transistor, the second P-type transistor, and the third P-type transistor.
[0026] The power supply voltage output terminal TVOUT outputs a power supply voltage VOUT. This power supply voltage VOUT is used, for example, as an internal power supply voltage of the circuit device 20. For example, the power supply voltage VOUT is input to a power supply circuit (not shown). Then, for example, a regulator in the power supply circuit regulates the power supply voltage VOUT to generate a power supply voltage, which is supplied as a power supply voltage for each circuit of the circuit device 20. In addition, for example, a voltage stabilization capacitor, which is an external component, is connected to the power supply voltage output terminal TVOUT. This makes it possible to stabilize the power supply voltage VOUT supplied to the internal circuits of the circuit device 20.
[0027] The register unit 40 stores the threshold voltage data DVFL for full charge detection as the threshold voltage data DVT in Fig. 1. For example, the register unit 40 has a register RG1, which stores the threshold voltage data DVFL for full charge detection. When the backup voltage data DVBAT exceeds the threshold voltage data DVFL for full charge detection, the power supply control circuit 60 performs control to stop charging of the backup element 12 by the main power supply voltage VDD. Note that the backup voltage data DVBAT exceeding the threshold voltage data DVFL for full charge detection means, for example, that the voltage represented by the backup voltage data DVBAT exceeds the voltage represented by the threshold voltage data DVFL.
[0028] For example, when the backup element 12 is charged by the main power supply voltage VDD, the switches SW1, SW2, and SW3 of the power supply switching circuit 62 are turned on under the control of the switch control circuit 64. As a result, the main power supply terminal TVDD and the backup power supply terminal TVBAT are electrically connected via the turned-on switches SW1, SW2, and SW3, and the backup element 12 is charged by the main power supply voltage VDD. Then, when the backup power supply voltage VBAT rises due to the charging of the backup element 12 and the backup voltage data DVBAT detected by the voltage detection circuit 30 exceeds the threshold voltage data DVFL for full charge detection, the power supply control circuit 60 performs control to stop the charging of the backup element 12 by the main power supply voltage VDD. For example, the switches SW2 and SW3 of the power supply switching circuit 62 are turned off under the control of the switch control circuit 64. In this way, when it is detected that the backup voltage data DVBAT stored in the register unit 40 exceeds the threshold voltage data DVFL for full charge detection, it is determined that the charging voltage of the backup element 12 has reached the full charge voltage, and the charging of the backup element 12 can be stopped. This makes it possible to realize proper full charge control. Furthermore, since the register section 40 can store various values of the threshold voltage data DVFL, it becomes possible to handle various types of backup elements 12 with different full charge voltages.
[0029] 1, the register unit 40 stores the threshold voltage data DVRC for recharge detection. For example, the register unit 40 has a register RG2, which stores the threshold voltage data DVRC for recharge detection. When the backup voltage data DVBAT falls below the threshold voltage data DVRC for recharge detection, the power supply control circuit 60 performs control to start (resume) charging of the backup element 12 by the main power supply voltage VDD. Note that the backup voltage data DVBAT falling below the threshold voltage data DVRC for recharge detection means, for example, that the voltage represented by the backup voltage data DVBAT falls below the voltage represented by the threshold voltage data DVRC.
[0030] For example, when full charge is detected, the switches SW2 and SW3 of the power supply switching circuit 62 are turned off under the control of the switch control circuit 64. Then, for example, after full charge, when the backup power supply voltage VBAT drops due to the discharge of the backup element 12 and the backup voltage data DVBAT detected by the voltage detection circuit 30 falls below the threshold voltage data DVRC for recharge detection, the power supply control circuit 60 performs control to start charging the backup element 12 with the main power supply voltage VDD. For example, under the control of the switch control circuit 64, the switches SW2 and SW3 of the power supply switching circuit 62 are turned on. In this way, when it is detected that the backup voltage data DVBAT stored in the register unit 40 falls below the threshold voltage data DVRC for recharge detection, it is determined that the charging voltage of the backup element 12 has reached the recharge voltage, and charging of the backup element 12 can be started. This makes it possible to realize appropriate recharge control. And, since the register unit 40 can store various values of threshold voltage data DVRC, it becomes possible to handle various types of backup elements 12 with different appropriate recharge voltages.
[0031] The register unit 40 also stores threshold voltage data DVEM for detecting a voltage drop in the backup power supply voltage VBAT as the threshold voltage data DVT in FIG. 1. For example, the register unit 40 has a register RG3, which stores the threshold voltage data DVEM for detecting a voltage drop in the backup power supply voltage VBAT. In this manner, it is possible to detect a voltage drop in the backup power supply voltage VBAT using the threshold voltage data DVEM for detecting a voltage drop stored in the register unit 40. Then, it is possible to notify the detection result to, for example, a processing device outside the circuit device 20. For example, by detecting a voltage drop in the backup power supply voltage VBAT using the threshold voltage data DVEM, it is possible to detect, estimate, or notify the remaining charge of the backup element 12. For example, the processing circuit 50 compares the backup voltage data DVBAT from the voltage detection circuit 30 that detects the backup power supply voltage VBAT with the threshold voltage data DVEM for detecting a voltage drop. Then, for example, when the processing circuit 50 detects that the backup voltage data DVBAT falls below the threshold voltage data DVEM, the interrupt generation circuit 70 outputs an interrupt signal INT as described below to notify an external processing device. This enables the external processing device to detect a voltage drop in the backup power supply voltage VBAT. Also, when it is detected that the backup voltage data DVBAT falls below the threshold voltage data DVEM, flag information indicating that a voltage drop has been detected is set in the register of the register unit 40.
[0032] Moreover, the register unit 40 stores the backup voltage data DVBAT detected by the voltage detection circuit 30. For example, the register unit 40 has a register RG4, which stores the backup voltage data DVBAT. The backup voltage data DVBAT is output to the outside via, for example, an interface circuit 80. For example, an external processing device accesses the register unit 40 via the interface circuit 80 to read out the backup voltage data DVBAT detected by the voltage detection circuit 30. In this way, the backup voltage data DVBAT detected by the voltage detection circuit 30 can be output to the outside of the circuit device 20 or stored in the circuit device 20. This makes it possible to monitor the change in the backup power supply voltage VBAT and use it for various purposes.
[0033] 3 shows examples of the registers RG1, RG2, RG3, and RG4 of the register unit 40 in FIG. 2. In FIG. 3, the registers RG1, RG2, RG3, and RG4 are, for example, 8-bit registers. For example, the register RG1 stores 8-bit threshold voltage data DVFL for detecting full charge, and the register RG2 stores 8-bit threshold voltage data DVRC for detecting recharge. The register RG3 stores 8-bit threshold voltage data DVEM for detecting a voltage drop. Note that the register RG4 for storing the backup voltage is an 8-bit register in FIG. 3, but may be a register with a bit number greater than 8 bits, such as 16 bits.
[0034] Thus, in this embodiment, threshold voltage data DVT such as threshold voltage data DVFL, DVRC, and DVEM for full charge detection, recharge detection, and voltage drop detection are multi-bit data. By doing so, various values of threshold voltage data DVT that can be represented by these multi-bits can be stored in the register unit 40 and compared with the backup voltage data DVBAT from the voltage detection circuit 30. For example, it becomes possible to store threshold voltage data DVT with a resolution (e.g., a resolution of about 60 mV) set by the number of bits of these multi-bits in the register unit 40, and the processing circuit 50 can compare the backup voltage data DVBAT and the threshold voltage data DVT with this resolution. Note that FIG. 3 shows an example when the number of bits of the data is 8 bits, but this embodiment is not limited to this, and the number of bits may be less than 8 bits, more than 8 bits, or may be 4 bits, 16 bits, etc., for example.
[0035] Also, as shown in FIGS. 2 and 4, the voltage detection circuit 30 includes a voltage sensor 32. The voltage sensor 32 is a circuit in which an analog backup power supply voltage VBAT is input as a voltage to be detected and outputs backup voltage data DVBAT as digital voltage data. A detailed configuration example of the voltage sensor 32 will be described later.
[0036] Also, as shown in FIGS. 2 and 4, the voltage detection circuit 30 includes a comparison circuit 34. The comparison circuit 34 compares the main power supply voltage VDD with a threshold voltage VDT for detecting a voltage drop in the main power supply voltage VDD. The comparison circuit 34 is also called a comparator. For example, in the comparison circuit 34, the main power supply voltage VDD is input to the first input terminal (e.g., non-inverting input terminal), and the threshold voltage VDT for detecting a voltage drop in VDD is input to the second input terminal (e.g., inverting input terminal). Then, the comparison circuit 34 outputs a comparison result signal CPQ. For example, when VDD≥VDT, the comparison circuit 34 outputs a comparison result signal CPQ at the first voltage level (e.g., high level), and when VDD<VDT, the comparison circuit 34 outputs a comparison result signal CPQ at the second voltage level (e.g., low level).
[0037] When the main power supply voltage VDD drops below the threshold voltage VDT for voltage drop detection, the power supply control circuit 60 switches the power supply voltage VOUT supplied to the internal circuit of the circuit device 20 from the main power supply voltage VDD to the backup power supply voltage VBAT. For example, when VDD < VDT, the comparison circuit 34 outputs the comparison result signal CPQ of the above-described second voltage level. Then, upon receiving this comparison result signal CPQ, the processing circuit 50 gives an instruction to the power supply control circuit 60 to switch the power supply voltage VOUT supplied to the internal circuit from the main power supply voltage VDD to the backup power supply voltage VBAT. As a result, taking FIG. 2 as an example, the switch control circuit 64, based on the instruction from the processing circuit 50, turns off the switch SW1 of the power supply switching circuit 62 and turns on the switches SW2 and SW3. As a result, the backup power supply terminal TVBAT and the power supply voltage output terminal TVOUT are electrically connected via the switches SW2 and SW3, and the power supply voltage VOUT supplied to the internal circuit is switched from the main power supply voltage VDD to the backup power supply voltage VBAT. In this way, when the main power supply voltage VDD drops and falls below the threshold voltage VDT for voltage drop detection, instead of the main power supply voltage VDD, the backup power supply voltage VBAT whose voltage is held by the backup element 12 is supplied to the internal circuit of the circuit device 20. Therefore, for example, even when the main power supply voltage VDD drops due to non-supply of power, etc., the internal circuit of the circuit device 20 can be operated by the backup power supply voltage VBAT from the backup element 12. For example, the threshold voltage VDT is a voltage at which the internal circuit of the circuit device 20 can operate, and as an example, it is a voltage of about 1.4 to 1.5 V. Therefore, when the main power supply voltage VDD drops below the threshold voltage VDT, if the backup power supply voltage VBAT is supplied to the internal circuit of the circuit device 20 instead of the main power supply voltage VDD, the internal circuit can be properly operated. Note that it is desirable for the comparison circuit 34 to have a hysteresis characteristic with respect to the threshold voltage VDT, and it is desirable to set the threshold voltage when the main power supply voltage VDD is rising to a higher voltage than the threshold voltage when the main power supply voltage VDD is dropping. By doing so, it is possible to prevent a situation where the operation becomes unstable when the main power supply voltage VDD is at a voltage near the threshold voltage.
[0038] 2, the circuit device 20 includes an interface circuit 80 for accessing the register unit 40. The interface circuit 80 is a circuit for communicating with an external processing device. In this way, the processing device external to the circuit device 20 can access the register unit 40 via the interface circuit 80 to write data to the register unit 40 or read data from the register unit 40.
[0039] For example, the interface circuit 80 performs communication based on a given communication standard with an external processing device. For example, the interface circuit 80 performs serial communication such as I2C (Inter-Integrated Circuit) or SPI (Serial Peripheral Interface). For example, the interface circuit 80 performs serial communication based on data DA transferred via a data terminal TDA and a clock signal CK input via a clock terminal TCK. The SPI may be a three-wire SPI or a four-wire SPI. In the case of a three-wire SPI, the data terminal TDA serves as an input / output terminal for the data DA. In the case of a four-wire SPI, an input data terminal and an output data terminal may be provided as the data terminal TDA. The interface circuit 80 may also be capable of switching between serial communication methods such as I2C, three-wire SPI, and four-wire SPI. In this case, a switching terminal for switching the serial communication method may be provided in the circuit device 20.
[0040] The threshold voltage data DVT stored in the register section 40 is set in the register section 40 via the interface circuit 80. For example, an external processing device writes the threshold voltage data DVT (DVFL, DVRC, DVEM) to be compared with the backup voltage data DVBAT to the register section 40 via the interface circuit 80. In this manner, it becomes possible to write various values of the threshold voltage data DVT to the register section 40 via the interface circuit 80. For example, it becomes possible to write the threshold voltage VDT of a value appropriate for these detections as the threshold voltage data DVFL for detecting full charge, the threshold voltage data DVRC for detecting recharge, or the threshold voltage data DVEM for detecting a voltage drop to the register section 40. This makes it possible to write appropriate threshold voltage data DVT according to the type of the backup element 12 to the register section 40, and realize charging control of the power supply control circuit 60 based on the comparison result between the written threshold voltage data DVT and the backup voltage data DVBAT from the voltage detection circuit 30.
[0041] The register unit 40 also stores the backup voltage data DVBAT detected by the voltage detection circuit 30. For example, in FIG. 2, the register RG4 of the register unit 40 stores the backup voltage data DVBAT. The interface circuit 80 then outputs the backup voltage data DVBAT stored in the register unit 40. For example, when an external processing device accesses the register unit 40 and performs a read operation of the backup voltage data DVBAT, the backup voltage data DVBAT stored in the register unit 40 is output to the outside via the interface circuit 80. In this way, the backup voltage data DVBAT detected by the voltage detection circuit 30 can be output to the outside via the interface circuit 80. This allows the external processing device to monitor the backup power supply voltage VBAT based on the backup voltage data DVBAT output via the interface circuit 80 and perform various controls and settings.
[0042] For example, in the conventional technology of Patent Document 1 mentioned above, the backup power supply voltage is simply compared with a fixed reference voltage by a comparison circuit, and the voltage value of the backup power supply voltage cannot be monitored. In contrast, in this embodiment, the backup voltage data DVBAT detected by the voltage detection circuit 30 is stored in the register unit 40, and the backup voltage data DVBAT can be output to the outside via the interface circuit 80. Therefore, an external processing device can monitor the backup voltage data DVBAT and perform various controls and settings.
[0043] As shown in FIG. 2, the circuit device 20 includes an interrupt generation circuit 70. The interrupt generation circuit 70 generates an interrupt signal INT based on a comparison result between the backup voltage data DVBAT and the threshold voltage data DVT (DVFL, DVRC, DVEM). The interrupt signal INT is output to the outside via an interrupt output terminal TINT provided in the circuit device 20. For example, the interrupt signal INT is a signal that becomes a predetermined voltage level (for example, a low level) when an interrupt occurs. As an example, a circuit that outputs the interrupt signal INT at the interrupt output terminal TINT can be realized by an open-drain N-type transistor or the like. In this way, when a predetermined state is detected based on the comparison result between the backup voltage data DVBAT and the threshold voltage data DVT (for example, when a full charge, a recharge, or the like is detected), it becomes possible to notify the outside by the interrupt signal INT from the interrupt generation circuit 70 that the predetermined state has been detected.
[0044] For example, when the processing circuit 50 determines that the backup voltage data DVBAT exceeds the threshold voltage data DVFL for detecting full charge, the interrupt generating circuit 70 generates an interrupt signal INT based on a signal from the processing circuit 50. As will be described later, the register unit 40 stores flag information on full charge detection as an interrupt cause. Therefore, an external processing device can detect the occurrence of an interrupt based on the interrupt signal INT generated by the interrupt generating circuit 70 and detect full charge by reading the flag information on full charge detection from the register unit 40.
[0045] Furthermore, when the processing circuit 50 determines that the backup voltage data DVBAT falls below the threshold voltage data DVEM for voltage detection, the interrupt generation circuit 70 generates an interrupt signal INT based on a signal from the processing circuit 50. The register unit 40 stores flag information for voltage drop detection as an interrupt cause. Therefore, an external processing device can detect that an interrupt has occurred based on the interrupt signal INT generated by the interrupt generation circuit 70, and can detect that the backup power supply voltage VBAT has fallen below the threshold voltage for voltage drop detection by reading the flag information for voltage drop detection from the register unit 40.
[0046] FIG. 5 shows an example of the configuration of the real-time clock device 22 of this embodiment. The real-time clock device 22 includes a circuit device 20 and an oscillator 10. The circuit device 20 includes a voltage detection circuit 30, a register unit 40, a processing circuit 50, and a power supply control circuit 60, as well as an oscillation circuit 90 that oscillates an oscillator to generate a clock signal CK, and a clock circuit 92 that performs timekeeping processing based on the clock signal CK. The real-time clock device 22 is a device that generates time information by measuring time based on the clock signal CK, and is, for example, a real-time clock module. Note that the real-time clock device 22 of this embodiment is not limited to the configuration shown in FIG. 5, and various modifications are possible, such as omitting some of these components, adding other components, or replacing some of the components with other components. For example, the circuit device 20 of the real-time clock device 22 may be provided with an interface circuit 80 or an interrupt generation circuit 70 as described in FIG. 2. Alternatively, the circuit device 20 may be provided with an alarm circuit that issues an alarm based on the timekeeping result in the clock circuit 92, or a watchdog timer circuit that performs watchdog timer processing based on the timekeeping result.
[0047] The vibrator 10 is an element that generates mechanical vibration by an electrical signal. The vibrator 10 can be realized by a vibrating piece such as a quartz crystal vibrating piece. For example, the vibrator 10 can be realized by a quartz crystal vibrating piece that vibrates in a thickness shear manner such as an AT-cut or SC-cut cut angle, a tuning fork-type quartz crystal vibrating piece, or a double-tuning fork-type quartz crystal vibrating piece. The vibrator 10 of this embodiment can also be realized by various vibrating pieces such as a vibrating piece other than a thickness shear vibration type, a tuning fork-type, or a double-tuning fork-type, or a piezoelectric vibrating piece formed of a material other than quartz. For example, the vibrator 10 can be a SAW (Surface Acoustic Wave) resonator or a MEMS (Micro Electro Mechanical Systems) vibrator as a silicon vibrator formed using a silicon substrate.
[0048] The oscillator circuit 90 is a circuit that outputs a clock signal CK. For example, the oscillator circuit 90 generates an oscillation signal by the oscillation operation of the oscillator 10, and outputs a clock signal CK based on the oscillation signal. For example, the oscillator circuit 90 generates a sine wave oscillation signal by driving the oscillator 10, such as a quartz oscillator, to oscillate using a drive circuit, and outputs a square wave clock signal CK by shaping the generated oscillation signal using a waveform shaping circuit. The clock signal CK is, for example, a clock signal with a frequency of 32.768 KHz. Note that the frequency of the clock signal CK is not limited to this, and may be a frequency of 32 KHz or the like. The circuit device 20 may also have a clock output terminal that outputs the clock signal CK or a divided clock signal thereof.
[0049] The clock circuit 92 performs a time measurement process based on the clock signal CK to generate time information. For example, the clock circuit 92 includes a frequency division circuit and a clock counter (not shown). The frequency division circuit divides the frequency of the clock signal CK from the oscillation circuit 90 to output a frequency-divided clock signal. The clock counter performs a time measurement process based on the frequency-divided clock signal from the frequency division circuit. The clock circuit 92 generates time information indicating, for example, the current time through such a time measurement process of the clock counter. The time information, which is the time measurement data, can include data indicating seconds, minutes, hours, days, months, and years. For example, the clock counter has counters for counting seconds, minutes, hours, days, months, and years, and generates time information through the count process of these counters. The generated time information is output to the outside as time stamp information, for example, via the interface circuit 80 in FIG. 2. Through such a time measurement process in the clock circuit 92, the clock function and calendar function of the real-time clock device 22 are realized.
[0050] The real-time clock device 22 also has a main power supply terminal EVDD, a backup power supply terminal EVBAT, and a ground terminal EGND as power supply terminals for external connection. The main power supply terminal EVDD, the backup power supply terminal EVBAT, and the ground terminal EGND are electrically connected to the main power supply terminal TVDD, the backup power supply terminal TVBAT, and the ground terminal TGND of the circuit device 20, respectively. The real-time clock device 22 may also have a power supply voltage output terminal for external connection that is electrically connected to the power supply voltage output terminal TVOUT of the circuit device 20. For example, the real-time clock device 22 is configured by housing the circuit device 20, which is a semiconductor IC, and the vibrator 10 in a package. The main power supply terminal EVDD, the backup power supply terminal EVBAT, the ground terminal EGND, and the like for external connection are, for example, terminals provided in this package.
[0051] According to the real-time clock device 22 of this embodiment, the clock function and calendar function of the real-time clock can be realized by the timekeeping process of the timekeeping circuit 92 based on the clock signal CK from the oscillation circuit 90. In addition, in the real-time clock device 22 of this embodiment, the charging control of the backup element 12 by the main power supply voltage VDD can be realized by using the backup voltage data detected by the voltage detection circuit 30 and the threshold voltage data stored in the register unit 40. For example, in FA equipment, IOT devices, home appliances, in-vehicle equipment, etc., the real-time clock device 22 is used for obtaining and monitoring time information, as well as for controlling the charging of the backup element 12 such as a secondary battery or a supercapacitor. According to the real-time clock device 22 of this embodiment, both of these applications can be met. The charging control of the backup element 12 is performed based on the backup voltage data detected by the voltage detection circuit 30 and the threshold voltage data stored in the register unit 40, so there is an advantage in that flexible charging control corresponding to various types of backup elements 12 can be realized as described above.
[0052] 2. Detailed operation example Next, a detailed operation example of this embodiment will be described. FIG. 6 is a diagram for explaining the operation when the power is turned on. Immediately after the power is turned on, as shown in FIG. 6, the switches SW1 and SW3 of the power control circuit 60 are turned on and the switch SW2 is turned off. As a result, the main power terminal TVDD and the backup power terminal TVBAT are connected in parallel to the power supply voltage output terminal TVOUT via the diodes D1 and D2. As a result, the main power supply voltage VDD from the main power supply terminal TVDD is stepped down by the forward voltage of the diode D1 and supplied to the node of the power supply voltage VOUT via the path indicated by A1 in FIG. 6. Also, the backup power supply voltage VBAT from the backup power terminal TVBAT is stepped down by the forward voltage of the diode D2 and supplied to the node of the power supply voltage VOUT via the path indicated by A2. The main power supply voltage VDD is, for example, about 3.3V.
[0053] 7 is a diagram for explaining the operation of this embodiment when the backup element 12 is a primary battery. As shown in FIG. 7, in the normal mode operation, the switch SW1 of the power supply control circuit 60 is turned on, and the switches SW2 and SW3 are turned off. As a result, the main power supply voltage VDD from the main power supply terminal TVDD is supplied to the node of the power supply voltage VOUT via the path shown in B1 of FIG. 7. The internal circuit of the circuit device 20 operates with the power supply voltage VOUT based on the main power supply voltage VDD. During the normal mode operation, the comparison circuit 34 described in FIG. 4 constantly compares the main power supply voltage VDD with the threshold voltage VDT.
[0054] When the main power supply voltage VDD falls below the threshold voltage VDT, the mode transitions from normal mode to backup mode. During operation in the backup mode, the main power supply voltage VDD is compared with the threshold voltage VDT, for example, once every TA seconds. TA seconds is, for example, about 20 ms to 40 ms. When the main power supply voltage VDD becomes equal to or greater than the threshold voltage VDT, the mode transitions from backup mode to normal mode. The threshold voltage VDT for transitioning from backup mode to normal mode is set to a voltage higher than the threshold voltage VDT for transitioning from normal mode to backup mode. This can be achieved, for example, by using a comparator circuit 34 having a hysteresis function.
[0055] Fig. 8 is a diagram for explaining the operation of this embodiment when the backup element 12 is a secondary battery or a supercapacitor. As shown in Fig. 8, in normal mode operation, when the backup voltage data DVBAT detected by the voltage detection circuit 30 is below the threshold voltage data DVRC for recharge detection stored in the register unit 40, the switches SW1, SW2, and SW3 of the power supply control circuit 60 are all turned on. As a result, the backup element 12 is charged by the main power supply voltage VDD as shown in C1. Also, as shown in C2, the main power supply voltage VDD is supplied as the power supply voltage VOUT of the internal circuit of the circuit device 20.
[0056] When the backup voltage data DVBAT exceeds the threshold voltage data DVFL for detecting full charge stored in the register unit 40, the switches SW2 and SW3 of the power supply control circuit 60 are turned off. The switch SW1 remains on. This stops charging the backup element 12 with the main power supply voltage VDD. Also, as shown by C3, the main power supply voltage VDD is supplied as the power supply voltage VOUT of the internal circuit of the circuit device 20.
[0057] In either of the above states in normal mode (charging state, charging stopped state), if the main power supply voltage VDD falls below the threshold voltage VDT, the normal mode transitions to backup mode. In this case, the main power supply voltage VDD is constantly monitored. During backup mode operation, the main power supply voltage VDD is compared with the threshold voltage VDT, for example, once every TA seconds, and when the main power supply voltage VDD becomes equal to or greater than the threshold voltage VDT, the mode switches from backup mode to normal mode.
[0058] In this embodiment, as described in FIG. 2, the register unit 40 stores the backup voltage data DVBAT detected by the voltage detection circuit 30, and the interface circuit 80 outputs the backup voltage data DVBAT stored in the register unit 40. In this case, in this embodiment, for example, the register unit 40 stores the backup voltage data DVBAT at the timing instructed via the interface circuit 80. For example, in the first mode, the register unit 40 stores the backup voltage data DVBAT output from the voltage detection circuit 30 for each given period. As a result, the backup voltage data DVBAT stored in the register unit 40 is updated for each given period. On the other hand, in the second mode, the register unit 40 stores and holds the backup voltage data DVBAT at the timing instructed via the interface circuit 80. In this way, an external processing device can read out the backup voltage data DVBAT at the timing instructed via the interface circuit 80 from the register unit 40 via the interface circuit 80. This allows the external processing device to obtain the backup voltage data DVBAT at a timing desired by the external processing device, and to monitor the backup power supply voltage VBAT of the backup element 12, etc.
[0059] For example, the register unit 40 has registers RG5 and RG6 as shown in FIG. 9. Then, for example, when the SEC for latch control of the bit b0 of the register RG5 is set to 1, the latch mode, which is the second mode described above, is enabled, and when it is set to 0, it is disabled. Then, when an external processing device writes a command RDCMD to the register RG6, the backup voltage data DVBAT at the timing corresponding to the write timing is latched and held in the register of the register unit 40. For example, in FIG. 10, at timings t1, t2, t3, and t4, the voltage detection circuit 30 outputs the backup voltage data DVBAT, and this backup voltage data DVBAT is written in the register of the register unit 40. Then, in FIG. 9, when the SEC bit of the register RG5 is set to 1 and the external processing device writes a command RDCMD to the register RG6 via the interface circuit 80, for example, the backup voltage data DVBAT at the timing t2 immediately before that timing is latched and held in the register of the register unit 40. As a result, when the external processing device subsequently performs a read operation on this register via the interface circuit 80, the backup voltage data DVBAT at timing t2 in FIG. 10 is read out.
[0060] Fig. 11 is a diagram for explaining the operation of the interrupt generation circuit 70 of Fig. 2. The register unit 40 has registers RG7 and RG8 of Fig. 11. When IEE, bit b2 of register RG7, is set to 1, for example, an interrupt for detecting a voltage drop is permitted. When IEF, bit b1 of register RG7, is set to 1, for example, an interrupt for detecting a full charge is permitted. Note that VSE, bit 0 of register RG7, is a bit for enabling or disabling monitoring of the backup power supply voltage VBAT.
[0061] When the full-charge detection interrupt is permitted by IEF of register RG7, if it is detected that the backup voltage data DVBAT exceeds the threshold voltage data DVFL, the interrupt generation circuit 70 in Fig. 2 outputs an interrupt signal INT. Also, FUL of bit b1 of register RG8, which is the interrupt cause, is set to, for example, 1. Therefore, an external processing device that is notified of the occurrence of an interrupt by the interrupt signal INT can detect that a full charge has been detected by reading FUL of register RG8 via the interface circuit 80.
[0062] Furthermore, when a voltage drop detection interrupt is permitted by the IEE of the register RG7, if it is detected that the backup voltage data DVBAT falls below the threshold voltage data DVEM, the interrupt generation circuit 70 outputs an interrupt signal INT. Also, the EMP of bit b0 of the register RG8, which is the interrupt cause, is set to, for example, 1. Therefore, an external processing device that is notified of the occurrence of an interrupt by the interrupt signal INT can detect that a voltage drop in the backup power supply voltage VBAT has been detected by reading the EMP of the register RG8 via the interface circuit 80.
[0063] 3. Voltage Sensor Fig. 12 shows an example of the configuration of the voltage sensor 32 described in Fig. 2 and Fig. 3. The backup power supply voltage VBAT is input to the voltage sensor 32 as the detection target voltage VSEN, and the voltage sensor 32 outputs the backup voltage data DVBAT as the voltage data DV. As shown in Fig. 12, the voltage sensor 32 includes a current supply circuit 110, an oscillation circuit 120, a counter circuit 130, and an arithmetic circuit 140.
[0064] The current supply circuit 110 supplies a current that changes according to the detection target voltage VSEN (VBAT) as a supply current IB to the voltage detection oscillator circuit 120. For example, the supply current IB is a current whose value increases as the voltage value of the detection target voltage VSEN increases.
[0065] The oscillator circuit 120 is an oscillator circuit for voltage detection whose oscillation frequency changes according to the supply current IB. For example, the oscillation frequency of the oscillator circuit 120 increases as the current value of the supply current IB increases. The oscillator circuit 120 can be realized by a ring oscillator in which an odd number of signal inversion circuits are connected in a ring (loop). The signal inversion circuit can be realized by an inverter circuit or a NAND circuit. In each of the signal inversion circuits, the supply current IB flowing from the high potential power supply to the low potential power supply is controlled, thereby controlling the oscillation frequency of the oscillator circuit 120. For example, the larger the current value of the supply current IB flows, the higher the oscillation frequency becomes.
[0066] The counter circuit 130 performs a counting process for counting the output clock signal RCK of the voltage detection oscillator circuit 120 during a given period. For example, the counter circuit 130 counts the number of pulses (number of clocks) of the output clock signal RCK during a given period, and outputs a count value CT.
[0067] The arithmetic circuit 140 calculates voltage data DV (DVBAT) corresponding to the detection target voltage VSEN based on the count value CT obtained by the count process in a state in which the supply current IB is supplied to the oscillation circuit 120 for voltage detection.
[0068] FIG. 13 is a signal waveform diagram for explaining the operation of the voltage sensor 32. The clock signal CK in FIG. 13 is an oscillation clock signal generated by the oscillation circuit 90 oscillating the oscillator 10 in FIG. 5. As shown in FIG. 13, the above-mentioned given period TSENS used in the counter circuit 130 is a period defined by the clock signal CK of the oscillation circuit 90. For example, the period TSENS is a period of length corresponding to a predetermined number of pulses of the clock signal CK. For example, the period TSENS is set by performing a count process of the number of pulses of the clock signal CK of the oscillation circuit 90. Then, the counter circuit 130 outputs a count value CT obtained by counting the number of pulses of the output clock signal RCK during the period TSENS. For example, since the clock signal CK is a clock signal generated by oscillating the oscillator 10 by the oscillation circuit 90, the period TSENS set based on this clock signal CK is a period with high accuracy of its length. In particular, when a quartz oscillator is used as the oscillator 10, the period TSENS is a period with even higher accuracy. And since voltage sensor 32 in FIG. 12 calculates voltage data DV based on count value CT of the number of pulses of output clock signal RCK in this highly accurate period TSENS, there is an advantage in that it can output voltage data DV with higher accuracy.
[0069] According to the voltage sensor 32 described above, the supply current IB that changes according to the voltage VSEN to be detected is supplied to the oscillator circuit 120, the output clock signal RCK from the oscillator circuit 120, whose oscillation frequency changes according to the supply current IB, is counted in a given period TSENS, and arithmetic processing is performed based on the obtained count value CT, thereby making it possible to calculate the voltage data DV corresponding to the voltage VSEN to be detected. This makes it possible to adjust the detection accuracy of the voltage VSEN to be detected, for example, by setting the length of the given period TSENS in which the counting processing is performed or by changing the algorithm of the arithmetic processing in the arithmetic circuit 140. It also becomes possible to prevent the detection accuracy from being restricted by the performance of the analog circuit.
[0070] The current supply circuit 110 in FIG. 12 can be configured by, for example, a resistor and a diode-connected transistor connected in series between the supply node of the detection target voltage VSEN and the node of the low potential side power supply (for example, GND), and a current mirror circuit that mirrors the current flowing through this transistor to supply the supply current IB. The diode-connected transistor is, for example, an N-type transistor with its drain and gate connected. If the gate-source voltage of this diode-connected transistor is Vth+Vod, the voltage at the connection node between the resistor and the transistor is Vth+Vod. Here, Vth is the threshold voltage of the diode-connected transistor. Therefore, a voltage of VSEN-(Vth+Vod) is applied to both ends of the resistor, and a current of IB={VSEN-(Vth+Vod)} / R1 flows through the resistor with a resistance value of R1. Therefore, the oscillator circuit 120 is supplied with a current IB={VSEN-(Vth+Vod)} / R1 that changes according to the detection target voltage VSEN. It should be noted that the voltage sensor 32 is not limited to the configuration shown in FIG. 12, and may be, for example, a circuit that performs A / D conversion on the voltage to be detected to generate voltage data.
[0071] As described above, the circuit device of this embodiment includes a main power supply terminal to which a main power supply voltage is supplied, a backup power supply terminal to which a backup power supply voltage from a backup element is supplied, and a voltage detection circuit that detects the backup power supply voltage and outputs backup voltage data corresponding to the backup power supply voltage. The circuit device also includes a register unit that stores threshold voltage data to be compared with the backup voltage data, a processing circuit that compares the backup voltage data with the threshold voltage data, and a power supply control circuit that controls charging of the backup element with the main power supply voltage based on the comparison result in the processing circuit.
[0072] According to this embodiment, charging of the backup element can be controlled based on the comparison result between the threshold voltage data stored in the register unit and the backup voltage data from the voltage detection circuit that detects the backup power supply voltage. This allows the threshold value for charging control to be set flexibly, and enables flexible charging control of the backup element to be realized.
[0073] In the present embodiment, the register unit may store threshold voltage data for detecting full charge as the threshold voltage data, and the power supply control circuit may perform control to stop charging of the backup element by the main power supply voltage when the backup voltage data exceeds the threshold voltage data for detecting full charge.
[0074] In this way, when it is detected that the backup voltage data stored in the register section exceeds the threshold voltage data for detecting full charge, it is possible to determine that the charging voltage of the backup element has reached the full charge voltage, and to stop charging of the backup element.
[0075] In addition, in this embodiment, the register unit may store threshold voltage data for recharge detection as the threshold voltage data, and the power supply control circuit may perform control to start charging of the backup element with the main power supply voltage when the backup voltage data falls below the threshold voltage data for recharge detection.
[0076] In this way, when it is detected that the backup voltage data stored in the register section has fallen below the threshold voltage data for detecting recharging, it is possible to determine that the charging voltage of the backup element has reached the recharging voltage, and to start charging the backup element.
[0077] In this embodiment, the register unit may store, as the threshold voltage data, threshold voltage data for detecting a voltage drop in the backup power supply voltage.
[0078] In this way, it becomes possible to detect a voltage drop in the backup power supply voltage by using the threshold voltage data for detecting a voltage drop stored in the register section.
[0079] In this embodiment, the threshold voltage data may be multi-bit data.
[0080] In this way, threshold voltage data of various values that can be expressed by multiple bits can be stored in the register section and compared with the backup voltage data from the voltage detection circuit.
[0081] In addition, in this embodiment, the voltage detection circuit includes a comparison circuit that compares the main power supply voltage with a threshold voltage for detecting a voltage drop in the main power supply voltage, and the power supply control circuit may switch the power supply voltage supplied to the internal circuit of the circuit device from the main power supply voltage to the backup power supply voltage when the main power supply voltage falls below the threshold voltage for detecting a voltage drop.
[0082] In this way, when the main power supply voltage drops below the threshold voltage for detecting a voltage drop, the backup power supply voltage from the backup element is supplied to the internal circuitry of the circuit device in place of the main power supply voltage.
[0083] In this embodiment, an interface circuit for accessing the register unit may also be included.
[0084] In this way, a processing device or the like external to the circuit device can access the register section via the interface circuit to write data to the register section or read data from the register section.
[0085] In this embodiment, the threshold voltage data may be set in the register section via the interface circuit.
[0086] In this way, threshold voltage data of various values can be written to the register section via the interface circuit.
[0087] In this embodiment, the register section may store backup voltage data detected by the voltage detection circuit, and the interface circuit may output the backup voltage data stored in the register section.
[0088] In this way, the backup voltage data detected by the voltage detection circuit can be output to the outside via the interface circuit.
[0089] In this embodiment, the register unit may store backup voltage data at the timing instructed via the interface circuit.
[0090] In this way, the external processing device can read out the backup voltage data from the register section via the interface circuit at the timing specified via the interface circuit.
[0091] In addition, this embodiment may include an interrupt generating circuit that generates an interrupt signal based on the result of comparing the backup voltage data with the threshold voltage data.
[0092] In this manner, when a predetermined state is detected as a result of comparing the backup voltage data with the threshold voltage data, the detection of the predetermined state can be communicated to the outside by an interrupt signal from the interrupt generating circuit.
[0093] In this embodiment, the voltage detection circuit may include a voltage sensor that receives the backup power supply voltage as a detection target voltage and outputs backup voltage data as voltage data. The voltage sensor may include an oscillation circuit for voltage detection whose oscillation frequency changes according to a supply current, and a current supply circuit that supplies a current that changes according to the detection target voltage as a supply current to the oscillation circuit for voltage detection. The voltage sensor may include a counter circuit that performs a count process that counts the output clock signal of the oscillation circuit for voltage detection in a given period, and an arithmetic circuit that calculates voltage data corresponding to the detection target voltage based on a count value obtained by the count process in a state in which a supply current is supplied to the oscillation circuit for voltage detection.
[0094] With a voltage sensor configured in this manner, it becomes possible to adjust the detection accuracy of the voltage to be detected, for example, by setting the length of a given period during which counting processing is performed or by changing the algorithm of the calculation processing in the calculation circuit.
[0095] In addition, the real-time clock device of this embodiment includes the circuit device described above and an oscillator, and the circuit device includes an oscillation circuit that oscillates the oscillator to generate a clock signal, and a timing circuit that performs timekeeping processing based on the clock signal.
[0096] A real-time clock device configured in this way can realize the timekeeping function and calendar function of the real-time clock by the timekeeping process based on the clock signal from the oscillator circuit. In addition, it can also realize charging control of the backup element by the main power supply voltage using the backup voltage data detected by the voltage detection circuit and the threshold voltage data stored in the register unit.
[0097] Although the present embodiment has been described in detail as above, it will be easily understood by those skilled in the art that many modifications are possible without substantially departing from the novel matters and effects of the present disclosure. Therefore, all such modifications are intended to be included in the scope of the present disclosure. For example, a term described at least once in the specification or drawings together with a different term having a broader meaning or the same meaning may be replaced with that different term anywhere in the specification or drawings. In addition, all combinations of the present embodiment and modifications are also included in the scope of the present disclosure. In addition, the configurations and operations of the circuit device and the real-time clock device are not limited to those described in the present embodiment, and various modifications are possible. [Explanation of symbols]
[0098] 10...oscillator, 12...backup element, 20...circuit device, 22...real-time clock device, 30...voltage detection circuit, 32...voltage sensor, 34...comparison circuit, 40...register section, 50...processing circuit, 60...power supply control circuit, 62...power supply switching circuit, 64...switch control circuit, 70...interrupt generation circuit, 80...interface circuit, 90...oscillating circuit, 92...timekeeping circuit, 110...current supply circuit, 120...oscillating circuit, 130...counter circuit, 140...arithmetic circuit, D1, D2, D3...diodes, DVBAT...backup voltage data, DVEM, DVFL, DVRC, DVT...threshold voltage data, INT...interrupt signal, RG, RG1~RG8...registers, SW1~SW3...switches, TCK...clock terminal, TDA...data terminal, TGND...ground terminal, TINT...interrupt output terminal, TVBAT...backup power terminal, TVDD...main power terminal, TVOUT...power supply voltage output terminal, VBAT...backup power supply voltage, VDD...main power supply voltage, VDT...threshold voltage, VOUT...power supply voltage
Claims
1. a mains terminal to which a mains voltage is supplied; a backup power supply terminal to which a backup power supply voltage is supplied from a backup element; a voltage detection circuit that detects the backup power supply voltage and outputs backup voltage data corresponding to the backup power supply voltage; a register unit for storing threshold voltage data to be compared with the backup voltage data; a processing circuit for comparing the backup voltage data with the threshold voltage data; a power supply control circuit that controls charging of the backup element by the main power supply voltage based on a comparison result in the processing circuit; A circuit device comprising:
2. 2. The circuit device according to claim 1, The register unit includes: As the threshold voltage data, threshold voltage data for detecting full charge is stored; The power supply control circuit includes: When the backup voltage data exceeds the threshold voltage data for detecting a full charge, the circuit device performs control to stop charging of the backup element by the main power supply voltage.
3. 2. The circuit device according to claim 1, The register unit includes: As the threshold voltage data, threshold voltage data for detecting recharging is stored; The power supply control circuit includes: A circuit device comprising: a control circuit for starting charging of the backup element by the main power supply voltage when the backup voltage data falls below the threshold voltage data for detecting recharging.
4. 2. The circuit device according to claim 1, The register unit includes: The circuit device according to claim 1, wherein the threshold voltage data is threshold voltage data for detecting a voltage drop of the backup power supply voltage.
5. 2. The circuit device according to claim 1, The circuit device according to claim 1, wherein the threshold voltage data is multi-bit data.
6. 2. The circuit device according to claim 1, The voltage detection circuit includes: a comparison circuit that compares the main power supply voltage with a threshold voltage for detecting a voltage drop of the main power supply voltage; The power supply control circuit includes: A circuit device, characterized in that, when the main power supply voltage falls below the threshold voltage for detecting a voltage drop, a power supply voltage supplied to an internal circuit of the circuit device is switched from the main power supply voltage to the backup power supply voltage.
7. 2. The circuit device according to claim 1, A circuit device comprising an interface circuit for accessing the register section.
8. 8. The circuit device according to claim 7, The circuit device, wherein the threshold voltage data is set in the register section via the interface circuit.
9. 8. The circuit device according to claim 7, The register unit includes: storing the backup voltage data detected by the voltage detection circuit; The interface circuit includes: A circuit device which outputs the backup voltage data stored in the register section.
10. 10. The circuit device according to claim 9, The register unit includes: A circuit device comprising: a circuit unit that stores the backup voltage data at a timing instructed via the interface circuit.
11. 2. The circuit device according to claim 1, a circuit device comprising: an interrupt generating circuit that generates an interrupt signal based on a result of the comparison between the backup voltage data and the threshold voltage data;
12. 2. The circuit device according to claim 1, The voltage detection circuit includes: a voltage sensor that receives the backup power supply voltage as a detection target voltage and outputs the backup voltage data as voltage data; The voltage sensor is an oscillator circuit for detecting a voltage, the oscillation frequency of which changes in response to a supply current; a current supply circuit that supplies a current that varies depending on the voltage to be detected as the supply current to the voltage detection oscillator circuit; a counter circuit that performs a counting process of counting the output clock signal of the voltage detection oscillator circuit for a given period; a calculation circuit that calculates the voltage data corresponding to the detection target voltage based on a count value obtained by the count process in a state in which the supply current is supplied to the voltage detection oscillation circuit; A circuit device comprising:
13. A circuit arrangement according to any one of claims 1 to 12; A vibrator; Including, The circuit device comprises: an oscillator circuit that oscillates the oscillator to generate a clock signal; a timing circuit that performs timing processing based on the clock signal; A real-time clock device comprising:
Citation Information
Patent Citations
Power-supply switching circuit, real-time clock device, electronic apparatus, movable body, and method of controlling power-supply switching circuit
JP2014017965A