Circuit device and real-time clock device
By designing a circuit device including voltage detection and processing circuits, the problem of difficulty in realizing flexible charging control of various spare components in the prior art is solved, and more flexible and efficient charging control is achieved.
Patent Information
- Application Number
- CN202411341088.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-27
- Filing Date
- 2024-09-25
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art is difficult to achieve flexible charging control for various spare components, especially when voltage detection depends on a fixed reference voltage.
A circuit device is designed, including a main power supply terminal, a backup power supply terminal, a voltage detection circuit, a register unit, a processing circuit and a power control circuit. Charging control of the backup component is achieved by detecting the backup power supply voltage and comparing it with the stored threshold voltage data.
Flexible charging control for various types of spare components is achieved, reducing circuit scale and improving the flexibility and adaptability of charging control.
Smart Images

Figure CN119727068A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a circuit device and a real-time clock device, etc. Background Art
[0002] Patent Document 1 discloses a real-time clock device that detects voltage while intermittently turning on a switch between a main power supply terminal and a backup power supply terminal to switch between the main power supply and the backup power supply. A backup element supplied with the backup power supply voltage is charged by the main power supply according to the result of the voltage detection.
[0003] Prior art literature
[0004] Patent Literature
[0005] Patent Document 1: Japanese Patent Application Publication No. 2014-017965 Summary of the invention
[0006] Problems to be solved by the invention
[0007] In the prior art of Patent Document 1, voltage detection is performed by comparing the backup power supply voltage with a fixed reference voltage using a comparison circuit, so that it is difficult to achieve flexible charging control for various backup elements.
[0008] Means for solving problems
[0009] One embodiment of the present disclosure relates to a circuit device, which includes: a main power supply terminal, which is supplied with a main power supply voltage; a backup power supply terminal, which is supplied with a backup power supply voltage from a backup element; a voltage detection circuit, which detects the backup power supply voltage and outputs backup voltage data corresponding to the backup power supply voltage; a register unit, which stores threshold voltage data for comparison with the backup voltage data; a processing circuit, which compares the backup voltage data with the threshold voltage data; and a power supply control circuit, which controls the charging of the backup element by the main power supply voltage based on the comparison result of the processing circuit.
[0010] In addition, another embodiment of the present disclosure relates to a real-time clock device, which includes: the circuit device and oscillator described above, wherein the circuit device includes: an oscillation circuit that oscillates the oscillator to generate a clock signal; and a timing circuit that performs timing processing based on the clock signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 This is a configuration example of a circuit device according to this embodiment.
[0012] Figure 2 This is a detailed configuration example of the circuit device according to the present embodiment.
[0013] Figure 3 It is an example of a register in the register section.
[0014] Figure 4 This is a configuration example of a voltage detection circuit.
[0015] Figure 5 This is a structural example of a real-time clock device including a circuit device.
[0016] Figure 6 This is a diagram illustrating the operation of the power control circuit when the power is turned on.
[0017] Figure 7 It is an explanatory diagram of a switching control example of a power supply control circuit.
[0018] Figure 8 It is an explanatory diagram of a switching control example of a power supply control circuit.
[0019] Fig. 9 This is a diagram for explaining latch control of backup voltage data.
[0020] Fig.10 This is a diagram for explaining latch control of backup voltage data.
[0021] Fig.11 is an example of a register used by the interrupt generation circuit.
[0022] Fig.12 This is an example of the structure of a voltage sensor.
[0023] Fig.13 It is a signal waveform diagram explaining the operation of the voltage sensor.
[0024] Description of symbols
[0025] 10: oscillator; 12: spare element; 20: circuit device; 22: real-time clock device; 30: voltage detection circuit; 32: voltage sensor; 34: comparison circuit; 40: register unit; 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: oscillation circuit; 92: timing circuit; 110: current supply circuit; 120: oscillation circuit; 130: counter circuit; 140: operation circuit; D1, D2, D3: diodes; D VBAT: 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. DETAILED DESCRIPTION
[0026] Hereinafter, the present embodiment will be described. In addition, the present embodiment described below does not unduly limit the contents described in the claims. In addition, not all the structures described in the present embodiment are necessarily essential structural elements.
[0027] 1. Circuit device, real-time clock device
[0028] exist Figure 1 2 shows a configuration example of the circuit device 20 of the present embodiment. The circuit device 20 includes a voltage detection circuit 30, a register unit 40, a processing circuit 50, a power control circuit 60, a main power terminal TVDD, and a backup power terminal TVBAT. In addition, the circuit device 20 may include a ground terminal TGND. As an example, the circuit device 20 is an IC manufactured by a semiconductor process, which is a semiconductor chip having circuit elements formed on a semiconductor substrate. In addition, the circuit device 20 can also be said to be a semiconductor device having a semiconductor chip mounted in a package. In addition, the circuit device 20 of the present embodiment is not limited to Figure 1 The structure of the present invention can be implemented in various deformations such as omitting some of its structural elements, adding other structural elements, or replacing some structural elements with other structural elements. In addition, the connection in this embodiment is an electrical connection. The electrical connection is connected in a manner that can transmit electrical signals, and is a connection that can transmit information based on electrical signals. The electrical connection can also be a connection via passive components, etc.
[0029] The main power supply terminal TVDD is a terminal to which the main power supply voltage VDD is supplied. The main power supply voltage VDD is, for example, a power supply voltage on the high potential side, and is supplied by an external power supply device or the like. The backup power supply terminal TVBAT is a terminal to which the backup power supply voltage VBAT from the backup element 12 is supplied. The backup power supply voltage VBAT is, for example, a power supply voltage based on the power storage of the backup element 12. The ground terminal TGND is a terminal to which GND as a ground voltage is supplied. GND can also be referred to as VSS, and the ground voltage is, for example, a ground potential. Each terminal of 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 as an insulating layer, and the exposed metal layer constitutes a pad as a terminal of the circuit device 20.
[0030] The backup element 12 is an element for maintaining the backup power supply voltage VBAT. As the backup element 12, for example, there are secondary batteries or super capacitors. In addition, as the backup element 12, a primary battery can also be used. As secondary batteries, for example, there are lithium-ion batteries, metal lithium batteries, nickel-cadmium batteries, sodium-ion batteries, lead-acid batteries, all-solid-state batteries or semi-solid-state batteries. Supercapacitors are also called large-capacity capacitors. As supercapacitors, for example, there are electric double layer capacitors (EDLCs), pseudocapacitors or hybrid capacitors.
[0031] The voltage detection circuit 30 is a circuit for detecting voltage. Figure 1 In the embodiment, the voltage detection circuit 30 detects the backup power supply voltage VBAT. Then, the voltage detection circuit 30 outputs the backup voltage data DVBAT corresponding to the backup power supply voltage VBAT. The backup voltage data DVBAT is digital data representing the voltage value of the simulated backup power supply voltage VBAT. In addition, the voltage detection circuit 30 can also detect the main power supply voltage VDD.
[0032] The register unit 40 stores various information. The register unit 40 can also be said to be a storage circuit. The register unit 40 includes a plurality of registers. The register unit 40 can be implemented, for example, by a flip-flop circuit, a RAM or other memory. Figure 1 In the embodiment, the register unit 40 stores the threshold voltage data DVT to be compared with the backup voltage data DVBAT. For example, the threshold voltage data DVT is stored in the register RG included in the register unit 40. In addition, the register unit 40 can store a plurality of threshold voltage data DVT to be compared with various voltages. In this case, each of the plurality of registers included in the register unit 40 stores each of the threshold voltage data DVT. The threshold voltage data DVT is data indicating a threshold voltage to be compared with the backup power supply voltage VBAT represented by the backup voltage data DVBAT.
[0033] The processing circuit 50 is a circuit that performs various processing. The processing circuit 50 can be implemented, for example, by an ASIC (Application Specific Integrated Circuit) circuit based on an automatic configuration wiring such as a gate array, or by a processor such as a CPU of a microcomputer. Figure 1 In the processing circuit 50, the backup voltage data DVBAT is compared with the threshold voltage data DVT. Furthermore, the processing circuit 50 performs the following comparison processing: judging whether the backup voltage data DVBAT is higher than the threshold voltage data DVT, or whether the backup voltage data DVBAT is lower than the threshold voltage data DVT, etc. The comparison processing of the backup voltage data DVBAT and the threshold voltage data DVT is equivalent to comparing the backup power supply voltage VBAT represented by the backup voltage data DVBAT with the threshold voltage represented by the threshold voltage data DVT.
[0034] The power supply control circuit 60 is a circuit for performing 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. Figure 1 In the embodiment, 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 of the processing circuit 50. For example, the processing circuit 50 outputs the comparison result of the backup voltage data DVBAT and the threshold voltage data DVT. The comparison result is, for example, a comparison result of whether the backup voltage data DVBAT is higher than the threshold voltage data DVT, and whether the backup voltage data DVBAT is lower than the threshold voltage data DVT. Based on the comparison result, the power supply control circuit 60 controls the charging of the backup element 12 by the main power supply voltage VDD, etc. For example, based on the comparison result from the processing circuit 50, the power supply control circuit 60 performs the following control: the main power supply terminal TVDD is electrically connected to the backup power supply terminal TVBAT, and the backup element 12 is charged by the main power supply voltage VDD, or the main power supply terminal TVDD is not electrically connected to the backup power supply terminal TVBAT, and the charging of the backup element 12 by the main power supply voltage VDD is stopped.
[0035] 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 section 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 section 40 stores the threshold voltage data DVT. Moreover, 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 of the processing circuit 50. In this way, the charging of the backup element 12 can be controlled based on the comparison result of the threshold voltage data DVT stored in the register section 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 variable value threshold voltage data DVT stored in the register section 40 with the backup voltage data DVBAT. Thus, flexible charging control of the backup element 12 can be achieved. For example, various values of threshold voltage data DVT can be stored in the register unit 40 , so that the threshold value setting of the charge control can be flexibly performed. This makes it possible to cope with various backup elements 12 .
[0036] For example, the prior art of the above-mentioned Patent Document 1 is configured to compare the backup power supply voltage with a reference voltage of a fixed value by a comparison circuit. However, in such a prior art structure, it is necessary to provide a plurality of comparison circuits, such as a first comparison circuit for comparing the backup power supply voltage with a threshold voltage for full charge detection, a second comparison circuit for comparing the backup power supply voltage with a threshold voltage for recharge detection, and a third comparison circuit for comparing the backup power supply voltage with a threshold voltage for voltage drop detection, which results in a problem of increased circuit scale.
[0037] In addition, as the backup element 12, there are various types of elements such as lithium ion batteries, metal lithium batteries, nickel-cadmium batteries, sodium ion batteries, all-solid batteries, or semi-solid batteries, and the threshold voltages for full charge detection, recharge detection, etc. are different depending on the backup element 12. For example, the threshold voltage for full charge detection of lithium ion batteries is about 3 V, while the threshold voltage of supercapacitors is mostly about 2.7 V. Therefore, in the structure in which the backup power supply voltage is compared with a fixed reference voltage by a comparison circuit as in the prior art of the above-mentioned patent document 1, it is difficult to cope with such various types of backup elements 12.
[0038] In this regard, in the present embodiment, the threshold voltage data DVT is stored in the register section 40, and the stored threshold voltage data DVT is compared with the backup voltage data DVBAT through digital processing of the processing circuit 50 to perform charge control of the backup element 12. Therefore, it is not necessary to provide a plurality of analog comparison circuits as in the prior art, and thus the circuit scale of the circuit device 20 can be greatly reduced compared with the prior art. In addition, in the present embodiment, the threshold voltage data DVT corresponding to the value of the backup element 12 is stored in the register section 40, and the charge control of the backup element 12 can be performed by comparing the threshold voltage data DVT with the backup voltage data DVBAT. Therefore, flexible charge control corresponding to various types of backup elements 12 can be realized.
[0039] exist Figure 2 A detailed configuration example of the circuit device 20 of this embodiment is shown in FIG. Figure 2 In the circuit device 20, except Figure 1 In addition to the structure, an interruption generating circuit 70, an interface circuit 80, and a power supply voltage output terminal TVOUT are also provided. Figure 2 Detailed configuration examples of the voltage detection circuit 30, the register unit 40, and the power supply control circuit 60 are shown in FIG. Figure 2 The structure can be modified in various ways, such as omitting some of its structural elements, adding other structural elements, or replacing some of its structural elements with other structural elements.
[0040] 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. In addition, diodes D1, D2, and D3 are provided in parallel with switches SW1, SW2, and SW3. Switches SW1, SW2, and SW3 are switches for switching the connection of the power supply. Diodes D1, D2, and D3 are diodes for preventing backflow, etc. The switch control circuit 64 outputs a control signal for controlling the on / off of switches SW1, SW2, and SW3 based on the comparison result of the processing circuit 50. The power supply switching circuit 62 performs switching control of the power supply connection for charging control, etc. based on the control signal from the switch control circuit 64. Specifically, based on the control signal from the switch control circuit 64, the on / off of switches SW1, SW2, and SW3 is controlled, thereby performing switching control of the power supply connection for charging control, etc.
[0041] 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 is a diode whose anode is connected to the main power supply terminal TVDD, whose cathode is connected to the power supply voltage output terminal TVOUT, and whose forward direction is from the main power supply terminal TVDD toward the power supply voltage output terminal TVOUT.
[0042] 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 diode D2 and the diode D3. The diode D2 is a diode whose anode is connected to the connection node of the diode D2 and the diode D3, and whose cathode is connected to the power supply voltage output terminal TVOUT, with the direction from the connection node toward the power supply voltage output terminal TVOUT being the forward direction.
[0043] One end of the switch SW3 is connected to the connection node of the diode D2 and the diode D3, and the other end is connected to the backup power supply terminal TVBAT. The diode D3 is a diode whose anode is connected to the connection node of the diode D2 and the diode D3, and whose cathode is connected to the backup power supply terminal TVBAT, and whose forward direction is from the connection node toward the backup power supply terminal TVBAT.
[0044] The switches SW1, SW2, and SW3 can be formed, for example, by MOS transistors. The diodes D1, D2, and D3 can be formed, for example, by parasitic diodes of transistors. For example, the switches SW1, SW2, and SW3 can be formed by a first P-type transistor, a second P-type transistor, and a third P-type transistor. In this case, each of the diodes D1, D2, and D3 can be realized by a parasitic diode generated between the source or drain of each of the first transistor, the second transistor, and the third transistor and the back gate.
[0045] The power supply voltage output terminal TVOUT outputs the power supply voltage VOUT. The power supply voltage VOUT is used as, for example, 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. Moreover, the power supply voltage generated by regulating the power supply voltage VOUT by, for example, a regulator of the power supply circuit is supplied as a power supply voltage of each circuit of the circuit device 20. In addition, the power supply voltage output terminal TVOUT is connected to, for example, a capacitor for voltage stabilization as an external component. Thus, the power supply voltage VOUT supplied to the internal circuit of the circuit device 20 can be stabilized.
[0046] The register unit 40 stores the threshold voltage data DVFL for full charge detection as Figure 1For example, the register unit 40 includes a register RG1 storing the threshold voltage data DVFL for full charge detection. Furthermore, when the backup voltage data DVBAT is higher than the threshold voltage data DVFL for full charge detection, the power supply control circuit 60 performs the following control: the charging of the backup element 12 by the main power supply voltage VDD is stopped. In addition, the backup voltage data DVBAT being higher than the threshold voltage data DVFL for full charge detection means that, for example, the voltage represented by the backup voltage data DVBAT is higher than the voltage represented by the threshold voltage data DVFL.
[0047] 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 by 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. Furthermore, 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 is higher than the threshold voltage data DVFL for full charge detection, the power supply control circuit 60 performs the following 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 by 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 is higher than 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. As a result, appropriate full charge control can be achieved. Furthermore, since the threshold voltage data DVFL of various values can be stored in the register unit 40 , various types of backup cells 12 having different full charge voltages can be handled.
[0048] In addition, the register section 40 stores the threshold voltage data DVRC for recharge detection as Figure 1 For example, the register unit 40 includes a register RG2, which stores the recharge detection threshold voltage data DVRC. Furthermore, when the standby voltage data DVBAT is lower than the recharge detection threshold voltage data DVRC, the power supply control circuit 60 performs the following control: the charging of the standby element 12 by the main power supply voltage VDD is started (restarted). In addition, the standby voltage data DVBAT being lower than the recharge detection threshold voltage data DVRC means that, for example, the voltage represented by the standby voltage data DVBAT is lower than the voltage represented by the threshold voltage data DVRC.
[0049] For example, when full charge is detected, switches SW2 and SW3 of the power switching circuit 62 are turned off by the control of the switch control circuit 64. Moreover, after full charge, when the backup power supply voltage VBAT decreases due to the discharge of the backup element 12 and the backup voltage data DVBAT detected by the voltage detection circuit 30 is lower than the threshold voltage data DVRC for recharge detection, the power control circuit 60 performs the following control: the main power supply voltage VDD starts charging the backup element 12. For example, switches SW2 and SW3 of the power switching circuit 62 are turned on by 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 is lower than 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 the charging of the backup element 12 can be started. Thus, appropriate recharge control can be achieved. Moreover, the threshold voltage data DVRC of various values can be stored in the register unit 40, so that various types of backup elements 12 with different appropriate recharge voltages can be handled.
[0050] In addition, the register unit 40 stores the threshold voltage data DVEM for detecting a voltage drop of the backup power supply voltage VBAT as Figure 1 For example, the register unit 40 has a register RG3, which stores the threshold voltage data DVEM for detecting the voltage drop of the backup power supply voltage VBAT. In this way, the voltage drop of the backup power supply voltage VBAT can be detected using the threshold voltage data DVEM for detecting the voltage drop stored in the register unit 40. Moreover, the detection result can be notified to a processing device external to the circuit device 20, for example. For example, by using the threshold voltage data DVEM to detect the voltage drop of the backup power supply voltage VBAT, the charge remaining amount of the backup element 12 can be detected, estimated or notified. 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 the voltage drop. Then, for example, when the processing circuit 50 detects that the backup voltage data DVBAT is lower than the threshold voltage data DVEM, as described later, the interrupt generation circuit 70 outputs an interrupt signal INT to notify the external processing device. As a result, the external processing device can detect the voltage drop of the backup power supply voltage VBAT. Furthermore, when it is detected that the backup voltage data DVBAT is lower than the threshold voltage data DVEM, flag information indicating that a voltage drop is detected is set in the register of the register unit 40 .
[0051] In addition, the register section 40 stores the backup voltage data DVBAT detected by the voltage detection circuit 30. For example, the register section 40 has a register RG4, and the register RG4 stores the backup voltage data DVBAT. Moreover, 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 section 40 via the interface circuit 80, thereby reading 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, etc. Thus, the change of the backup power supply voltage VBAT can be monitored for various purposes.
[0052] exist Figure 3 Shown in Figure 2 An example of registers RG1, RG2, RG3, and RG4 of the register unit 40. Figure 3 In the embodiment, registers RG1, RG2, RG3, and RG4 are 8-bit registers. For example, register RG1 stores 8-bit threshold voltage data DVFL for full charge detection, and register RG2 stores 8-bit threshold voltage data DVRC for recharge detection. In addition, register RG3 stores 8-bit threshold voltage data DVEM for voltage drop detection. In addition, register RG4 for standby voltage storage is stored in Figure 3 The register is 8 bits, but it can also be a register with a bit number greater than 8 bits, such as 16 bits.
[0053] Thus, in the present embodiment, the threshold voltage data DVT such as the threshold voltage data DVFL, DVRC, DVEM for full charge detection, recharge detection, and voltage drop detection are multi-bit data. Thus, the threshold voltage data DVT of various values that can be represented by the 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, the threshold voltage data DVT with a resolution set by the number of bits of the multi-bits (for example, a resolution of about 60mV) can be stored in the register unit 40, and the processing circuit 50 can compare the backup voltage data DVBAT and the threshold voltage data DVT with the resolution. In addition, Figure 3 In FIG. 1 , an example of a case where the number of data bits is 8 bits is shown, but the present embodiment is not limited to this, and the number of data bits may be, for example, less than 8 bits or more than 8 bits, for example, 4 bits, 16 bits, etc.
[0054] In addition, if Figure 2 , Figure 4As shown, the voltage detection circuit 30 includes a voltage sensor 32. The voltage sensor 32 is a circuit that receives an analog backup power supply voltage VBAT as a detection target voltage and outputs backup voltage data DVBAT as digital voltage data. A detailed configuration example of the voltage sensor 32 will be described later.
[0055] In addition, if Figure 2 , Figure 4 As shown, 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 of the main power supply voltage VDD. The comparison circuit 34 is also called a comparator. For example, the main power supply voltage VDD is input to a first input terminal (e.g., a non-inverting input terminal) of the comparison circuit 34, and the threshold voltage VDT for detecting a voltage drop of VDD is input to a second input terminal (e.g., an inverting input terminal). Then, the comparison circuit 34 outputs a comparison result signal CPQ. For example, the comparison circuit 34 outputs a comparison result signal CPQ of a first voltage level (e.g., a high level) when VDD ≥ VDT, and outputs a comparison result signal CPQ of a second voltage level (e.g., a low level) when VDD < VDT.
[0056] Furthermore, when the main power supply voltage VDD is lower than 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 second voltage level. Then, the processing circuit 50 receives the comparison result signal CPQ and instructs 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. Thus, Figure 2For example, according to the instruction from the processing circuit 50, the switch control circuit 64 controls the switch SW1 of the power switching circuit 62 to be turned off and the switches SW2 and SW3 to be turned on. 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 decreases and becomes lower than the threshold voltage VDT for voltage drop detection, the backup power supply voltage VBAT maintained by the backup element 12 is supplied to the internal circuit of the circuit device 20 instead of the main power supply voltage VDD. Therefore, for example, when the main power supply voltage VDD decreases due to the non-supply of power, the internal circuit of the circuit device 20 can also 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.5V. Therefore, when the main power supply voltage VDD is lower than 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. In addition, the comparison circuit 34 preferably has a hysteresis characteristic for the threshold voltage VDT, and preferably makes the threshold voltage when the main power supply voltage VDD rises higher than the threshold voltage when the main power supply voltage VDD decreases. In this way, it is possible to prevent the operation from becoming unstable when the main power supply voltage VDD is a voltage near the threshold voltage.
[0057] In addition, if Figure 2 As shown, 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 external processing device of the circuit device 20 can access the register unit 40 via the interface circuit 80, write data to the register unit 40, or read data from the register unit 40.
[0058] For example, the interface circuit 80 communicates with an external processing device based on a given communication standard. 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 the data DA transmitted via the data terminal TDA and the clock signal CK input via the clock terminal TCK. In addition, SPI can be either a 3-wire SPI or a 4-wire SPI. In the case of a 3-wire SPI, the data terminal TDA becomes the input and output terminal of the data DA. In the case of a 4-wire SPI, a data terminal for input and a data terminal for output can be set as the data terminal TDA. In addition, the interface circuit 80 can also be capable of switching between serial communication modes such as I2C, 3-wire SPI, and 4-wire SPI. In this case, a switching terminal for switching the serial communication mode can be set in the circuit device 20.
[0059] In addition, 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, the external processing device writes the threshold voltage data DVT (DVFL, DVRC, DVEM) to be compared with the backup voltage data DVBAT into the register section 40 via the interface circuit 80. In this way, the threshold voltage data DVT of various values can be written into the register section 40 via the interface circuit 80. For example, as the threshold voltage data DVFL for full charge detection, the threshold voltage data DVRC for recharge detection, or the threshold voltage data DVEM for voltage drop detection, the threshold voltage data DVT of the values suitable for detection are written into the register section 40.
[0060] Thus, appropriate threshold voltage data DVT corresponding to the type of the backup element 12 can be written into the register unit 40 , and the power supply control circuit 60 can implement charging control based on the comparison result between the written threshold voltage data DVT and the backup voltage data DVBAT from the voltage detection circuit 30 .
[0061] In addition, the register section 40 stores the backup voltage data DVBAT detected by the voltage detection circuit 30. For example, Figure 2In the embodiment, the register RG4 of the register section 40 stores the backup voltage data DVBAT. Furthermore, the interface circuit 80 outputs the backup voltage data DVBAT stored in the register section 40. For example, when an external processing device accesses the register section 40 and performs a read operation of the backup voltage data DVBAT, the backup voltage data DVBAT stored in the register section 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. Thus, the external processing device can 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.
[0062] For example, in the prior art of the above-mentioned Patent Document 1, the backup power supply voltage and the reference voltage of the fixed value are only compared by the comparison circuit, and the voltage value of the backup power supply voltage cannot be monitored. In contrast, in the present 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, the external processing device can monitor the backup voltage data DVBAT and perform various controls and settings.
[0063] In addition, if Figure 2 As shown, the circuit device 20 includes an interruption generating circuit 70. Moreover, the interruption generating circuit 70 generates an interruption signal INT based on the comparison result of the backup voltage data DVBAT and the threshold voltage data DVT (DVFL, DVRC, DVEM). The interruption signal INT is output to the outside via, for example, an interruption output terminal TINT provided in the circuit device 20. For example, the interruption signal INT is a signal that becomes a prescribed voltage level (for example, a low level) when an interruption occurs. As an example, a circuit that outputs the interruption signal INT at the interruption output terminal TINT can be implemented by an open-drain N-type transistor or the like. In this way, when a prescribed state is detected based on the comparison result of the backup voltage data DVBAT and the threshold voltage data DVT (for example, when a full charge, recharging, etc. are detected), the detection of the prescribed state can be transmitted to the outside through the interruption signal INT from the interruption generating circuit 70.
[0064] For example, when the processing circuit 50 determines that the standby voltage data DVBAT is higher than the threshold voltage data DVFL for full charge detection, the interruption generating circuit 70 generates an interruption signal INT based on the signal from the processing circuit 50. Moreover, as described later, the register unit 40 stores the flag information of full charge detection as an interruption factor. Therefore, the external processing device detects the occurrence of an interruption based on the interruption signal INT generated by the interruption generating circuit 70, and reads the flag information of full charge detection from the register unit 40, thereby being able to detect full charge.
[0065] In addition, when the processing circuit 50 determines that the standby voltage data DVBAT is lower than the threshold voltage data DVEM for voltage detection, the interruption generating circuit 70 generates an interruption signal INT based on the signal from the processing circuit 50. Moreover, the register unit 40 stores the flag information of the voltage drop detection as an interruption factor. Therefore, the external processing device detects the occurrence of an interruption based on the interruption signal INT generated by the interruption generating circuit 70, and reads the flag information of the voltage drop detection from the register unit 40, thereby being able to detect that the standby power supply voltage VBAT is lower than the threshold voltage for voltage drop detection.
[0066] exist Figure 5 2 shows an example of the structure of the real-time clock device 22 of the present embodiment. The real-time clock device 22 includes a circuit device 20 and an oscillator 10. In addition to the voltage detection circuit 30, the register unit 40, the processing circuit 50, and the power supply control circuit 60, the circuit device 20 also includes an oscillation circuit 90 that oscillates the oscillator to generate a clock signal CK and a timing circuit 92 that performs timing processing based on the clock signal CK. The real-time clock device 22 is a device that generates time information by timing based on the clock signal CK, such as a real-time clock module. In addition, the real-time clock device 22 of the present embodiment is not limited to Figure 5 The structure of the real-time clock device 22 can be modified by omitting some of its structural elements, adding other structural elements, or replacing some structural elements with other structural elements. Figure 2 Alternatively, the circuit device 20 may be provided with an alarm circuit for notifying an alarm based on the timing result of the timing circuit 92, a watchdog timer circuit for performing a watchdog timer process based on the timing result, or the like.
[0067] The vibrator 10 is an element that generates mechanical vibrations by electrical signals. The vibrator 10 can be implemented, for example, by a vibrating plate such as a quartz vibrating plate. For example, the vibrator 10 can be implemented by a quartz vibrating plate that performs thickness shear vibrations with a cutting angle of AT cut or SC cut, a tuning fork type quartz vibrating plate, or a double tuning fork type quartz vibrating plate. In addition, the vibrator 10 of the present embodiment can also be implemented, for example, by various vibrating plates such as a thickness shear vibration type, a vibrating plate other than a tuning fork type or a double tuning fork type, a piezoelectric vibrating plate formed of a material other than quartz. For example, as the vibrator 10, a SAW (Surface Acoustic Wave) resonator, a MEMS (Micro Electro Mechanical Systems) vibrator as a silicon vibrator formed using a silicon substrate, etc. can also be used.
[0068] The oscillation circuit 90 is a circuit that outputs a clock signal CK. For example, the oscillation circuit 90 generates an oscillation signal based on the oscillation action of the oscillator 10, and outputs a clock signal CK based on the oscillation signal. For example, the oscillation circuit 90 drives the oscillator 10 such as a quartz oscillator through a driving circuit to make it oscillate, thereby generating a sinusoidal oscillation signal, and the generated oscillation signal is waveform-shaped by a waveform shaping circuit, thereby outputting a rectangular wave clock signal CK. The clock signal CK is, for example, a clock signal with a frequency of 32.768KHz. In addition, the frequency of the clock signal CK is not limited to this, and may also be a frequency such as 32KHz. In addition, the circuit device 20 may also have a clock output terminal that outputs the clock signal CK or its divided clock signal.
[0069] The timing circuit 92 performs timing processing based on the clock signal CK to generate time information. For example, the timing circuit 92 includes a frequency division circuit and a timing counter, which are not shown in the figure. The frequency division circuit divides the clock signal CK from the oscillation circuit 90 and outputs a divided clock signal. The timing counter performs timing counting processing based on the divided clock signal from the frequency division circuit. The timing circuit 92 generates, for example, time information representing the current time through the timing counting processing of such a timing counter. The time information as timing data can include data representing seconds, minutes, hours, days, months, and years. For example, the timing counter has counters for counting seconds, minutes, hours, days, months, and years, respectively, and generates time information through the counting processing of these counters. The generated time information is used as timestamp information, for example, via Figure 2 The interface circuit 80 outputs to the outside. Through the timing processing of the timing circuit 92, the clock function and calendar function of the real-time clock device 22 can be realized.
[0070] In addition, the real-time clock device 22 has a main power terminal EVDD, a backup power terminal EVBAT, and a ground terminal EGND as power terminals for external connection. The main power terminal EVDD, the backup power terminal EVBAT, and the ground terminal EGND are electrically connected to the main power terminal TVDD, the backup power terminal TVBAT, and the ground terminal TGND of the circuit device 20, respectively. In addition, the real-time clock device 22 may also have a power supply voltage output terminal for external connection 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 and the oscillator 10 as a semiconductor IC in a package. The main power terminal EVDD, the backup power terminal EVBAT, the ground terminal EGND, etc. for external connection are, for example, terminals provided in the package.
[0071] According to the real-time clock device 22 of the present embodiment, the clock function and calendar function of the real-time clock can be realized by the timing processing of the timing circuit 92 based on the clock signal CK from the oscillation circuit 90. In addition, in the real-time clock device 22 of the present embodiment, the charging of the backup element 12 by the main power supply voltage VDD can be controlled 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, or vehicle-mounted equipment, the real-time clock device 22 has the use of charging control of the backup element 12 such as a secondary battery and a super capacitor in addition to the use of obtaining and monitoring time information. According to the real-time clock device 22 of the present embodiment, these two uses can be handled. In addition, 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. Therefore, as described above, there is an advantage that flexible charging control can be realized to handle various types of backup elements 12.
[0072] 2. Detailed operation examples
[0073] Next, a detailed operation example of this embodiment will be described. Figure 6 is a diagram for explaining the operation when the power is turned on. Figure 6 As shown in FIG. 1 , the switches SW1 and SW3 of the power supply control circuit 60 are turned on, and the switch SW2 is turned off. As a result, the main power supply terminal TVDD and the backup power supply terminal TVBAT are connected to the power supply voltage output terminal TVOUT in parallel via the diodes D1 and D2. As a result, the main power supply voltage VDD from the main power supply terminal TVDD is reduced by the forward voltage of the diode D1 to Figure 6 The path shown in A1 is supplied to the node of the power supply voltage VOUT. In addition, the backup power supply voltage VBAT from the backup power supply terminal TVBAT is reduced by the amount of the forward voltage of the diode D2 and supplied to the node of the power supply voltage VOUT through the path shown in A2. In addition, as an example, the main power supply voltage VDD is about 3.3V.
[0074] Figure 7 1 is a diagram for explaining the operation of this embodiment when the backup element 12 is a primary battery. Figure 7 As shown in the normal mode, 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 Figure 7 The path shown in B1 of FIG. 2 is supplied to the node of the power supply voltage VOUT. Furthermore, the internal circuit of the circuit device 20 operates according to the power supply voltage VOUT based on the main power supply voltage VDD. In addition, in the normal mode operation, the circuit device 20 is always operated by using the power supply voltage VOUT. Figure 4The described comparison circuit 34 compares the main power supply voltage VDD with the threshold voltage VDT.
[0075] Furthermore, when the main power supply voltage VDD is lower than the threshold voltage VDT, the normal mode is switched to the standby mode. In the operation in the standby mode, the main power supply voltage VDD and the threshold voltage VDT are compared once, for example, every TA seconds. TA seconds is, for example, about 20 ms to 40 ms. Furthermore, when the main power supply voltage VDD becomes higher than the threshold voltage VDT, the standby mode is switched to the normal mode. In addition, the threshold voltage VDT when switching from the standby mode to the normal mode is set to a voltage higher than the threshold voltage VDT when switching from the normal mode to the standby mode. This can be achieved, for example, by using a comparison circuit 34 having a hysteresis function.
[0076] Figure 8 1 is a diagram for explaining the operation of this embodiment when the backup element 12 is a secondary battery or a super capacitor. Figure 8 As shown in FIG. 1 , in the normal mode operation, when the backup voltage data DVBAT detected by the voltage detection circuit 30 is lower than the recharge detection threshold voltage data DVRC stored in the register section 40, all switches SW1, SW2, and SW3 of the power control circuit 60 are turned on. As a result, as shown by C1, the main power supply voltage VDD is charged to the backup element 12. In addition, as shown by C2, the main power supply voltage VDD is supplied as the power supply voltage VOUT of the internal circuit of the circuit device 20.
[0077] Furthermore, when the backup voltage data DVBAT is higher than the threshold voltage data DVFL for full charge detection stored in the register unit 40, the switches SW2 and SW3 of the power supply control circuit 60 are turned off. In addition, the switch SW1 remains turned on. Thus, the charging of the backup element 12 by the main power supply voltage VDD is stopped. In addition, 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.
[0078] Furthermore, in any of the above states (charging state, charging stop state) in the normal mode, when the main power supply voltage VDD is lower than the threshold voltage VDT, the normal mode is switched to the standby mode. In this case, the main power supply voltage VDD is always monitored. Furthermore, in the operation in the standby mode, for example, the main power supply voltage VDD is compared with the threshold voltage VDT once every TA seconds, and when the main power supply voltage VDD becomes higher than the threshold voltage VDT, the standby mode is switched to the normal mode.
[0079] In addition, in this embodiment, if using Figure 2As described, the register section 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 section 40. In this case, in the present embodiment, for example, the register section 40 stores the backup voltage data DVBAT at the time indicated by the interface circuit 80. For example, in the first mode, the register section 40 stores the backup voltage data DVBAT output from the voltage detection circuit 30 at each given period. Thus, the backup voltage data DVBAT stored in the register section 40 is updated at each given period. On the other hand, in the second mode, the register section 40 stores and holds the backup voltage data DVBAT at the time indicated by the interface circuit 80. In this way, the external processing device can read the backup voltage data DVBAT at the time indicated by the interface circuit 80 from the register section 40 via the interface circuit 80. Thus, the external processing device can obtain the backup voltage data DVBAT at the desired time by itself, and monitor the backup power supply voltage VBAT of the backup element 12, etc.
[0080] For example, the register unit 40 has Fig. 9 The registers RG5 and RG6 shown. Moreover, for example, when the SEC for latch control of bit b0 of register RG5 is set to 1, the latch mode as the second mode is effective, and when the SEC for latch control of bit b0 of register RG5 is set to 0, the latch mode as the second mode is invalid. Moreover, when the external processing device writes the instruction RDCMD to register RG6, the backup voltage data DVBAT at the time corresponding to the writing time is latched and maintained in the register of the register unit 40. For example, Fig.10 In the embodiment, at time t1, t2, t3, and t4, the voltage detection circuit 30 outputs the backup voltage data DVBAT, and the backup voltage data DVBAT is written into the register of the register unit 40. Fig. 9 In the embodiment, when the bit of SEC of register RG5 is set to 1 and the external processing device writes the command RDCMD to register RG6 via the interface circuit 80, for example, the backup voltage data DVBAT at the previous time t2 before this time is latched and held in the register of the register unit 40. Therefore, when the external processing device subsequently reads the register via the interface circuit 80, the readout voltage DVBAT is Fig.10 The backup voltage data DVBAT at time t2.
[0081] Fig.11 Yes Description Figure 2 The register unit 40 has Fig.11RG7, RG8 of the register RG7. Moreover, when IEE of bit b2 of the register RG7 is set to 1, for example, interruption of voltage drop detection is enabled. In addition, when IEF of bit b1 of the register RG7 is set to 1, for example, interruption of full charge detection is enabled. In addition, VSE of bit b0 of the register RG7 is a bit for enabling or disabling monitoring of the backup power supply voltage VBAT.
[0082] Furthermore, when the interruption of the full charge detection is permitted by the IEF of the register RG7, if it is detected that the backup voltage data DVBAT is higher than the threshold voltage data DVFL, Figure 2 The interrupt generating circuit 70 outputs the interrupt signal INT. In addition, the FUL of the bit b1 of the register RG8 of the interrupt factor is set to 1, for example. Therefore, the external processing device notified of the occurrence of the interrupt by the interrupt signal INT can detect that the full charge has been detected by reading the FUL of the register RG8 via the interface circuit 80.
[0083] In addition, when the interruption of the voltage drop detection is allowed by the IEE of the register RG7, when it is detected that the backup voltage data DVBAT is lower than the threshold voltage data DVEM, the interruption generating circuit 70 outputs the interruption signal INT. In addition, the EMP of the bit b0 of the register RG8 of the interruption factor is set to 1, for example. Therefore, the external processing device notified of the occurrence of the interruption by the interruption signal INT can detect that the voltage drop of the backup power supply voltage VBAT has been detected by reading the EMP of the register RG8 through the interface circuit 80.
[0084] 3. Voltage sensor
[0085] exist Fig.12 Shown in the use of Figure 2 , Figure 3 The voltage sensor 32 is a configuration example of the voltage sensor 32. The voltage sensor 32 receives the backup power supply voltage VBAT as the detection target voltage VSEN and outputs the backup voltage data DVBAT as the voltage data DV. Fig.12 As shown, the voltage sensor 32 includes a current supply circuit 110 , an oscillation circuit 120 , a counter circuit 130 , and an operation circuit 140 .
[0086] 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 oscillation 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.
[0087] The oscillation circuit 120 is an oscillation circuit for voltage detection whose oscillation frequency varies according to the supply current IB. For example, the larger the current value of the supply current IB, the higher the oscillation frequency of the oscillation circuit 120. The oscillation circuit 120 can be implemented by connecting an odd number of signal inversion circuits into a ring oscillator in a loop shape. The signal inversion circuit can be implemented, for example, by an inverter circuit, a NAND circuit, etc. Moreover, in each of the plurality of signal inversion circuits, the oscillation frequency of the oscillation circuit 120 is controlled by controlling the supply current IB flowing from the high potential side power supply to the low potential side power supply. For example, the larger the current value of the supply current IB flowing, the higher the oscillation frequency.
[0088] The counter circuit 130 counts the output clock signal RCK of the voltage detection oscillation circuit 120 in a given period. For example, the counter circuit 130 counts the number of pulses (clocks) of the output clock signal RCK in a given period and outputs a count value CT.
[0089] The calculation circuit 140 calculates voltage data DV (DVBAT) corresponding to the detection target voltage VSEN based on the count value CT obtained by the counting process in a state where the supply current IB is supplied to the voltage detection oscillation circuit 120 .
[0090] Fig.13 3 is a signal waveform diagram for explaining the operation of the voltage sensor 32 . Fig.13 The clock signal CK is Figure 5 The oscillation circuit 90 generates an oscillation clock signal by oscillating the oscillator 10. Fig.13 As shown, the above-mentioned given period TSENS used in the counter circuit 130 is a period specified by the clock signal CK of the oscillation circuit 90. For example, the period TSENS becomes a period of length corresponding to the specified number of pulses of the clock signal CK. For example, the period TSENS is set by counting the number of pulses of the clock signal CK of the oscillation circuit 90. Moreover, the counter circuit 130 outputs a count value CT obtained by counting the number of pulses of the output clock signal RCK within the period TSENS. For example, the clock signal CK is a clock signal generated by oscillating the oscillator 10 by the oscillation circuit 90, and therefore, the period TSENS set based on the clock signal CK becomes a period with a higher precision in its length. In particular, when a quartz oscillator is used as the oscillator 10, the period TSENS becomes a period with a higher precision. Moreover, since Fig.12 The voltage sensor 32 calculates the voltage data DV based on the count value CT of the number of pulses of the output clock signal RCK in the period TSENS with relatively high accuracy, and therefore has the advantage of being able to output the voltage data DV with relatively high accuracy.
[0091] According to the voltage sensor 32 as described above, the supply current IB that changes according to the detection target voltage VSEN is supplied to the oscillation circuit 120, and the output clock signal RCK from the oscillation circuit 120 whose oscillation frequency changes according to the supply current IB is counted within a given period TSENS, and a calculation is performed based on the obtained count value CT, thereby calculating the voltage data DV corresponding to the detection target voltage VSEN. Thus, for example, by setting the length of the given period TSENS for counting processing, changing the algorithm of the calculation processing of the calculation circuit 140, etc., the detection accuracy of the detection target voltage VSEN can be adjusted. In addition, the detection accuracy can be made not to be restricted by the performance of the analog circuit.
[0092] in addition, Fig.12 The current supply circuit 110 can be composed of, for example, a resistor connected in series between a supply node of the detection object voltage VSEN and a node of a low potential side power supply (e.g., GND), a diode-connected transistor, and a current mirror circuit that supplies a supply current IB by current mirroring the current flowing through the transistor. The diode-connected transistor is, for example, an N-type transistor with a drain and a gate connected. If the gate / source voltage of the diode-connected transistor is set to Vth+Vod, the voltage at the connection node between the resistor and the transistor becomes 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, whereby a current of IB={VSEN-(Vth+Vod)} / R1 flows through the resistor having a resistance value of R1. Therefore, a current that changes according to the detection object voltage VSEN, i.e., IB={VSEN-(Vth+Vod)} / R1, is supplied to the oscillation circuit 120. In addition, the voltage sensor 32 is not limited to Fig.12 The structure may be, for example, a circuit that performs A / D conversion on a detection target voltage to generate voltage data.
[0093] As described above, the circuit device of this embodiment includes: a main power supply terminal to which the main power supply voltage is supplied; a backup power supply terminal to which the backup power supply voltage from the 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. In addition, the circuit device includes: a register section 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 of the processing circuit.
[0094] According to this embodiment, the charging control of the backup element can be performed 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. As a result, the threshold setting of the charging control can be flexibly performed, and the flexible charging control of the backup element can be realized.
[0095] In addition, in this embodiment, the register unit may store threshold voltage data for full charge detection as threshold voltage data, and the power supply control circuit may perform the following control: when the backup voltage data is higher than the threshold voltage data for full charge detection, the main power supply voltage is stopped from charging the backup element.
[0096] In this way, when it is detected that the backup voltage data stored in the register unit is higher than the threshold voltage data for full charge detection, it is determined that the charging voltage of the backup element has reached the full charge voltage, and charging of the backup element can be stopped.
[0097] In this embodiment, the register unit may store threshold voltage data for recharge detection as threshold voltage data, and the power supply control circuit may control the power supply control circuit to start charging the backup element with the main power supply voltage when the backup voltage data is lower than the threshold voltage data for recharge detection.
[0098] In this way, when it is detected that the backup voltage data stored in the register section is lower than the threshold voltage data for recharge detection, it is determined that the charging voltage of the backup element has reached the recharge voltage, and charging of the backup element can be started.
[0099] In the present embodiment, the register unit may store threshold voltage data for detecting a voltage drop in the backup power supply voltage as the threshold voltage data.
[0100] In this way, the voltage drop of the backup power supply voltage can be detected using the threshold voltage data for voltage drop detection stored in the register unit.
[0101] In addition, in the present embodiment, the threshold voltage data may be multi-bit data.
[0102] 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.
[0103] In addition, in this embodiment, the voltage detection circuit may include a comparison circuit that compares the main power supply voltage and a threshold voltage for detecting a voltage drop of 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 is lower than the threshold voltage for detecting a voltage drop.
[0104] In this way, when the main power supply voltage drops below the voltage drop detection threshold voltage, the backup power supply voltage by the backup element is supplied to the internal circuit of the circuit device instead of the main power supply voltage.
[0105] Furthermore, in the present embodiment, the circuit device may include an interface circuit for accessing the register unit.
[0106] In this way, a processing device or the like outside the circuit device can access the register unit via the interface circuit, and write data to the register unit or read data from the register unit.
[0107] In addition, in the present embodiment, the threshold voltage data may be set in the register unit via the interface circuit.
[0108] In this way, threshold voltage data of various values can be written into the register unit via the interface circuit.
[0109] In the present embodiment, the register section may store the backup voltage data detected by the voltage detection circuit, and the interface circuit may output the backup voltage data stored in the register section.
[0110] In this way, the backup voltage data detected by the voltage detection circuit can be output to the outside via the interface circuit.
[0111] In the present embodiment, the register unit may store the backup voltage data at a time indicated by the interface circuit.
[0112] In this way, the external processing device can read the backup voltage data at the time indicated by the interface circuit from the register unit via the interface circuit.
[0113] Furthermore, in the present embodiment, the circuit device may include an interruption generating circuit that generates an interruption signal based on a comparison result between the backup voltage data and the threshold voltage data.
[0114] In this way, when a predetermined state is detected based on the comparison result between the backup voltage data and the threshold voltage data, the fact that the predetermined state is detected can be notified to the outside through an interrupt signal from the interrupt generating circuit.
[0115] In addition, in the present embodiment, the voltage detection circuit may include a voltage sensor, which receives the backup power supply voltage as the detection target voltage and outputs the backup voltage data as the voltage data. Furthermore, the voltage sensor may include: an oscillation circuit for voltage detection, whose oscillation frequency changes according to the supply current; and a current supply circuit, which supplies the current that changes according to the detection target voltage as the supply current to the oscillation circuit for voltage detection. In addition, the voltage sensor may include: a counter circuit, which performs a counting process for counting the output clock signal of the oscillation circuit for voltage detection within a given period; and an operation circuit, which calculates the voltage data corresponding to the detection target voltage based on the count value obtained by the counting process in the state where the supply current is supplied to the oscillation circuit for voltage detection.
[0116] According to the voltage sensor having such a configuration, the detection accuracy of the detection target voltage can be adjusted by, for example, setting the length of a given period for counting processing, changing the algorithm of the calculation processing of the calculation circuit, and the like.
[0117] The real-time clock device of the present embodiment includes the circuit device and the oscillator described above, wherein the circuit device includes an oscillation circuit that oscillates the oscillator to generate a clock signal, and a timing circuit that performs timing processing based on the clock signal.
[0118] According to the real-time clock device of this structure, by timing processing based on the clock signal from the oscillation circuit, it is possible to realize the clock function of the real-time clock, the calendar function, etc. In addition, it is also possible to control the charging 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.
[0119] In addition, although the present embodiment is described in detail as described above, a person skilled in the art can easily understand that many modifications can be made without substantially departing from the new matters and effects of the present disclosure. Therefore, all such modifications are included in the scope of the present disclosure. For example, in the specification or the drawings, a term recorded at least once together with a different term in a broader sense or with the same meaning can be replaced with the different term in any part of the specification or the drawings. In addition, all combinations of the present embodiment and the modifications are also included in the scope of the present disclosure. In addition, the structure / action of the circuit device, the real-time clock device, etc. are not limited to the contents described in the present embodiment, and various modifications can be implemented.
Claims
1. A circuit device, characterized in that: The circuit device comprises: a main power supply terminal to which a main power supply voltage is supplied; a standby power supply terminal to which a standby power supply voltage from a standby element is supplied; a voltage detection circuit, which detects the backup power supply voltage and outputs backup voltage data corresponding to the backup power supply voltage; a register section storing threshold voltage data to be compared with the backup voltage data; a processing circuit that compares the standby voltage data with the threshold voltage data; as well as A power supply control circuit controls charging of the standby element by the main power supply voltage based on the comparison result of the processing circuit.
2. The circuit arrangement according to claim 1, characterized in that The register unit stores threshold voltage data for full charge detection as the threshold voltage data. The power supply control circuit performs control such that, when the backup voltage data is higher than the threshold voltage data for full charge detection, charging of the backup element by the main power supply voltage is stopped.
3. The circuit arrangement according to claim 1, characterized in that The register section stores threshold voltage data for recharge detection as the threshold voltage data. The power supply control circuit performs control such that, when the standby voltage data is lower than the threshold voltage data for recharge detection, charging of the standby element by the main power supply voltage is started.
4. The circuit arrangement according to claim 1, characterized in that The register unit stores, as the threshold voltage data, threshold voltage data for detecting a voltage drop in the backup power supply voltage.
5. The circuit arrangement according to claim 1, characterized in that The threshold voltage data is multi-bit data.
6. The circuit arrangement according to claim 1, characterized in that 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 switches 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 voltage drop detection threshold voltage.
7. The circuit arrangement according to claim 1, characterized in that The circuit arrangement comprises an interface circuit for accessing the register section.
8. The circuit arrangement according to claim 7, characterized in that The threshold voltage data is set in the register unit via the interface circuit.
9. The circuit arrangement according to claim 7, characterized in that The register section stores the backup voltage data detected by the voltage detection circuit. The interface circuit outputs the backup voltage data stored in the register section.
10. The circuit arrangement according to claim 9, characterized in that The register section stores the backup voltage data at a time indicated via the interface circuit.
11. The circuit arrangement according to claim 1, characterized in that The circuit device includes an interrupt generation circuit that generates an interrupt signal based on the comparison result of the standby voltage data and the threshold voltage data.
12. The circuit arrangement according to claim 1, characterized in that The voltage detection circuit includes a voltage sensor, the voltage sensor receives the backup power supply voltage as a detection target voltage, and outputs the backup voltage data as voltage data. The voltage sensor comprises: An oscillator circuit for voltage detection whose oscillation frequency varies according to the supplied current; a current supply circuit that supplies a current that changes according to the detection target voltage as the supply current to the voltage detection oscillation circuit; a counter circuit that performs a counting process for counting an output clock signal of the voltage detection oscillation circuit within a given period; as well as The calculation circuit calculates the voltage data corresponding to the detection target voltage based on the count value obtained by the counting process in a state where the supply current is supplied to the voltage detection oscillation circuit.
13. A real-time clock device, characterized in that: The real-time clock device comprises: The circuit arrangement of any one of claims 1 to 12; and Vibrator, The circuit device comprises: an oscillation circuit that oscillates the oscillator to generate a clock signal; and A timing circuit performs timing processing based on the clock signal.
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