Circuit device and real-time clock device

The circuit device uses a memory control circuit to segregate timed data into distinct areas for different events, employing FIFO mode to prevent overwriting and ensure reliable event history maintenance and error identification.

JP7581675B2Active Publication Date: 2024-11-13SEIKO EPSON CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2020117598
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-07-08
Publication Date
2024-11-13
Estimated Expiration
2040-07-08

AI Technical Summary

Technical Problem

Conventional methods for storing timed data in memory fail to address the issue of overwriting when multiple events occur closely in time, leading to loss of timing data for other events, complicating troubleshooting and error identification in devices.

Method used

A circuit device with a memory control circuit that separates timed data into distinct memory areas for different events, using a first-in-first-out (FIFO) mode to write and read clock data based on specific event signals, preventing overwriting and ensuring reliable time stamping.

Benefits of technology

The solution effectively prevents overwriting of timing data for one event when multiple events occur rapidly, maintaining accurate event histories and facilitating error identification and troubleshooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007581675000001
    Figure 0007581675000001
  • Figure 0007581675000002
    Figure 0007581675000002
  • Figure 0007581675000003
    Figure 0007581675000003
Patent Text Reader

Abstract

To provide a circuit device, a real-time clock device or the like that appropriately store timekeeping data corresponding to multiple types of events.SOLUTION: A circuit device 100 includes a timekeeping circuit 30 for generating timekeeping data, a memory 21, and a memory control circuit 12. In the memory 21, a first memory area 21-1 corresponding to a first event, and a second memory area 21-2 corresponding to a second event are set. The memory control circuit 12 writes the timekeeping data to the first memory area 21-1 of the memory 21 when a first event signal EVIN1 corresponding to the first event is detected, and performs control to write the timekeeping data to the second memory area 21-2 of the memory 21 when a second event signal EVIN2 corresponding to the second event is detected.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a circuit device, a real-time clock device, and the like. [Background technology]

[0002] Conventionally, there are known methods for storing time data in memory based on various triggers. For example, Patent Document 1 discloses a method for storing time data in a single buffer based on multiple different types of internal events. Patent Document 2 discloses a method for storing time data in memory in response to event signals input to multiple event terminals. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2018-116588 A [Patent Document 2] JP 2003-132470 A Summary of the Invention [Problem to be solved by the invention]

[0004] Patent Documents 1 and 2 do not specifically disclose how to store the timing data of different events in memory. In the conventional method, for example, when a malfunction occurs such that a certain type of event occurs in a short time, the timing data of other types of events may be overwritten and lost. [Means for solving the problem]

[0005] One aspect of the present disclosure relates to a circuit device including a timing circuit that generates timing data, a memory having a plurality of memory areas, and a memory control circuit that writes the timing data to the memory, wherein the memory has a first memory area corresponding to a first event and a second memory area corresponding to a second event, and the memory control circuit controls writing the timing data to the first memory area of ​​the memory when a first event signal corresponding to the first event is detected, and writing the timing data to the second memory area of ​​the memory when a second event signal corresponding to the second event is detected.

[0006] Another aspect of the present disclosure relates to a circuit device including a timing circuit that generates timing data, a memory having a plurality of memory areas, and a memory control circuit that writes the timing data to the memory, wherein (1) when a first FIFO (First In First Out) mode is set, the memory is set to a first memory area corresponding to a first event and a second memory area corresponding to a second event, and the memory control circuit controls to write the timing data to the first memory area of ​​the memory when a first event signal corresponding to the first event is detected, and to write the timing data to the second memory area of ​​the memory when a second event signal corresponding to the second event is detected, and (2) when a second FIFO mode is set, the memory is set to have the first memory area and the second memory area as one memory area, and the memory control circuit controls to write the timing data to the memory area of ​​the memory when the first event signal is detected, and to write the timing data to the memory area of ​​the memory when the second event signal is detected.

[0007] Yet another aspect of the present disclosure relates to a real-time clock device including the above-mentioned circuit device and an oscillator, wherein the circuit device includes an oscillation circuit that causes the oscillator to oscillate, and the timing circuit performs timing operations based on an oscillation signal of the oscillation circuit. [Brief description of the drawings]

[0008] [Figure 1] 1 shows an example of the configuration of a circuit device. [Diagram 2] 2 shows an example of the configuration of a real-time clock device including a circuit device. [Diagram 3] 13 shows an example of the configuration of a circuit device in a first FIFO mode. [Figure 4] 1 shows an example of the configuration of a first memory control circuit. [Diagram 5] 13 shows an example of the configuration of a second memory control circuit. [Figure 6] FIG. 13 is a diagram for explaining memory control in a first FIFO mode. [Figure 7] Example of data structure in 1st FIFO mode. [Figure 8] 3 shows an example of the configuration of a circuit device in direct mode. [Figure 9] 13 shows an example of the configuration of a third memory control circuit. [Figure 10] FIG. 4 is a diagram for explaining memory control in a direct mode. [Figure 11] Example of data structure in direct mode. [Figure 12] 6 is a diagram showing the relationship between flag information and the state of a circuit device. [Figure 13] 13 shows an example of the configuration of a circuit device in a second FIFO mode. [Figure 14] FIG. 13 is a diagram for explaining memory control in the second FIFO mode. [Figure 15] Example of data structure in second FIFO mode. [Figure 16] FIG. 4 is a diagram for explaining the operation of a memory control circuit according to a mode. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] A preferred embodiment of the present disclosure will be described in detail below. Note that the embodiment described below does not unduly limit the contents described in the claims, and all of the configurations described in the embodiment are not necessarily essential configurations.

[0010] 1. System configuration example As described above, in the conventional circuit device, when an internal event or an external event occurs, timing data corresponding to the occurrence timing of the event is stored. In addition, the conventional method also discloses a method of storing information such as a flag that identifies the event.

[0011] However, the conventional methods such as those disclosed in Patent Documents 1 and 2 do not disclose specific control for storing timing data, etc. Therefore, as described above, if a malfunction occurs in which a specific event occurs many times in a short period of time, data for other events will be lost.

[0012] For example, the circuit device 100 of the present embodiment is provided in a device such as a meter, and detects the opening and closing of the door of the meter as an external event. In this case, it is possible to store the occurrence of the door opening and closing event in association with the timekeeping data. This makes it possible to determine the implementation status of meter reading, the implementation status of maintenance, or the presence or absence of unauthorized opening and closing. However, there is a risk that opening and closing events will be detected continuously due to the door vibrating when opening and closing. If a large number of entries related to opening and closing events are made, information on other events will be lost. For example, the occurrence history of internal events described later is useful for identifying the cause of errors in devices including the circuit device 100. If these histories are lost, it becomes difficult to distinguish the cause of errors, and therefore it may become difficult to respond to malfunctions.

[0013] Furthermore, in precision equipment such as multifunction printers, certain levers or doors on the equipment are opened and closed during factory inspection, maintenance by a service technician, repairs, when the user replaces the toner, etc. By detecting these as external events and acquiring timing data at that time, it is possible to determine whether any operational error is causing the malfunction. If the timing data is lost, it becomes difficult to identify the cause of the malfunction.

[0014] Timing data can also be used to determine the order in which multiple events occur. For example, in FA (Factory Automation) equipment, it is necessary to evaluate multiple pieces of timing data to determine whether a processing completion signal or multiple error cause signals occurred first. For example, if the timestamp of the processing completion event is earlier, it is determined that there is no error, and if the error cause is earlier, it is determined that there is a process defect. In this case, it is necessary to store enough timing data to determine the order in which the processing completion event and error cause occurred, and if the timing data is lost, it becomes difficult to make the determination.

[0015] FIG. 1 shows an example of the configuration of a circuit device 100 according to the present embodiment that can solve the above-mentioned problems. The circuit device 100 includes a memory control circuit 12, a memory 21, and a clock circuit 30. The circuit device 100 can be realized, for example, by an integrated circuit device. For example, a real-time clock device 200 is configured by combining the configuration of FIG. 1 with an oscillator circuit 80 and an oscillator XTAL, which will be described later. Note that the present embodiment is not limited to the configuration of FIG. 1, and various modifications are possible, such as omitting some of the components or adding other components. For example, the circuit device 100 can include each unit, which will be described later with reference to FIG. 2.

[0016] The clock circuit 30 generates clock data, which is real-time clock information, based on an oscillation signal generated using the oscillator XTAL. The memory control circuit 12 performs control to write the clock data to the memory 21, triggered by the occurrence of at least one of an internal event and an external event of the circuit device 100. In the following, when there is no need to distinguish between an internal event and an external event, the event will simply be referred to as an event. The memory control circuit 12 stores, for example, event information that identifies an event and clock data at the time when the occurrence of the event is detected in the memory 21.

[0017] An internal event is an event that occurs inside a device including the circuit device 100. The device here is specifically the real-time clock device 200. Specifically, the internal event is an event in which a detection signal indicating the occurrence of an event is generated inside the circuit device 100. The detection signal notifies the memory control circuit 12 of the occurrence of the internal event, and the memory control circuit 12 detects the occurrence of the internal event. On the other hand, an external event is an event in which a detection signal indicating the occurrence of an event is generated outside the circuit device 100, for example, outside the real-time clock device 200. For example, the external event is detected using a sensor provided outside the real-time clock device 200. A detection signal from a sensor or the like is input to the memory control circuit 12 via the terminal TEVIN of the circuit device 100, and the memory control circuit 12 detects the occurrence of the external event.

[0018] In a narrow sense, the event information that identifies an event is information that identifies an event that triggered the control of writing the timing data. In other words, the event information is information that identifies whether or not each of a plurality of events has occurred. Hereinafter, this information is also referred to as trigger information. The event information may also include flag information regarding an internal event at the time when the triggering event occurred. Specifically, the flag information is information that indicates whether or not an internal event has occurred prior to the time when the target timing data is stored in memory 21. For example, when flag information is stored for a plurality of internal events, the flag information includes information that identifies whether or not each internal event has occurred. In other words, by looking at the flag information, it is possible to know which of the multiple internal events has occurred.

[0019] The timekeeping data is data that represents time as real-time clock information. That is, it is data of time measured by the timekeeping circuit 30 as real-time clock information. For example, the timekeeping data is data that indicates date and time, and can include calendar data and time data. For example, the calendar data is data such as year, month, week, and day, and the time data is data such as hour, minute, and second. For example, the timekeeping circuit 30 divides the oscillation signal to generate a clock signal with a period of one second, and measures time by counting the clock signal. As will be described later with reference to FIG. 11 and the like, the timekeeping circuit 30 may output timekeeping data that includes time data of less than one second. For example, the timekeeping circuit 30 can output timekeeping data that can specify the time in 1 / 1024 second units.

[0020] The memory control circuit 12 and the clock circuit 30 are each realized by a logic circuit. For example, the memory control circuit 12 and the clock circuit 30 may be configured as an integrated logic circuit. The logic circuit here is, for example, a gate array. The memory 21 is, for example, a RAM (Random access memory). Furthermore, the circuit device 100 may include other memory elements and memory circuits, such as a register 22, as will be described later with reference to FIG. 2.

[0021] 1, the circuit device 100 of this embodiment includes a timing circuit 30 that generates timing data, a memory 21, and a memory control circuit 12 that writes the timing data to the memory 21. The memory 21 is set with a first memory area 21-1 corresponding to a first event and a second memory area 21-2 corresponding to a second event.

[0022] The memory control circuit 12 writes timing data into the first memory area 21-1 of the memory 21 when a first event signal corresponding to a first event is detected. The memory control circuit 12 also performs control to write timing data into the second memory area 21-2 of the memory 21 when a second event signal corresponding to a second event is detected. For example, the first event signal is EVIN1, and the second event is EVIN2. As described later, EVIN1 and EVIN2 are event signals input from terminals TEVIN1 and TEVIN2, respectively, and are signals that represent external events. However, the first event and the second event may be other events.

[0023] According to this embodiment, the timing data corresponding to the first event and the timing data corresponding to the second event are stored in different areas of the memory 21. Therefore, when the first event occurs many times in a short period of time, the timing data related to the second event is not overwritten. Also, when the second event occurs many times in a short period of time, the timing data related to the first event is not overwritten. Since the occurrence status of internal events and external events of the circuit device 100 is appropriately maintained, it is possible to improve the reliability of the time stamp.

[0024] FIG. 2 is a diagram showing a detailed configuration of the circuit device 100, and is a configuration example of a real-time clock device 200 including the circuit device 100. The circuit device 100 shown in FIG. 2 includes a processing circuit 10, a memory unit 20, a clock circuit 30, a main power supply voltage detection unit 41, a backup power supply voltage detection unit 42, a power supply control unit output voltage detection unit 43, an oscillation signal detection unit 44, a power supply control circuit 50, an interface circuit 60, an interrupt control circuit 70, an oscillation circuit 80, and a clock signal output circuit 90. The circuit device 100 also includes terminals TVBAT, TVOUT, TVDD, VEVIN, TSCL, TSDA, TIRQ, TFOUT, XI, and XO. Note that the same components as those described in FIG. 1 are given the same reference numerals, and the description will be omitted as appropriate. In addition, this embodiment is not limited to the configuration of FIG. 2, and various modifications such as omitting some of the components or adding other components are possible.

[0025] A backup power supply voltage VBAT supplied from a backup power supply is input to a terminal TVBAT. A main power supply voltage VDD supplied from a main power supply is input to a terminal TVDD. The power supply control circuit 50 selects the main power supply voltage VDD or the backup power supply voltage VBAT, and supplies the selected voltage as a voltage VOUT to each part of the circuit device 100. The voltage VOUT is an internal power supply voltage of the circuit device 100. Specifically, the power supply control circuit 50 selects the main power supply voltage VDD when the main power supply voltage VDD exceeds a given voltage, and selects the backup power supply voltage VBAT when the main power supply voltage VDD falls below the given voltage. For example, the power supply control circuit 50 is composed of a comparator that compares the main power supply voltage VDD with a given voltage, and an analog switch circuit that is controlled to be turned on and off based on the output of the comparator.

[0026] The main power supply voltage detection unit 41 compares the main power supply voltage with a first reference voltage, and changes the output signal VDET from inactive to active when the main power supply voltage falls below the first reference voltage. "Inactive" represents a first logic level, and corresponds to, for example, a low level "0." "Active" represents a second logic level, and corresponds to, for example, a high level "1." For example, the main power supply voltage detection unit 41 can be realized by a comparator. The output signal VDET corresponds to a flag indicating whether the main power supply voltage VDD is abnormal or not.

[0027] The backup power supply voltage detection unit 42 compares the backup power supply voltage VBAT with a second reference voltage, and changes the output signal VBLF from inactive to active when the backup power supply voltage VBAT falls below the second reference voltage. For example, the backup power supply voltage detection unit 42 can be realized by a comparator. The output signal VBLF corresponds to a flag indicating whether or not the backup power supply voltage VBAT is abnormal.

[0028] The power supply control unit output voltage detection unit 43 detects whether the voltage VOUT, which is the output voltage of the power supply control circuit 50, is abnormal. That is, it compares the voltage VOUT with a third reference voltage, and when the voltage VOUT falls below the third reference voltage, it changes the output signal VLOW from inactive to active. The output signal VLOW corresponds to a flag that indicates whether the voltage VOUT is abnormal.

[0029] The oscillation signal detector 44 receives an oscillation signal or a signal based on the oscillation signal, determines whether the oscillation signal is abnormal based on the input signal, and changes the output signal FST from inactive to active when it determines that the oscillation signal has become abnormal. For example, the oscillation signal detector 44 is composed of a smoothing circuit that smoothes the input signal to a DC voltage level, and a comparator that compares the DC voltage level with a fourth reference voltage. The output signal FST corresponds to a flag that indicates whether the oscillation signal is abnormal.

[0030] The main power supply is a power supply for a system including the real-time clock device 200 and an external device, and its voltage is the main power supply voltage VDD. The backup power supply is a power supply for operating the real-time clock device 200 when the main power supply is not being supplied, and its voltage is the backup power supply voltage VBAT. For example, the backup power supply is a power supply supplied from a primary battery, a secondary battery, a supercapacitor, or the like. Abnormalities in the main power supply voltage VDD and the backup power supply voltage VBAT include, for example, a drop in these voltages, fluctuations in these voltages due to noise, or failure to supply these voltages to the real-time clock device 200 due to poor mounting, etc. Abnormalities in the oscillation signal include, for example, the stop of the oscillation signal, or an oscillation frequency that is not a specified frequency, etc.

[0031] The processing circuit 10 includes a control unit 11 that controls each unit of the circuit device 100, and a memory control circuit 12 that controls writing of timing data to a memory 21 by performing event control processing based on internal events and external events. The storage unit 20 includes a memory 21 and a register 22.

[0032] Specifically, the memory control circuit 12 receives output signals VDET, VLOW, VBLF, and FST indicating whether an internal event has occurred, and a signal EVIN indicating whether an external event has occurred. EVIN is input from outside the circuit device 100 via a terminal TEVIN. EVIN includes, for example, EVIN1 to EVIN3. The external event includes a write command trigger indicating a write to the register 22 via the interface circuit 60. An event signal indicating a write command trigger is denoted as WCT. When any of these signals changes from inactive to active, the memory control circuit 12 transfers the event information and the timing data to the memory 21.

[0033] The trigger information in the event information is information that specifies a signal that has become active, for example, among VDET, VLOW, VBLF, FST, EVIN1 to 3, WCT, etc. Furthermore, the flag information is specifically the output signals VDET, VLOW, VBLF, and FST.

[0034] The oscillator circuit 80 is connected to one end of the oscillator XTAL via a terminal XI and to the other end of the oscillator XTAL via a terminal XO, and drives the oscillator XTAL to oscillate. For example, the oscillator circuit 80 includes an amplifier circuit that drives the oscillator XTAL and an adjustment circuit that adjusts the oscillation frequency. The adjustment circuit is, for example, a capacitor array. Alternatively, the oscillator circuit 80 may further include a temperature sensor and a temperature compensation circuit that compensates for the temperature characteristics of the oscillation frequency based on the output voltage of the temperature sensor.

[0035] The oscillator XTAL is, for example, a piezoelectric oscillator such as a quartz crystal oscillator. Alternatively, the oscillator XTAL may be a resonator. The resonator is an electromechanical resonator or an electrical resonant circuit. As the oscillator XTAL, a piezoelectric oscillator, a SAW (Surface Acoustic Wave) resonator, a MEMS (Micro Electro Mechanical Systems) oscillator, or the like can be adopted. As the substrate material of the oscillator XTAL, a piezoelectric material such as a piezoelectric single crystal such as quartz crystal, lithium tantalate, or lithium niobate, or a piezoelectric ceramic such as lead zirconate titanate, or a silicon semiconductor material, or the like can be used. As the excitation means of the oscillator XTAL, a piezoelectric effect may be used, or electrostatic drive by Coulomb force may be used.

[0036] The timing circuit 30 includes a frequency divider 31 that divides the oscillation signal generated by the oscillation circuit 80 to generate a clock signal of a predetermined frequency, a frequency divider 32 that further divides the clock signal generated by the frequency divider 31 to generate a 1 Hz clock signal, and a timing data generator 33 that counts the 1 Hz clock signal to generate timing data. The predetermined frequency is, for example, 1 kHz.

[0037] For example, the clock data generating unit 33 includes a counter that counts a 1 Hz clock signal and a conversion circuit that converts the count value of the counter into clock data. The clock data is written to a register (not shown) in the clock data generating unit 33 or to the register 22. When the real-time clock device 200 is first powered on, an initial value of the clock data is written via the interface circuit 60, and starting from the initial value, the clock data is updated every second.

[0038] The clock signal output circuit 90 selects one of a plurality of clock signals based on the oscillation signal, and outputs the selected clock signal as a clock signal FOUT from a terminal TFOUT to the outside of the circuit device 100. The clock signal output circuit 90 is also capable of setting the clock signal FOUT to be inactive.

[0039] The interface circuit 60 performs digital interface communication between an external device and the circuit device 100. For example, the interface circuit 60 is a circuit that performs serial interface communication such as an I2C system or an SPI system. Fig. 2 illustrates a case in which the I2C system is used, and the interface circuit 60 inputs and outputs a serial data signal SDA via a terminal TSDA based on a clock signal SCL input from a terminal TSCL.

[0040] The interrupt control circuit 70 performs control to output an interrupt signal IRQ to an external device via a terminal TIRQ. For example, when the memory control circuit 12 detects the occurrence of an event, the interrupt control circuit 70 activates the interrupt signal IRQ.

[0041] The processing circuit 10, the timer circuit 30, the register 22, the interface circuit 60, the interrupt control circuit 70, and the clock signal output circuit 90 are each composed of a logic circuit such as a gate array.

[0042] The method of this embodiment can be applied to a circuit device 100 and a real-time clock device 200 including an oscillator XTAL, as shown in Fig. 2. The circuit device 100 includes an oscillator circuit 80 that oscillates the oscillator XTAL. The clock circuit 30 performs clocking operation based on an oscillation signal from the oscillator circuit 80. In this way, it is possible to realize a real-time clock device 200 that can suppress overwriting of clocking data.

[0043] 2. First FIFO mode The memory 21 of this embodiment can have a plurality of operation modes. The memory 21 may operate in any one of these modes in a fixed manner. Alternatively, as will be described later with reference to FIG. 16, the memory 21 may be capable of switching between a plurality of operation modes based on register settings or the like.

[0044] FIG. 3 is a diagram showing a configuration example of the circuit device 100 when operating in a first FIFO (First in First out) mode. The circuit device 100 includes a first memory control circuit 12-1, a second memory control circuit 12-2, a first memory area 21-1, a second memory area 21-2, an interface circuit 60, and an interrupt control circuit 70. That is, the memory control circuit 12 includes a first memory control circuit 12-1 and a second memory control circuit 12-2. The first memory area 21-1 and the second memory area 21-2 are set in the memory 21. The interface circuit 60 and the interrupt control circuit 70 are as described above in FIG. 2. Furthermore, the circuit device 100 may include other configurations not shown in FIG. 3 as shown in FIG. 2.

[0045] The circuit device 100 includes a first terminal TEVIN1, a second terminal TEVIN2, a third terminal TEVIN3, a first filter circuit FL1, a second filter circuit FL2, a third filter circuit FL3, a first counter CT1, a second counter CT2, and a third counter CT3. A first event signal EVIN1 corresponding to a first event is input to the first terminal TEVIN1. Similarly, a second event signal EVIN2 corresponding to a second event is input to the second terminal TEVIN2. A third event signal EVIN3 corresponding to a third event is input to the third terminal TEVIN3. The first to third events are external events, such as opening and closing a door or operating a lever. Each event signal is, for example, "0" when the corresponding event does not occur, and becomes "1" when the event occurs.

[0046] The first to third filter circuits FL1 to FL3 are filters for suppressing chattering of the event signal. The first to third filter circuits FL1 to FL3 perform a filter process to output "1" when the corresponding event signal continues to be "1" for a predetermined time or more. The signal after the filter process by the first filter circuit FL1 is output to the first memory control circuit 12-1, the first counter CT1, and the interrupt control circuit 70. The signal after the filter process by the second filter circuit FL2 is output to the second memory control circuit 12-2, the second counter CT2, and the interrupt control circuit 70. The signal after the filter process by the third filter circuit FL3 is output to the second memory control circuit 12-2, the third counter CT3, and the interrupt control circuit 70.

[0047] The first to third counters CT1 to CT3 are counters that count the number of occurrences of the first to third events, respectively. For example, the first counter CT1 is a counter that increments a count value when the output of the first filter circuit FL1 rises from "0" to "1". Similarly, the second counter CT2 and the third counter CT3 count based on the corresponding filter output. The count result of each counter is stored in a register that can be read from the outside via the interface circuit 60. The register here may be the register 22 shown in FIG. 2 or a register not shown. The register not shown is, for example, a register provided inside the interface circuit 60.

[0048] When the interface circuit 60 receives a write signal from an external device to the register 22, it outputs a signal WCT representing a write command trigger to the first memory control circuit 12-1. The write command trigger is one of the events, and WCT is an event signal.

[0049] The interface circuit 60 also receives a read signal for the clock data from an external device. The interface circuit 60 outputs the read signal to the first memory control circuit 12-1 or the second memory control circuit 12-2. The read signal includes a signal for instructing reading from the first memory area 21-1 and a signal for instructing reading from the second memory area 21-2. The interface circuit 60 may determine whether to output the read signal to the first memory control circuit 12-1 or the second memory control circuit 12-2 depending on the content of the read signal. Alternatively, the interface circuit 60 may output the read signal to both the first memory control circuit 12-1 and the second memory control circuit 12-2. In this case, each memory control circuit 12 determines whether to perform reading based on the read signal.

[0050] 4 is a diagram showing a configuration example of the first memory control circuit 12-1. The first memory control circuit 12-1 includes a first mode control circuit MC1, a first write counter WC1, a first read counter RC1, a first full flag determination circuit FF1, and a first empty flag determination circuit EF1. Note that FIG. 4 illustrates a configuration in which the first memory control circuit 12-1 can switch between an operation in a FIFO mode and an operation in a direct mode, as described later with reference to FIG. 16. When switching to the direct mode is not performed, the first mode control circuit MC1 can be omitted.

[0051] The first memory control circuit 12-1 receives a counter upper limit value, an enable signal for direct mode, a write trigger, and a read trigger. The counter upper limit value and the enable signal are set using, for example, a register 22. In FIFO mode, the enable signal is inactive. The write trigger becomes active when EVIN1 or WCT becomes active. The read trigger becomes active based on a read signal from the interface circuit 60.

[0052] The first mode control unit MC1 determines whether to output a write trigger and a read trigger based on the enable signal of the direct mode. In the FIFO mode where the enable signal is inactive, the first mode control unit MC1 outputs the write trigger and the read trigger as is. In the direct mode where the enable signal is active, the first mode control unit MC1 outputs a write trigger and does not output a read trigger. In the first FIFO mode shown in FIG. 3, the first memory control circuit 12-1 operates in the FIFO mode.

[0053] The first write counter WC1 is a counter that increments a count value each time a write trigger is input, provided that a full flag, which will be described later, is "0". The first write counter WC1 also resets the value when the count value exceeds the counter upper limit value. For example, when the counter upper limit value is 31, the first write counter WC1 is a 6-bit counter including 5 bits representing 0 to 31 and an MSB (most significant bit) for rotation. For example, the count value is "000000" as the initial value, and increases by 1 each time a write trigger is input. When the count value is in the state of "011111", which is the upper limit value, and a write trigger is further input, the MSB increases by 1 and the bits other than the MSB are reset to 0. The value of the bits exceeding the MSB is discarded. The first write counter WC1 outputs the bits other than the MSB of the count value as the first write pointer WP1.

[0054] The first read counter RC1 is a counter that increments a count value each time a read trigger is input, provided that an empty flag, which will be described later, is "0". The first read counter RC1 also resets the value when the count value exceeds a counter upper limit value. The counter upper limit value is the same as that of the first write counter WC1. For example, when the counter upper limit value is 31, the first read counter RC1 is a 6-bit counter including 5 bits representing 0 to 31 and an MSB for cyclical use. The first read counter RC1 outputs the part of the count value other than the MSB as the first read pointer RP1.

[0055] The first full flag determination circuit FF1 performs full determination of the first memory area 21-1, which is a FIFO, based on the first write pointer WP1 and the first read pointer RP1. Specifically, the first full flag determination circuit FF1 sets the full flag to "1" when the MSB of the first write pointer WP1 and the MSB of the first read pointer RP1 do not match and the non-MSB of the first write pointer WP1 and the non-MSB of the first read pointer RP1 match, and sets the full flag to "0" otherwise. That is, when the first write pointer WP1 makes an extra rotation and catches up with the first read pointer RP1, the first memory area 21-1 is determined to be entirely filled with unread data.

[0056] The first empty flag determination circuit EF1 performs an empty determination of the first memory area 21-1, which is a FIFO, based on the first write pointer WP1 and the first read pointer RP1. Specifically, the first empty flag determination circuit EF1 sets the empty flag to "1" when the MSB of the first write pointer WP1 and the MSB of the first read pointer RP1 match and the parts other than the MSB of the first write pointer WP1 match the parts other than the MSB of the first read pointer RP1, and sets the empty flag to "0" otherwise. That is, when the first read pointer RP1 catches up with the first write pointer WP1, the first memory area 21-1 determines that all data has been read.

[0057] The first memory control circuit 12-1 performs control to write clock data to the address indicated by the first write pointer WP1 when the first write pointer WP1 is incremented, and also performs control to read clock data from the address indicated by the first read pointer RP1 when the first read pointer RP1 is incremented, and to output the read data to the interface circuit 60.

[0058] 5 is a diagram showing a configuration example of the second memory control circuit 12-2. The second memory control circuit 12-2 includes a second mode control circuit MC2, a second write counter WC2, a second read counter RC2, a second full flag determination circuit FF2, and a second empty flag determination circuit EF2. The second write counter WC2 outputs a second write pointer WP2. The second read counter RC2 outputs a second read pointer RP2. The operation of each part of the second memory control circuit 12-2 is similar to that of the first memory control circuit 12-1. The write trigger in the second memory control circuit 12-2 becomes active when EVIN2 or EVIN3 becomes active.

[0059] FIG. 6 is a schematic diagram for explaining memory control in the first FIFO mode. In the first memory control circuit 12-1, for example, 31 is set as the counter upper limit value. In the first memory area 21-1 of the memory 21, addresses are 0 to 31, and 32-bit data of 0 to 31 is assigned to each address. The first memory control circuit 12-1 specifies an address using a first write pointer WP1 and a first read pointer RP1 that are 0 to 31 inclusive, in accordance with the counter upper limit value 31. The first memory control circuit 12-1 performs control to write data of 32 bits or less, including clock data, to an address specified by the first write pointer WP1. The first memory control circuit 12-1 also performs control to read data of 32 bits or less, including clock data, from an address specified by the first read pointer RP1.

[0060] Similarly, the second memory control circuit 12-2 is set with, for example, 31 as a counter upper limit value. The second memory area 21-2 of the memory 21 has addresses 0 to 31, and 32 bits of data 0 to 31 are assigned to each address. The second memory control circuit 12-2 specifies an address using a second write pointer WP2 and a second read pointer RP2 between 0 and 31 in accordance with the counter upper limit value 31. The second memory control circuit 12-2 performs control to write data of 32 bits or less including clock data to an address specified by the second write pointer WP2. The second memory control circuit 12-2 also performs control to read data of 32 bits or less including clock data from an address specified by the second read pointer RP2.

[0061] Fig. 7 is a diagram for explaining the data structure of the memory 21 in the first FIFO mode. As shown in Fig. 7, the first memory area 21-1 has a storage area of ​​32 rows corresponding to the number of addresses, and each row is 32 bits of data including a Trigger, which is event information, and timing data. The timing data includes Month, Day, Hour, Minute, and Second.

[0062] Trigger is data that identifies the event that triggered the writing of the timing data. In the example shown in Fig. 3, the first memory control circuit 12-1 controls writing to the first memory area 21-1 using two events corresponding to EVIN1 and WCT as triggers. Therefore, Trigger in the first memory area 21-1 is information that can distinguish between two events, for example, 1-bit information. For example, Trigger "0" indicates that the first event corresponding to EVIN1 was the writing trigger, and Trigger "1" indicates that the write command trigger corresponding to WCT was the writing trigger.

[0063] Month, Day, Hour, Minute, and Second are information that specify the month, day, hour, minute, and second, respectively. For example, Month is 5-bit data, Day is 6-bit data, Hour is 6-bit data, Minute is 7-bit data, and Second is 7-bit data. In this case, the clock data is 31-bit data.

[0064] 7, the second memory area 21-2 has a storage area of ​​32 rows corresponding to the number of addresses, and each row is 32 bits of data including a trigger, which is event information, and timing data. The timing data includes month, day, hour, minute, and second.

[0065] Trigger is data that specifies the event that triggered the writing of the timing data. In the example shown in Fig. 3, the second memory control circuit 12-2 controls writing to the second memory area 21-2 using two events corresponding to EVIN2 and EVIN3 as triggers. For example, Trigger is 1-bit data, and Trigger "0" indicates that the second event corresponding to EVIN2 was the writing trigger, and Trigger "1" indicates that the third event corresponding to EVIN3 was the writing trigger. The timing data is the same as that of the first memory area 21-1.

[0066] As described above, the memory control circuit 12 of this embodiment writes timing data and event information identifying the first event to the first memory area 21-1 when the first event signal EVIN1 is detected, and writes timing data and event information identifying the second event to the second memory area 21-2 when the second event signal EVIN2 is detected.

[0067] More specifically, in the first FIFO mode, the first memory control circuit 12-1 performs control to write 32-bit data including clock data to the first memory area 21-1, triggered by the rising edge of EVIN1 or WCT. Also, in the first FIFO mode, the second memory control circuit 12-2 performs control to write 32-bit data including clock data to the second memory area 21-2, triggered by the rising edge of EVIN2 or EVIN3.

[0068] In the method of this embodiment, it is possible to separate the memory areas into which the timing data for the first and second events are written. Therefore, even if a large number of either the first or second events occur in a short period of time, the effect on the timing data for the other event can be suppressed. Since loss of timing data due to overwriting, etc. is suppressed, it becomes possible to appropriately identify the cause of an error, for example.

[0069] In this case, the memory control circuit 12 of this embodiment may be provided with a first memory control circuit 12-1 for the first memory area 21-1 and a second memory control circuit 12-2 for the second memory area 21-2, which are independent of each other. In this way, even if multiple events occur simultaneously, it is not necessary to write the timing data multiple times with different timings, which makes it possible to simplify the processing or the circuit configuration.

[0070] In the configuration of Fig. 3, either the first event corresponding to EVIN1 or the write command trigger corresponding to WCT is allowed to affect the other. Also, either the second event corresponding to EVIN2 or the third event corresponding to EVIN3 is allowed to affect the other.

[0071] Furthermore, when the first event signal EVIN1 is detected, the memory control circuit 12 writes timing data into the first memory area 21-1 while circulating the first write pointer WP1. When the second event signal EVIN2 is detected, the memory control circuit 12 writes timing data into the second memory area 21-2 while circulating the second write pointer WP2. In this manner, it becomes possible to write data including timing data into the memory 21 using the circulating write pointer.

[0072] More specifically, the memory control circuit 12 performs memory control with the first memory area 21-1 as the first FIFO area by reading the timing data written in the first memory area 21-1 while circulating the first read pointer RP1. The memory control circuit 12 performs memory control with the second memory area 21-2 as the second FIFO area by reading the timing data written in the second memory area 21-2 while circulating the second read pointer RP2.

[0073] In this way, it becomes possible to write and read timing data corresponding to multiple events using the first memory area 21-1 and the second memory area 21-2, which are FIFOs. Since the FIFO prevents overlapping of write addresses and read addresses, it is possible to write and read simultaneously. For example, it is possible to control the reading of data while waiting for an event signal.

[0074] 3, the circuit device 100 includes a first terminal TEVIN1 to which the first event signal EVIN1 is input, a second terminal TEVIN2 to which the second event signal EVIN2 is input, a first filter circuit FL1 that performs a first filter process on the first event signal EVIN1, and a second filter circuit FL2 that performs a second filter process on the second event signal EVIN2. The first event signal EVIN1 after the first filter process and the second event signal EVIN2 after the second filter process are input to the memory control circuit 12.

[0075] In this way, it becomes possible to write the timekeeping data based on the event signal inputted using the terminal. More specifically, the event signal here is a signal representing an external event. At that time, for example, chattering can be suppressed by performing filter processing. In the case of opening and closing the door described above, even if the event signal frequently changes between "0" and "1" due to the vibration of the door, it is possible to suppress the detection of a large number of corresponding events. For example, the first filter processing and the second filter processing are processing that outputs "1" when the event signal is "1" for a predetermined time or more, and outputs "0" otherwise. The predetermined time here is, for example, a time of about several seconds, but the specific length can be variously modified. In the method of this embodiment, while suppressing the continuous detection of events using the first filter circuit FL1 and the second filter circuit FL2, it is possible to suppress the occurrence of a given event from affecting the timekeeping data of other events by further dividing the memory 21 into a plurality of memory areas.

[0076] The circuit device 100 also includes a first counter CT1 that counts the number of times a first event occurs based on the first event signal EVIN1, and a second counter CT2 that counts the number of times a second event occurs based on the second event signal EVIN2. The number of times a first event occurs indicates the number of times a first event occurs. The number of times a second event occurs indicates the number of times a second event occurs. In this way, it becomes possible to count the number of times an event occurs. For example, it is possible to grasp the occurrence status of a specific event without tallying up multiple pieces of time-series data acquired. Furthermore, even if time-series data related to a specific event is missing, it is possible to confirm the number of times the event occurs.

[0077] The circuit device 100 also includes a first register that stores the number of times a first event has occurred and a second register that stores the number of times a second event has occurred. The first register and the second register may be included in the register 22 or may be included in the interface circuit 60. In this way, the number of times each event has occurred counted by the first counter CT1 and the second counter CT2 can be appropriately stored, and the number of times the event has occurred can be read out from outside the circuit device 100.

[0078] 3. Direct Mode FIG. 8 is a diagram showing a configuration example of the circuit device 100 when operating in the direct mode. The circuit device 100 includes a first memory control circuit 12-1, a second memory control circuit 12-2, a third memory control circuit 12-3, a first memory area 21-1, a second memory area 21-2, a third memory area 21-3, an interface circuit 60, and an interrupt control circuit 70. That is, the memory control circuit 12 includes a first memory control circuit 12-1, a second memory control circuit 12-2, and a third memory control circuit 12-3. The first memory area 21-1, the second memory area 21-2, and the third memory area 21-3 are set in the memory 21. The interface circuit 60 and the interrupt control circuit 70 are as described above in FIG. 2. Furthermore, the circuit device 100 may include other configurations not shown in FIG. 8 as shown in FIG. 2.

[0079] As described above, the events in this embodiment may include internal events, such as an abnormality occurrence event of the main power supply voltage VDD corresponding to the output signal VDET, an abnormality occurrence event of the voltage VOUT corresponding to VLOW, an abnormality occurrence event of the backup power supply voltage VBAT corresponding to VBLF, and an abnormality occurrence event of the oscillation signal corresponding to FST.

[0080] EVIN1 and WCT are input to the first memory control circuit 12-1. EVIN2 is input to the second memory control circuit 12-2. EVIN3 and the detection results of internal events are input to the third memory control circuit 12-3. The detection results are specifically VDET, VLOW, VBLF, and FST.

[0081] Also in the direct mode, the circuit device 100 similarly has a first terminal TEVIN1, a second terminal TEVIN2, a third terminal TEVIN3, a first filter circuit FL1, a second filter circuit FL2, a third filter circuit FL3, a first counter CT1, a second counter CT2, and a third counter CT3.

[0082] When the interface circuit 60 receives a write signal to the register 22 from an external system, it outputs an event signal WCT corresponding to a write command trigger to the first memory control circuit 12-1. The interface circuit 60 also receives a read signal that instructs reading of clock data from the memory 21. In the direct mode, the interface circuit 60 receives a read signal that specifies a read address, and reads the data at that address from the memory 21.

[0083] The configuration of the first memory control circuit 12-1 is the same as that shown in FIG. 3. However, in the direct mode, the direct mode enable signal is active. Therefore, the first mode control unit MC1 does not output a read trigger. Also, in the direct mode, the first read counter RC1 does not operate and does not output the first read pointer RP1.

[0084] The operation of the first write counter WC1 of the first memory control circuit 12-1 is the same as in the FIFO mode, except that the counter upper limit value may be changed. The second write counter WC2 is a counter that increments the count value every time a write trigger is input, and resets the value when the count value exceeds the counter upper limit value.

[0085] The first full flag determination circuit FF1 performs a full determination of the first memory area 21-1 based on the first write pointer WP1. For example, the first full flag determination circuit FF1 performs a comparison process between the first write pointer WP1 when the last read from the first memory area 21-1 was performed and the current first write pointer WP1. If the MSBs do not match and the other parts match, the first full flag determination circuit FF1 sets the full flag to "1", and otherwise sets the full flag to "0".

[0086] The first empty flag determination circuit EF1 performs an empty determination of the first memory area 21-1 based on the first write pointer WP1. For example, the first empty flag determination circuit EF1 performs a comparison process between the first write pointer WP1 when the last read from the first memory area 21-1 was performed and the current first write pointer WP1. If the MSBs match and other than the MSBs match, the first empty flag determination circuit EF1 sets the empty flag to "1", and otherwise sets the empty flag to "0".

[0087] In the direct mode, at least one of the first full flag determination circuit FF1 and the first empty flag determination circuit EF1 may be omitted. Furthermore, the processing in the first full flag determination circuit FF1 and the first empty flag determination circuit EF1 is not limited to the above, and various modifications are possible.

[0088] The second memory control circuit 12-2 is similar to the first memory control circuit 12-1. That is, the configuration of the second memory control circuit 12-2 is similar to that of FIG. 5, but the enable signal of the direct mode becomes active. Therefore, the second mode control circuit MC2 does not output a read trigger. Also, in the direct mode, the second read counter RC2 does not operate and does not output the second read pointer RP2. The operation of the second full flag determination circuit FF2 and the second empty flag determination circuit EF2 is similar to that of the first full flag determination circuit FF1 and the first empty flag determination circuit EF1 of the first memory control circuit 12-1.

[0089] 9 is a diagram showing a configuration example of the third memory control circuit 12-3 for the direct mode. The third memory control circuit 12-3 includes a third write counter WC3, a third full flag determination circuit FF3, and a third empty flag determination circuit EF3. In other words, the third memory control circuit 12-3 is a circuit in which the configuration related to the cyclic readout is omitted from the first memory control circuit 12-1.

[0090] A counter upper limit value and a write trigger are input to the third memory control circuit 12-3. The counter upper limit value is set by using the register 22, for example.

[0091] The third write counter WC3 is a counter that increments the count value each time a write trigger is input. The third write counter WC3 also resets the value when the count value exceeds the counter upper limit value. For example, when the counter upper limit value is 10, the third write counter WC3 is a 5-bit counter including 4 bits that can express 0 to 9 and an MSB for rotation. For example, the count value is initialized to 0 and increases by 1 with the input of a write trigger. When a write trigger is further input after the count value is at the upper limit value, the MSB increases by 1 and bits other than the MSB are reset to 0. The value of the bits exceeding the MSB are discarded. The third write counter WC3 outputs bits other than the MSB of the count value as the third write pointer WP3.

[0092] The third full flag determination circuit FF3 performs full determination for the third memory area 21-3 based on the third write pointer WP3. The operation of the third full flag determination circuit FF3 is similar to the operation of the first full flag determination circuit FF1 in the direct mode.

[0093] The third empty flag determination circuit EF3 performs an empty determination for the third memory area 21-3 based on the third write pointer WP3. The operation of the third empty flag determination circuit EF3 is similar to the operation of the first empty flag determination circuit EF1 in the direct mode.

[0094] In this way, it becomes possible to perform circular writing using a write pointer for each of the first memory area 21-1, the second memory area 21-2, and the third memory area 21-3, and to control the reading of timing data from any address using the interface circuit 60.

[0095] 10 is a schematic diagram illustrating memory control in direct mode. In the first memory control circuit 12-1, for example, 9 is set as a counter upper limit value. In the first memory area 21-1 of the memory 21, addresses are 0 to 9, and 64-bit data from 0 to 63 is assigned to each address. The first memory control circuit 12-1 specifies an address using a first write pointer WP1 between 0 and 9 in accordance with the counter upper limit value 9. The first memory control circuit 12-1 performs control to write data of 64 bits or less, including clock data, to an address specified by the first write pointer WP1.

[0096] In the second memory control circuit 12-2, for example, 11 is set as a counter upper limit value. The second memory area 21-2 of the memory 21 has addresses 10 to 21, and 64-bit data from 0 to 63 is assigned to each address. The second memory control circuit 12-2 specifies an address using a second write pointer WP2 that is between 0 and 11 in accordance with the counter upper limit value 11. For example, the specified address is a value obtained by adding 10 to the value of the second write pointer WP2. Here, 10 is obtained by adding 1 to the counter upper limit value of the first memory control circuit 12-1. The second memory control circuit 12-2 performs control to write data of 64 bits or less, including clock data, to the specified address.

[0097] In the third memory control circuit 12-3, for example, 9 is set as a counter upper limit value. The third memory area 21-3 of the memory 21 has addresses 22 to 31, and 64-bit data from 0 to 63 is assigned to each address. The third memory control circuit 12-3 specifies an address using a third write pointer WP3 between 0 and 9 in accordance with the counter upper limit value 9. For example, the specified address is a value obtained by adding 22 to the value of the third write pointer WP3. Here, 22 is calculated as the sum of a value obtained by adding 1 to the counter upper limit value of the first memory control circuit 12-1 and a value obtained by adding 1 to the counter upper limit value of the second memory control circuit 12-2. The third memory control circuit 12-3 performs control to write data of 64 bits or less including clock data to the specified address.

[0098] Fig. 11 is a diagram for explaining the data structure of the memory 21 in the direct mode. As shown in Fig. 11, the first memory area 21-1 has a storage area of ​​10 rows corresponding to the number of addresses, and each row is 64-bit data including Flag and Trigger, which are event information, and timing data. The timing data includes Year, Month, Day, Hour, Minute, Second, Subsec1, and Subsec2.

[0099] Trigger is data that specifies the event that triggered the writing of the timing data. Here, eight events, including external and internal events, are considered, so Trigger is, for example, 8-bit data. Each bit corresponds to one event. When a given bit of Trigger is 1, it indicates that the occurrence of the corresponding event triggered the writing of the data in that row. Note that here it is also assumed that multiple events occur simultaneously. In other words, it is permitted for multiple bits of the 8-bit data representing Trigger to be 1.

[0100] Flag is information that indicates the internal state of the circuit device 100 when a trigger occurs. Specifically, Flag is 4-bit data corresponding to (FST, VLOW, VBLF, VDET). As described above, Trigger is information that specifies the event that triggered data writing, and in a narrow sense, is information that specifies which event signal transitioned from "0" to "1". Therefore, for example, just because the bit of Trigger corresponding to VDET is "0", it is not possible to distinguish whether VDET is maintaining "0" or "1". The former indicates that there is no abnormality in VDD, and the latter indicates that the drop in VDD continues, so the meanings are significantly different. By storing Flag as event information, it becomes possible to store the internal state in an easy-to-understand manner.

[0101] 12 is a diagram illustrating the relationship between the flag information Flag and the state of the circuit device 100. Note that "*" indicates don't care. For example, when (FST, VLOW, VBLF, VDET)=(0,0,0,0), no internal event has occurred, and therefore the circuit device 100 is operating normally with the main power supply voltage VDD. When (FST, VLOW, VBLF, VDET)=(0,0,0,1), the main power supply voltage VDD is not being supplied, but the backup power supply voltage VBAT is normal, and therefore the circuit device 100 is operating normally with the backup power supply voltage VBAT.

[0102] When (FST, VLOW, VBLF, VDET) = (0, *, 1, 1), the main power supply voltage VDD is not being supplied and a drop in the backup power supply voltage VBAT is detected. In this case, the malfunction can be assumed to be due to noise in the backup power supply voltage VBAT or a drop in the backup power supply voltage VBAT due to static electricity, etc.

[0103] When (FST, VLOW, VBLF, VDET) = (0, 1, 0, 0), a drop in the voltage VOUT is detected even though the main power supply voltage VDD and backup power supply voltage VBAT are normal. In this case, the malfunction can be assumed to be due to noise in the voltage VOUT or a drop in the voltage VOUT caused by static electricity, etc.

[0104] When (FST, VLOW, VBLF, VDET)=(1, 0, 0, *), the oscillation stop is detected even though the voltage VOUT is normal. In this case, the malfunction can be assumed to be the oscillation stop of the oscillation circuit 80 due to a mounting defect of the resonator XTAL or a failure of the oscillation circuit 80.

[0105] When (FST, VLOW, VBLF, VDET) = (1, 1, 0, 0), even though the main power supply voltage VDD and backup power supply voltage VBAT are normal, a drop in the voltage VOUT is detected, and furthermore, oscillation stop is detected. In this case, the malfunction can be assumed to be a mounting defect of the terminal TVOUT or the capacitance connected to the terminal TVOUT, or a fault in the transition from the main power supply voltage VDD to the backup power supply voltage VBAT. The capacitance here is, for example, a smoothing capacitance or a pass capacitor for the voltage VOUT.

[0106] When (FST, VLOW, VBLF, VDET) = (1, 0, 1, 0), a drop in the backup power supply voltage VBAT is detected, and furthermore, oscillation stop is detected. In this case, it can be assumed that the backup power supply voltage VBAT was not supplied normally during backup operation, so the possible malfunctions are that the backup power supply is not inserted or that the backup power supply has a poor contact.

[0107] When (FST, VLOW, VBLF, VDET)=(1,1,1,1), all abnormalities have been detected. In this case, it is possible to assume that the malfunction is due to a power-on reset of the circuit device 100 caused by noise in the main power supply voltage VDD, a fault in the backup power supply such as a dead battery, or a contact failure in the backup power supply.

[0108] Returning to Fig. 11, we continue the explanation. Month, Day, Hour, Minute, and Second are the same as in Fig. 7, and are information specifying the month, day, hour, minute, and second, respectively. Year is information that represents the year, for example, 8-bit data. Subsec1 and Subsec2 are information that represents a time shorter than one second, for example, representing the time in units of 1 / 1024 seconds. For example, Subsec1 is 8-bit data, and Subsec2 is 2-bit data.

[0109] 11, the second memory area 21-2 has 12 rows of storage areas corresponding to the number of addresses, and each row is 64-bit data including flags and triggers as event information, and timing data. The data format of each row is the same as that of the first memory area 21-1. The third memory area 21-3 has 10 rows of storage areas corresponding to the number of addresses, and each row is 64-bit data including flags and triggers as event information, and timing data. The data format of each row is the same as that of the first memory area 21-1.

[0110] According to the method of this embodiment, timing data based on EVIN1 is written to the first memory area 21-1. Timing data based on EVIN2 is written to the second memory area 21-2. Timing data based on EVIN3 is written to the third memory area 21-3. Since the three external events are managed using different memory areas, it is possible to prevent the occurrence of a given event from affecting the timing data of the other two events. If there are four or more types of external events input using the terminal TEVIN, four or more memory areas may be set in the memory 21.

[0111] As described above, the interface circuit 60 in the direct mode accepts a read request that specifies an address. When the interface circuit 60 accepts a read request for an address in the first memory area 21-1, it reads out the clock data written to that address in the first memory area 21-1. When the interface circuit 60 accepts a read request for an address in the second memory area 21-2, it reads out the clock data written to that address in the second memory area 21-2. In this way, it becomes possible to directly read out the clock data by specifying an address.

[0112] Although the method for storing information related to internal events in the direct mode has been described above, there is no prohibition on storing information related to internal events in the first FIFO mode described above.

[0113] 4. Second FIFO mode FIG. 13 is a diagram showing a configuration example of the circuit device 100 when operating in the second FIFO mode. The circuit device 100 includes a first memory control circuit 12-1, an interface circuit 60, and an interrupt control circuit 70. The memory control circuit 12 is realized by, for example, the first memory control circuit 12-1, which is one memory control circuit 12. The memory 21 is not divided into a plurality of memory regions. In other words, the memory 21 is controlled as one memory region by combining the first memory region 21-1 and the second memory region 21-2. Furthermore, the circuit device 100 may include other configurations not shown in FIG. 13, as shown in FIG. 2.

[0114] EVIN1, EVIN2, EVIN3, WCT, FST, VLOW, VBLF, and VDET are input to the first memory control circuit 12-1. When at least one event signal is detected, the first memory control circuit 12-1 performs control to write the timing data to the memory 21. That is, in the second FIFO mode, all events are written to a single memory area.

[0115] The configuration of the first memory control circuit 12-1 is the same as that in Fig. 4. The operation of the first memory control circuit 12-1 is the same as that in the first FIFO mode. That is, the enable signal in the direct mode is inactive, and the first read counter RC1 outputs the first read pointer RP1 based on the read flag.

[0116] FIG. 14 is a schematic diagram for explaining memory control in the second FIFO mode. For example, 31 is set as the counter upper limit value in the first memory control circuit 12-1. The memory 21 has addresses 0 to 31, and 64-bit data 0 to 63 is assigned to each address. The first memory control circuit 12-1 specifies an address using a first write pointer WP1 and a first read pointer RP1 that are 0 to 31 inclusive, in accordance with the counter upper limit value 31. The first memory control circuit 12-1 performs control to write data of 64 bits or less, including clock data, to an address specified by the first write pointer WP1. The first memory control circuit 12-1 also performs control to read data of 64 bits or less, including clock data, from an address specified by the first read pointer RP1.

[0117] Fig. 15 is a diagram for explaining the data structure of the memory 21 in the first FIFO mode. As shown in Fig. 15, the memory 21 has a storage area of ​​32 rows corresponding to the number of addresses, and each row is 64-bit data including Flag and Trigger, which are event information, and timing data. The timing data includes Year, Month, Day, Hour, Minute, Second, Subsec1, and Subsec2. In other words, the data structure per row is the same as in the direct mode.

[0118] As described above, in the first FIFO mode, it is possible to use the memory 21 as one FIFO.

[0119] 5. Mode switching The first FIFO mode, second FIFO mode, and direct mode have been described above as operation modes of the circuit device 100. The memory 21 in each mode is, for example, a memory of 64 bits x 32 sets. In the above example, in the first FIFO mode, the memory 21 is used as two memory areas of 32 bits x 32 sets. In the second FIFO mode, the memory 21 is used as one memory area of ​​32 bits x 64 sets. In the direct mode, it is used as three memory areas of 10 sets of 64 bits, 12 sets of 64 bits, and 10 sets of 64 bits.

[0120] These modes may be fixed for each circuit device 100. For example, a given circuit device 100 is fixed to operate in the first FIFO mode, and is not allowed to operate in the second FIFO mode or the direct mode.

[0121] However, the method of this embodiment is not limited to this, and the operation mode of the circuit device 100 may be switchable. For example, the circuit device 100 according to this embodiment includes the first memory control circuit 12-1, the second memory control circuit 12-2, and the third memory control circuit 12-3 described above. The first memory control circuit 12-1 can be switched between operating in FIFO mode and operating in direct mode. The second memory control circuit 12-2 can be switched between operating in FIFO mode, operating in direct mode, and not operating. The third memory control circuit 12-3 can be switched between operating and not operating. As described above, the operation of the third memory control circuit 12-3 corresponds to the direct mode of the first memory control circuit 12-1. In addition, the counter upper limit value supplied to each memory control circuit 12 is configured to be switchable according to the operation mode. For example, the operation of each memory control circuit 12 and the counter upper limit value can be set using a setting value of a register.

[0122] 16 is a diagram for explaining the operation of the first memory control circuit 12-1, the second memory control circuit 12-2, and the third memory control circuit 12-3 in each of the first FIFO mode, the second FIFO mode, and the direct mode. In FIG. 16, "◯" indicates that the corresponding memory control circuit 12 is operating, and "-" indicates that the corresponding memory control circuit 12 is not operating.

[0123] In the first FIFO mode, the first memory control circuit 12-1 operates in the FIFO mode, the second memory control circuit 12-2 operates in the FIFO mode, and the third memory control circuit 12-3 does not operate. The counter upper limit value of the first memory control circuit 12-1 is, for example, 31, and the counter upper limit value of the second memory control circuit 12-2 is, for example, 31. This makes it possible to realize the configurations shown in Figures 3 and 6.

[0124] In the second FIFO mode, the first memory control circuit 12-1 operates in the FIFO mode, the second memory control circuit 12-2 does not operate, and the third memory control circuit 12-3 does not operate. The counter upper limit value of the first memory control circuit 12-1 is, for example, 31. This makes it possible to realize the configurations shown in Figures 13 and 14.

[0125] In the direct mode, the first memory control circuit 12-1 operates in the direct mode, the second memory control circuit 12-2 operates in the direct mode, and the third memory control circuit 12-3 operates in the direct mode. The counter upper limit value of the first memory control circuit 12-1 is, for example, 9, the counter upper limit value of the second memory control circuit 12-2 is, for example, 11, and the counter upper limit value of the third memory control circuit 12-3 is, for example, 9. This makes it possible to realize the configurations shown in Figures 8 and 10.

[0126] For example, when the circuit device 100 is set to the FIFO mode, the memory control circuit 12 performs memory control with the first memory area 21-1 as the first FIFO area by reading the clock data written in the first memory area 21-1 while circulating the first read pointer RP1. The memory control circuit 12 performs memory control with the second memory area 21-2 as the second FIFO area by reading the clock data written in the second memory area 21-2 while circulating the second read pointer RP2. The FIFO mode here is specifically the first FIFO mode.

[0127] Furthermore, when the circuit device 100 is set to direct mode, the interface circuit 60 reads out the timing data written to the address in the first memory area 21-1 based on a read request specifying an address in the first memory area 21-1, and reads out the timing data written to the address in the second memory area 21-2 based on a read request specifying an address in the second memory area 21-2.

[0128] In this way, it is possible to switch between the first FIFO mode and the direct mode. In this case, by making the first memory control circuit 12-1 and the second memory control circuit 12-2 compatible with both modes as described above, it is possible to realize mode switching using an efficient configuration. For example, in the above example, two memory control circuits 12 are used in the first FIFO mode and three memory control circuits 12 are used in the direct mode, but there is no need to separately provide five memory control circuits 12, and the first memory control circuit 12-1, the second memory control circuit 12-2, and the third memory control circuit 12-3 can support two modes.

[0129] Alternatively, when the circuit device 100 is set to the first FIFO mode, the memory 21 is set to a first memory area 21-1 corresponding to a first event and a second memory area 21-2 corresponding to a second event. The memory control circuit 12 performs control to write timing data to the first memory area 21-1 of the memory 21 when a first event signal EVIN1 corresponding to the first event is detected, and to write timing data to the second memory area 21-2 of the memory 21 when a second event signal EVIN2 corresponding to the second event is detected.

[0130] Furthermore, when the circuit device 100 is set to the second FIFO mode, the first memory area 21-1 and the second memory area 21-2 are set as a single memory area in the memory 21. The memory control circuit 12 performs control to write timing data into the memory area of ​​the memory 21 when the first event signal EVIN1 is detected, and to write timing data into the same memory area of ​​the memory 21 when the second event signal EVIN2 is detected.

[0131] In this way, it is possible to switch between the first FIFO mode and the second FIFO mode. For example, if the memory 21 is a memory of 64 bits x 32 sets, the memory 21 may be used as one FIFO of 64 bits x 32 sets, or may be used as two FIFOs of 32 bits x 32 sets.

[0132] In addition, the mode switching is not limited to switching between the first FIFO mode and the direct mode, or between the first FIFO mode and the second FIFO mode, but may be switching between the second FIFO mode and the direct mode. In addition, other modes having different settings of memory areas or different configurations of the memory control circuit 12 may be added.

[0133] The memory 21 of this embodiment is a 64-bit x 32-set memory as described above, and is realized by combining, for example, two 32-bit x 32-set memories. The second FIFO mode is realized by making the write pointer and read pointer common to the two memories. The first FIFO mode is realized by using the two memories independently.

[0134] Furthermore, when the memory 21 is composed of two memories like this, it is not easy to realize division into x1 bit x 32 sets, x2 bit x 32 sets, and x3 bit x 32 sets when setting three memory areas as in the direct mode. Here, x1, x2, and x3 are integers that satisfy x1+x2+x3=64. Therefore, in the above direct mode, 64 bits is fixed, and the number of sets is divided into three: 10, 12, and 10.

[0135] However, the number of bits and the number of sets of the memory 21 are arbitrary, and it is also arbitrary to combine memories of what size and how many to realize the memory 21. Therefore, the setting of the memory area described above using Figures 7, 11, 15, etc. is one example of the method of this embodiment, and the specific configuration of the memory 21 and the memory area can be modified in various ways.

[0136] 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 embodiment. 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. All combinations of the present embodiment and modifications are also included in the scope of the present disclosure. Furthermore, the configurations and operations of the circuit device, real-time clock device, etc. are not limited to those described in the present embodiment, and various modifications are possible. [Explanation of symbols]

[0137] CT1...first counter, CT2...second counter, CT3...third counter, FL1...first filter circuit, FL2...second filter circuit, FL3...third filter circuit, WC1...first light counter, WC2...second light counter, WC3...third light counter, WP1...first light pointer, WP2...second light pointer, WP3...third light pointer, RC1...first read counter, RC2...second read counter, RP1...first read pointer, RP2...second read pointer FET, EF1...first empty flag determination circuit, EF2...second empty flag determination circuit, EF3...third empty flag determination circuit, FF1...first full flag determination circuit, FF2...second full flag determination circuit, FF3...third full flag determination circuit, MC1...first mode control unit, MC2...second mode control unit, TEVIN, TEVIN1, TEVIN2, TEVIN3, TFOUT, TIRQ, TSCL, TSDA, TVBAT, TVDD, TVOUT, XI, XO...terminals, VDD...main power supply voltage, VBAT... Backup power supply voltage, VOUT... voltage, FOUT... clock signal, SCL... clock signal, SDA... serial data signal, FST, VLOW, VBLF, VDET... output signal, EVIN1... first event signal, EVIN2... second event signal, EVIN3... third event signal, WCT... event signal, XTAL... oscillator, 10... processing circuit, 11... control unit, 12... memory control circuit, 12-1... first memory control circuit, 12-2... second memory control circuit, 12-3... third memory control circuit, 20... memory unit, 21...memory, 21-1...first memory area, 21-2...second memory area, 21-3...third memory area, 22...register, 30...timekeeping circuit, 31, 32...frequency divider, 33...timekeeping data generation unit, 41...main power supply voltage detection unit, 42...backup power supply voltage detection unit, 43...power supply control unit output voltage detection unit, 44...oscillation signal detection unit, 50...power supply control circuit, 60...interface circuit, 70...control circuit, 80...oscillation circuit, 90...clock signal output circuit, 100...circuit device, 200...real-time clock device

Claims

1. a timing circuit for generating timing data; A memory having a plurality of memory regions; a memory control circuit for writing the timekeeping data into the memory; an interface circuit for accepting a read request specifying an address; Including, The memory includes: A first memory area corresponding to a first event and a second memory area corresponding to a second event. The area is set, The memory control circuit includes: When a first event signal corresponding to the first event is detected, The time measurement data is written into the first memory area, and a second event corresponding to the second event is stored. When an event signal is detected, the timing data is stored in the second memory area of ​​the memory. Write control, (1) When set to FIFO (First In First Out) mode, The memory control circuit includes: The clock written to the first memory area while rotating the first read pointer. A memory in which the first memory area is a first FIFO area by reading data. - Control, The clock written to the second memory area while rotating a second read pointer. A memory in which the second memory area is a second FIFO area by reading data. - Control, (2) When set to direct mode, The interface circuit includes: Based on the read request specifying the address of the first memory area, reading the timekeeping data written at the address in one memory area; Based on the read request specifying the address of the second memory area, 2. Reading the timing data written at the address in the memory area; A circuit device comprising:

2. 2. The circuit device according to claim 1, The memory control circuit includes: When the first event signal is detected, the timing data and the first event are identified. writing event information to the first memory area; When the second event signal is detected, the timing data and the second event are identified. and writing the event information to the second memory area.

3. 3. The circuit device according to claim 1, The memory control circuit includes: When the first event signal is detected, the first light pointer is rotated to the front. writing the timing data into the first memory area; When the second event signal is detected, the second light pointer is rotated to the previous position. A circuit device, characterized in that the clock data is written to the second memory area.

4. 4. The circuit device according to claim 1, a first terminal to which the first event signal is input; a second terminal to which the second event signal is input; a first filter circuit for performing a first filtering process on the first event signal; a second filter circuit for performing a second filtering process on the second event signal; Including, The memory control circuit includes a first event signal after the first filtering process and a and the second event signal after the second filter processing. Place.

5. 4. The circuit device according to claim 1, a first terminal to which the first event signal is input; a second terminal to which the second event signal is input; a first counter for counting the number of occurrences of a first event based on the first event signal; And, a second counter that counts the number of occurrences of the second event based on the second event signal; And, A circuit device comprising:

6. 6. The circuit device according to claim 5, a first register for storing the number of occurrences of the first event; a second register for storing the second event occurrence count; A circuit device comprising:

7. a timing circuit for generating timing data; A memory having a plurality of memory regions; a memory control circuit for writing the timekeeping data into the memory; Including, (1) When the first FIFO (First In First Out) mode is set, The memory includes: A first memory area corresponding to a first event and a second memory area corresponding to a second event. The area is set, The memory control circuit includes: When a first event signal corresponding to the first event is detected, The time measurement data is written into the first memory area, and a second event corresponding to the second event is stored. When an event signal is detected, the timing data is stored in the second memory area of ​​the memory. Write control, (2) When the second FIFO mode is set, The memory includes: The first memory area and the second memory area are set as one memory area, The memory control circuit includes: When the first event signal is detected, the memory area of ​​the memory stores the and writing time data to the memory when the second event signal is detected. a circuit device for controlling writing of said timing data into a memory area.

8. A circuit arrangement according to any one of claims 1 to 7; A vibrator; Including, The circuit device comprises: an oscillator circuit for oscillating the oscillator; The timing circuit includes: A real-time clock that performs a timekeeping operation based on an oscillation signal of the oscillation circuit. Lock device.

Citation Information

Patent Citations

  • Trip sequence memory unit

    JP1978041958A

  • Real time clock for electrical equipment

    JP2003132470A

  • History recording device and electric equipment

    JP2008287423A

  • Processor

    JP2009009185A

  • Circuit device, real-time clocking device, electronic apparatus, and vehicle

    JP2018116588A