Temperature detection circuit, chip and computer device

By integrating a temperature detection circuit inside the chip, hardware processing and decision-making of temperature data are achieved, solving the problems of limited real-time performance and performance loss in existing technologies, and improving the energy efficiency of the system.

CN122149683APending Publication Date: 2026-06-05BEIJING ESWIN COMPUTING TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ESWIN COMPUTING TECH CO LTD
Filing Date
2026-03-09
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing temperature sensor analog IP cores only have basic temperature sensing and signal acquisition functions. All temperature data processing and decision-making must be completed by the main control unit through software algorithms, resulting in limited real-time performance and additional performance loss and power consumption.

Method used

By integrating temperature detection circuitry, including register circuitry, control circuitry, and temperature sensors, into the chip, hardware processing and decision-making of temperature data are achieved. The entire process is completed by hardware logic, reducing data latency and eliminating unnecessary power consumption caused by software polling.

Benefits of technology

It effectively shortens data latency, eliminates unnecessary energy consumption caused by software polling, and improves the overall energy efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122149683A_ABST
    Figure CN122149683A_ABST
Patent Text Reader

Abstract

The application discloses a temperature detection circuit, a chip and a computer device, and belongs to the technical field of semiconductors. The temperature detection circuit comprises a register circuit, a control circuit and a temperature sensor; the register circuit is used for receiving configuration information, and the configuration information is used for configuring a temperature sampling mode; the control circuit is used for controlling the temperature sensor according to the temperature sampling mode; the temperature sensor is used for collecting temperature and outputting the collected temperature; and the control circuit is further used for processing the temperature collected by the temperature sensor. The application realizes the processing and decision of temperature data through a hardware circuit, the whole path is realized by hardware logic, not only the data delay is effectively shortened, but also the invalid energy consumption generated by software polling is eliminated, so that the overall energy efficiency of the system is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of semiconductor technology, and in particular to a temperature detection circuit, chip, and computer device. Background Technology

[0002] As semiconductor technology continues to advance and transistor sizes shrink, chip power density increases significantly, and thermal management becomes increasingly complex. Against this backdrop, integrating temperature sensors (T-sensors) into the chip has become a crucial step in optimizing system performance and power consumption, and improving chip reliability and security.

[0003] To achieve precise thermal management, integrating temperature sensor analog intellectual property (IP) cores into chip designs has become a mainstream technical solution. However, existing temperature sensor analog IP cores typically only possess temperature sensing and signal acquisition functions; all temperature data processing and decision-making must be completed by the main control unit through software algorithms. This software-based post-processing approach not only has limited real-time performance, but its continuously running temperature monitoring task also consumes a significant amount of central processing unit (CPU) resources, leading to additional performance degradation and power consumption. Summary of the Invention

[0004] This application provides a temperature detection circuit, chip, and computer device. The processing and decision-making of temperature data are achieved through hardware circuitry. The entire path is implemented by hardware logic, which not only effectively shortens data latency but also eliminates the unnecessary energy consumption caused by software polling, thus effectively improving the overall energy efficiency of the system. The technical solution is as follows: In a first aspect, a temperature detection circuit is provided, the temperature detection circuit including a register circuit, a control circuit and a temperature sensor; The register circuit is used to receive configuration information, which is used to configure the temperature sampling mode. The control circuit is used to control the temperature sensor according to the temperature sampling mode; The temperature sensor is used to collect temperature and output the collected temperature. The control circuit is also used to process the temperature collected by the temperature sensor.

[0005] In one possible implementation, the control circuit includes a mode selection sub-circuit, an enable control sub-circuit, and a data processing sub-circuit. The mode selection sub-circuit is used to receive the mode selection signal corresponding to the temperature sampling mode; The enable control sub-circuit is used to receive a first-level enable control signal, and output a first-level temperature sampling enable signal based on the first-level enable control signal and the mode selection signal to activate the temperature sensor. The data processing sub-circuit is used to receive the temperature collected by the temperature sensor and process the temperature collected by the temperature sensor.

[0006] In one possible implementation, the temperature sampling mode includes a single sampling mode, a continuous sampling mode, a mean sampling mode, an interval continuous sampling mode, or an interval mean sampling mode.

[0007] In one possible implementation, the temperature sampling mode is a single sampling mode, a continuous sampling mode, or an interval continuous sampling mode; The data processing sub-circuit includes a format conversion sub-circuit, which is used to receive the temperature collected by the temperature sensor and convert the format of the temperature collected by the temperature sensor.

[0008] In one possible implementation, the temperature sampling mode is a single-sampling mode; the enable control subcircuit is further configured to: The system receives a second-level sampling enable signal output by the temperature sensor to indicate that the temperature collected by the temperature sensor is valid data. Based on the sampling enable signal of the second level, output a temperature sampling enable signal of the second level and an enable control signal of the second level to turn off the temperature sensor.

[0009] In one possible implementation, the temperature sampling mode is a continuous sampling mode; the enable control subcircuit is further used for: In response to the temperature sensor acquiring a certain number of temperature samples in a continuous sampling period, if the mode selection signal is invalid or the control register value is a first value, a second-level temperature sampling enable signal and a second-level enable control signal are output to turn off the temperature sensor. The control register is used to configure the enable control signal.

[0010] In one possible implementation, the temperature sampling mode is an average sampling mode or an interval average sampling mode; the data processing sub-circuit includes an average processing sub-circuit and a format conversion sub-circuit. The average value processing sub-circuit is used to receive the temperature collected by the temperature sensor, and in response to the temperature sensor collecting temperature a number of times and reaching the average sampling number, to determine the average value of the temperature collected by the temperature sensor multiple times and obtain the average temperature value. The format conversion sub-circuit is used to convert the format of the average temperature value.

[0011] In one possible implementation, the temperature sampling mode is an average sampling mode; the average processing sub-circuit is further used for: Each time the temperature collected by the temperature sensor is received, a second-level sampling enable signal output by the temperature sensor is received to indicate that the temperature collected by the temperature sensor is valid data; In response to the temperature sensor acquiring temperature a number of times that the average number of samplings is reached, a second-level temperature sampling enable signal and a second-level enable control signal are output based on the last received second-level sampling valid enable signal to turn off the temperature sensor.

[0012] In one possible implementation, the temperature sampling mode is either an interval continuous sampling mode or an interval average sampling mode; the control circuit further includes a delay sub-circuit; the configuration information is also used to configure the delay duration; The delay sub-circuit is used to receive a second-level sampling valid enable signal output by the temperature sensor to indicate that the temperature collected by the temperature sensor is valid data; each time the second-level sampling valid enable signal is received, a second-level delayed valid enable signal is output based on the second-level sampling valid enable signal to start the timing of the delay sub-circuit. The enable control sub-circuit is also used to receive the second level sampling valid enable signal, and each time the second level sampling valid enable signal is received, it outputs the second level temperature sampling enable signal based on the second level sampling valid enable signal to turn off the temperature sensor. The delay sub-circuit is also used to output a first-level delay-enabled signal when the timing ends; The enable control sub-circuit is also used to re-output a temperature sampling enable signal of the first level based on the first level delayed enable signal each time the first level delayed enable signal is received, so as to activate the temperature sensor.

[0013] In one possible implementation, the control circuit further includes an interrupt control sub-circuit; the interrupt control sub-circuit is used for: Receive the mode selection signal; The system receives a second-level sampling enable signal output by the temperature sensor to indicate that the temperature data collected by the temperature sensor is valid. Based on the mode selection signal and the second level sampling enable signal, a sampling completion interrupt signal is output.

[0014] In one possible implementation, the control circuit further includes a temperature warning sub-circuit, and the configuration information is further used to configure a temperature warning range; the interrupt control sub-circuit is used for: Receive the mode selection signal and the temperature collected by the temperature sensor; The system receives a second-level sampling enable signal output by the temperature sensor to indicate that the temperature data collected by the temperature sensor is valid. In response to the temperature collected by the temperature sensor being within the temperature warning range, a temperature warning interruption signal is output based on the mode selection signal and the second-level sampling valid enable signal.

[0015] Secondly, a chip is provided, the chip being configured with the temperature detection circuit provided in the first aspect, the temperature detection circuit being connected to a system bus via a digital interface.

[0016] Thirdly, a computer device is provided, the computer device including the chip provided in the second aspect.

[0017] This application provides a temperature detection circuit including a register circuit, a control circuit, and a temperature sensor. The register circuit parses configuration information, and the control circuit controls the temperature sensor based on the parsed data, causing it to sample the temperature according to a specified temperature sampling mode. The temperature sensor is used to complete temperature acquisition. In other words, this application implements temperature data processing and decision-making through hardware circuitry. The entire path is implemented by hardware logic, which not only effectively shortens data latency but also eliminates the unnecessary energy consumption caused by software polling, thus effectively improving the overall energy efficiency of the system. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the structure of a temperature detection circuit provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a temperature detection circuit provided in an embodiment of this application; Figure 3 This is a schematic diagram of the control circuit of a temperature detection circuit in single sampling mode provided in an embodiment of this application; Figure 4 This is a timing diagram of the control circuit of a temperature detection circuit in single sampling mode provided in an embodiment of this application; Figure 5This is a timing diagram of the control circuit of a temperature detection circuit in continuous sampling mode according to an embodiment of this application; Figure 6 This is a schematic diagram of the control circuit of a temperature detection circuit in the mean sampling mode provided in an embodiment of this application; Figure 7 This is a timing diagram of the control circuit of a temperature detection circuit in the mean sampling mode provided in an embodiment of this application; Figure 8 This is a schematic diagram of the control circuit of a temperature detection circuit in the interval continuous sampling mode provided in an embodiment of this application; Figure 9 This is a timing diagram of the control circuit of a temperature detection circuit in the interval continuous sampling mode provided in an embodiment of this application; Figure 10 This is a schematic diagram of the control circuit in a temperature detection circuit provided in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0021] With the continuous advancement of semiconductor technology, transistor feature sizes are evolving towards deeper submicron and even nanometer scales. The number of transistors integrated per unit area of ​​a chip is increasing exponentially, leading to a significant increase in chip power density. This increase in chip power density directly results in increasingly prominent localized overheating problems within the chip, posing multiple challenges to chip performance, reliability, and lifespan.

[0022] At the performance level, localized overheating reduces the carrier mobility of transistors, directly slowing down their switching speed and causing a contraction in timing margin. To avoid circuit malfunctions caused by timing errors, the system is often forced to implement dynamic frequency reduction strategies in the overheated areas, leading to a continuous decline in overall performance.

[0023] In terms of reliability and lifespan, sustained high temperatures accelerate the aging of transistor oxide layers, damage the internal metal interconnect structure of the chip, and thus shorten the chip's lifespan. Furthermore, under extreme conditions, localized high temperatures can even trigger thermal runaway, posing a serious threat to the stable operation of the entire electronic system.

[0024] To achieve accurate temperature sensing and efficient control of chips, directly integrating analog temperature sensor IP cores during the chip's front-end design phase has become the mainstream technology in the industry. This approach, with its reusability, portability, and high compatibility with process technology, effectively shortens the development cycle and reduces design costs. However, existing analog temperature sensor IP cores typically only possess basic temperature sensing and analog signal acquisition functions; all temperature data processing and decision-making must rely on the main control unit to complete the task through software algorithms.

[0025] This software-based post-processing approach has significant technical shortcomings: On the one hand, the latency introduced by the entire process of data transmission from the sensor to the main control unit, and then through algorithm calculation to output control instructions for task execution, limits the system's ability to respond quickly to temperature transients; on the other hand, continuously running monitoring tasks will continuously occupy CPU computing resources, crowding out the execution space of core business. This will not only reduce the overall operating efficiency of the system, but also generate additional power consumption due to the continuous high load of the CPU, which contradicts the chip's design goals of low power consumption and high performance.

[0026] Based on this, this application provides a temperature detection circuit, which includes a register circuit, a control circuit, and a temperature sensor. The register circuit is used to parse configuration information, and the control circuit controls the temperature sensor based on the parsed data, causing it to sample the temperature according to a specified temperature sampling mode. The temperature sensor is used to complete the temperature acquisition. In other words, this application implements temperature data processing and decision-making through hardware circuitry. The entire path is implemented by hardware logic, which not only effectively shortens data latency but also eliminates the unnecessary energy consumption caused by software polling, thereby effectively improving the overall energy efficiency of the system.

[0027] The temperature detection circuit provided in the embodiments of this application will now be explained in detail.

[0028] Figure 1 This is a schematic diagram of a temperature detection circuit provided in an embodiment of this application, as shown below. Figure 1 As shown, the temperature detection circuit includes a register circuit, a control circuit, and a temperature sensor. The register circuit receives configuration information used to configure the temperature sampling mode. The control circuit controls the temperature sensor according to the temperature sampling mode. The temperature sensor acquires and outputs the acquired temperature. The control circuit also processes the temperature acquired by the temperature sensor.

[0029] In some embodiments, this configuration information may be sent by a central processing unit other than the temperature detection circuit. For example, please refer to... Figure 1The register circuit communicates with the central processing unit (CPU) via the system bus, and the CPU can send configuration information to the register circuit via the system bus.

[0030] In some embodiments, the temperature sampling mode includes a single sampling mode, a continuous sampling mode, a mean sampling mode, an interval continuous sampling mode, or an interval mean sampling mode.

[0031] In single-sampling mode, after receiving a start command, the temperature sensor performs one temperature measurement, obtains one temperature data point, and then enters an idle or low-power state. Single-sampling mode starts on demand, stops after one measurement, and outputs a single temperature data point. It is suitable for applications that do not require real-time monitoring and only need to acquire temperature data occasionally. Examples include the self-test of home appliances and battery-powered handheld devices (such as electronic thermometers). Because the temperature sensor remains idle for extended periods in this mode, its power consumption is low.

[0032] In continuous sampling mode, after receiving a start command, the temperature sensor continuously measures temperature one after another, outputting a continuous stream of temperature data. Continuous sampling mode can capture instantaneous fluctuations and rapid changes in temperature, making it suitable for applications requiring high-frequency temperature monitoring, such as industrial process control, rapid-response alarm systems, and precision thermal analysis in laboratories. Because the temperature sensor is constantly operating in continuous sampling mode, its power consumption is relatively high.

[0033] In mean sampling mode, the temperature sensor takes multiple rapid samples within a short period, then performs an arithmetic average of these samples, and outputs the averaged temperature data as the final measurement result. Mean sampling mode is often suitable for applications requiring high data stability, such as digital multimeters, high-precision laboratory thermometers, and medical equipment.

[0034] In interval continuous sampling mode, the temperature sensor performs a measurement at fixed time intervals (such as every second or every minute) set by the user. Between two measurements, the sensor is in an idle or low-power waiting state. Interval continuous sampling mode is equivalent to periodically and repeatedly performing single samples, and is mostly suitable for occasions that require long-term recording of temperature trends. For example, environmental monitoring stations need to measure temperature data once per minute to observe temperature change trends.

[0035] Interval averaging sampling mode combines interval continuous sampling mode with average sampling mode. In interval averaging sampling mode, the temperature sensor outputs a temperature data point at a fixed time interval (e.g., every second) set by the user. However, each output temperature data point is not the result of a single sample, but rather an average value obtained from multiple samples taken over a period of time. Interval averaging sampling mode can better reflect the overall trend of temperature change without being disturbed by small temperature fluctuations. It is widely used in data loggers (such as weather stations recording a filtered temperature value every minute), industrial process monitoring systems, experiments requiring smooth temperature change curves, and automotive engine temperature monitoring, among other applications.

[0036] The control circuit processes the temperature data collected by the temperature sensor; that is, it can convert the format of the temperature data collected by the temperature sensor to obtain a temperature that can be read by the system bus. Furthermore, in average sampling mode, the control circuit can also perform average processing on multiple temperature data points collected by the temperature sensor to ensure the stability and reliability of the temperature data.

[0037] As described above, the register circuit receives configuration information to configure the temperature sampling mode. This allows the control circuit to accurately control the temperature sensor's on / off state according to the sampling principle corresponding to the specified sampling mode. The temperature sensor then collects and outputs the collected temperature data according to the designated sampling mode. Furthermore, the control circuit processes the temperature data collected by the sensor. In other words, the entire process—from the register circuit receiving the configuration information to the temperature sensor outputting the collected temperature, and then to the control circuit processing the collected temperature—is implemented by hardware. This not only effectively shortens data latency but also eliminates the unnecessary energy consumption caused by software polling, thus significantly improving the overall energy efficiency of the system. In addition, the processor can flexibly configure multiple sampling modes through the register circuit, enabling a single hardware circuit to adapt to diverse application requirements.

[0038] Please refer to Figure 2 The control circuit includes a mode selection subcircuit, an enable control subcircuit, and a data processing subcircuit. The mode selection subcircuit receives the mode selection signal corresponding to the temperature sampling mode. The enable control subcircuit receives a first-level enable control signal and, based on the first-level enable control signal and the mode selection signal, outputs a first-level temperature sampling enable signal to activate the temperature sensor. The data processing subcircuit receives and processes the temperature collected by the temperature sensor.

[0039] The mode selection signal is a signal used to indicate the temperature sampling mode of the temperature sensor. Generated by a register circuit, this signal can be represented by multiple bits, where different bit values ​​correspond to different temperature sampling modes. For example, this signal can be represented by a 3-bit binary signal to indicate six temperature sampling modes. For instance, if the mode selection signal is 3'b001, it indicates a single-sampling mode; if it is 3'b010, it indicates a continuous sampling mode; if it is 3'b011, it indicates an average sampling mode; if it is 3'b100, it indicates an interval continuous sampling mode; and if it is 3'b101, it indicates an interval average sampling mode. When the mode selection signal is 3'b000, it indicates that no temperature sampling mode is set, i.e., an invalid sampling mode. In this case, the temperature detection circuit is not working or is in an idle waiting state.

[0040] In some embodiments, the register circuit includes multiple registers and a register parsing circuit. The multiple registers are used to store configuration information, and the register parsing circuit parses the configuration information stored in the multiple registers to generate various signals related to the control circuit. For example, the register circuit may include a first register for storing configuration information related to the temperature sampling mode. The register parsing circuit parses the temperature sampling mode-related configuration information stored in the first register to output a mode selection signal corresponding to the temperature sampling mode.

[0041] An enable control signal is used to start or stop the enable control sub-circuit. This enable control signal can be a first-level signal or a second-level signal. Specifically, a first-level enable control signal is used to start the enable control sub-circuit, and a second-level enable control signal is used to stop the enable control sub-circuit. The first level can be high or low; if the first level is high, the second level is low, and vice versa. For example, if the enable control signal is low, it indicates that the enable control sub-circuit is started; if the enable control signal is high, it indicates that the enable control sub-circuit is stopped.

[0042] Based on the above description, the register circuit includes multiple registers. In some embodiments, these multiple registers may include a second register for storing configuration information related to an enable control signal. This configuration information characterizes whether the enable control signal is a first level or a second level. The register parsing circuit can generate either a first-level or second-level enable control signal according to this configuration information. For example, if the configuration information written to the second register is 0, a first-level enable control signal is generated; if the configuration information written to the second register is 1, a second-level enable control signal is generated.

[0043] In other embodiments, the enable control signal can also be generated by switching the temperature sampling mode, that is, the enable control signal is associated with the temperature sampling mode. For example, when the temperature sampling mode switches from an invalid sampling mode to a first sampling mode, the register circuit generates an enable control signal for a first level; when the temperature sampling mode switches back from the first mode to the invalid sampling mode, the register circuit generates an enable control signal for a second level. The first sampling mode is any one of five sampling modes: single sampling mode, continuous sampling mode, average sampling mode, interval continuous sampling mode, and interval average sampling mode.

[0044] The temperature sampling enable signal is used to start or stop the temperature sensor. This signal can be a first-level signal or a second-level signal. Specifically, a first-level temperature sampling enable signal is used to start the temperature sensor, and a second-level signal is used to stop the temperature sensor. The first level can be high or low; if the first level is high, the second level is low, and vice versa. For example, a low temperature sampling enable signal indicates that the temperature sensor is started; a high temperature sampling enable signal indicates that the temperature sensor is stopped.

[0045] The implementation process of outputting a temperature sampling enable signal at the first level based on the first level enable control signal and the mode selection signal includes: in response to the temperature sampling mode indicated by the mode selection signal being any of the first sampling modes, when a transition edge of the enable control signal from the second level to the first level is detected, generating a temperature sampling enable signal at the first level, and outputting the temperature sampling enable signal at the first level at least one clock cycle after detecting the transition edge of the enable control signal from the second level to the first level to start the temperature sensor.

[0046] Based on the above description, the first level can be either low or high. When the first level is low, the transition edge of the enable control signal from the second level to the first level refers to the falling edge of the enable control signal, that is, the moment when the enable control signal transitions from high to low. When the first level is high, the transition edge of the enable control signal from the second level to the first level refers to the rising edge of the enable control signal, that is, the moment when the enable control signal transitions from low to high.

[0047] A clock signal is a pulse signal with a fixed period, providing a unified timing reference for all sequential circuits. Through the regular alternation of high and low levels, the clock signal provides a unified timing reference for instruction execution and data transfer in various sequential logic units (such as registers and state machines) within the chip, thereby ensuring the orderly collaboration of various functional modules in the circuit. In the temperature detection circuit provided in this application embodiment, the register circuit, control circuit, and temperature sensor are all sequential circuits. That is, instruction execution and data transfer in each functional module of this application embodiment all require the clock signal as the core timing reference. In other words, the key operations involved in signal detection, generation, and temperature sensor sampling in this application embodiment are all triggered by the rising or falling edge of the clock signal, which will not be elaborated further.

[0048] The clock period mentioned above is the basic time unit of a clock signal, which refers to the time interval between two adjacent edges of a clock signal that are in the same direction (such as rising edge and rising edge, falling edge and falling edge). For example, the clock period can be the time interval between two adjacent rising edges of a clock signal or the time interval between two adjacent falling edges of a clock signal.

[0049] Based on the above description, the temperature sampling enable signal at the first level is output at least one clock cycle after the enable control signal transitions from the second level to the first level. This at least one clock cycle can be one clock cycle or multiple clock cycles. For example, the transition of the enable control signal from the second level to the first level can be detected at the fifth rising edge of the clock signal, and the temperature sampling enable signal at the first level can be output at the sixth rising edge of the clock signal; alternatively, the transition of the enable control signal from the second level to the first level can be detected at the fifth rising edge of the clock signal, and the temperature sampling enable signal at the first level can be output at the fifteenth rising edge of the clock signal. This embodiment does not limit this to any particular level.

[0050] Based on the above description, temperature sampling modes include single sampling mode, continuous sampling mode, average sampling mode, interval continuous sampling mode, and interval average sampling mode. The implementation of the control circuit differs under different temperature sampling modes. The following sections will explain these five temperature sampling modes in detail.

[0051] Please refer to Figure 3 The temperature sampling mode can be single sampling, continuous sampling, or interval continuous sampling. The data processing subcircuit includes a format conversion subcircuit, which receives the temperature data collected by the temperature sensor and converts the collected temperature data into its correct format.

[0052] Since the temperature output from the temperature sensor may not be readable via the system bus, this format conversion subcircuit can convert the temperature data acquired by the temperature sensor into a format that the system bus can read. In other words, the format conversion subcircuit converts the temperature data from the temperature sensor, which may have varying formats or voltage levels, into standardized digital data that the system bus can directly read, ensuring accurate parsing, efficient transmission, and stable application of the temperature data.

[0053] In some embodiments, the temperature output by the temperature sensor is the temperature after analog-to-digital conversion, that is, the temperature sensor outputs a temperature in digital format. This application does not limit this.

[0054] After the temperature sensor is activated, it begins acquiring temperature data. Once the temperature sensor has completed acquiring the data, it outputs the acquired temperature to the format conversion sub-circuit. This sub-circuit then performs format conversion on the temperature data acquired by the sensor. In other words, as long as the temperature sensor outputs the acquired temperature data, the format conversion sub-circuit can perform format conversion on that temperature.

[0055] In other embodiments, the temperature sensor may output invalid temperature readings for various reasons. To facilitate differentiation between valid and invalid temperature data, please refer to [reference needed]. Figure 3 The temperature sensor outputs the collected temperature along with a second-level sampling enable signal to indicate that the temperature data output by the sensor is valid. Thus, the format conversion sub-circuit will only perform format conversion on the temperature collected by the temperature sensor after receiving the second-level sampling enable signal.

[0056] In some embodiments, the format conversion subcircuit outputs the converted temperature at least one clock cycle after detecting a transition edge of the sampling valid enable signal from the second level to the first level. In other embodiments, please refer to... Figure 3 When the format conversion sub-circuit outputs the converted temperature, it can also output a second-level temperature valid enable signal to indicate that the converted temperature is valid data.

[0057] Based on the above description, the register circuit may include multiple registers, including a third register. After the data conversion sub-circuit performs format conversion on the temperature collected by the temperature sensor, it can output the converted temperature and the second-level temperature enable signal to the register circuit. In this way, the register circuit can store the converted temperature in the third register, which is convenient for the central processing unit to read through the system bus.

[0058] In some embodiments, the temperature sampling mode is a single sampling mode; please refer to... Figure 3 The enable control sub-circuit is also used to: receive a second-level sampling valid enable signal output by the temperature sensor to indicate that the temperature collected by the temperature sensor is valid data; and output a second-level temperature sampling enable signal and a second-level enable control signal based on the second-level sampling valid enable signal to turn off the temperature sensor.

[0059] When the temperature sampling mode is a single sampling mode, the process of outputting a second-level temperature sampling enable signal and a second-level enable control signal based on the second-level sampling enable signal includes: in response to detecting a transition edge of the sampling enable signal from the second level to the first level, generating a second-level temperature sampling enable signal and a second-level enable control signal, and outputting the second-level temperature sampling enable signal and the second-level enable control signal at least one clock cycle after detecting a transition edge of the sampling enable signal from the second level to the first level, so as to turn off the temperature sensor.

[0060] Based on the above description, the first level can be either low or high, and the second level can also be either low or high. When the first level is low, the second level is high; when the first level is high, the second level is low. When the second level is low, the transition edge of the sampling enable signal from the second level to the first level refers to the rising edge of the sampling enable signal, i.e., the moment when the sampling enable signal changes from low to high. When the second level is high, the transition edge of the sampling enable signal from the second level to the first level refers to the falling edge of the sampling enable signal, i.e., the moment when the sampling enable signal changes from high to low.

[0061] After the temperature sensor outputs a second-level sampling enable signal, it can maintain this signal for multiple clock cycles, and then transition from the second level to the first level after these multiple clock cycles. The number of clock cycles can be set as needed, and this application does not limit this setting.

[0062] Based on the above description, the temperature sampling enable signal at the second level and the enable control signal at the second level are output at least one clock cycle after the transition edge of the sampling valid enable signal from the second level to the first level. This at least one clock cycle can be one clock cycle or multiple clock cycles. For details, please refer to the above description, which will not be repeated here.

[0063] For the timing sequence of the control circuit in single-sampling mode, please refer to [reference needed]. Figure 4 `single_mode` indicates single-sampling mode, D1 represents the temperature output by the temperature sensor, and D11 represents the temperature converted by the format conversion subcircuit. Taking a low level as the first level and a high level as an example, after detecting the falling edge of the enable control signal, the temperature sampling enable signal is pulled low after one clock cycle to start the temperature sensor and begin temperature acquisition. After the temperature sensor completes temperature acquisition, the sampling valid enable signal is pulled high, and the temperature D1 acquired by the temperature sensor is output. When the rising edge of the sampling valid enable signal is detected, indicating that the temperature sensor has completed temperature acquisition, the format of the temperature D1 acquired by the temperature sensor is converted, and after the format conversion is completed, the converted temperature D11 and a temperature valid enable signal indicating that the converted temperature D11 is valid data are output. After the sampling valid enable signal remains low for several clock cycles, after detecting the falling edge of the sampling valid enable signal, the enable control signal and the temperature sampling enable signal are pulled high after one clock cycle to turn off the temperature sensor.

[0064] It should be noted that, Figure 4 This is merely a simple illustration of the working principle of the control circuit. The clock cycles in the figure are just an example and do not constitute a limitation on the embodiments of this application.

[0065] In some embodiments, the temperature sampling mode is a continuous sampling mode; the enable control sub-circuit is further configured to: in response to the temperature sensor acquiring temperature a number of times in continuous sampling, output a second-level temperature sampling enable signal and a second-level enable control signal to turn off the temperature sensor when the mode selection signal is an invalid signal or the value of the control register is a first value, wherein the control register is used to configure the enable control signal.

[0066] When the temperature sensor collects temperature data for the required number of consecutive samples, and the mode selection signal is invalid or the control register value is the first value, the process of outputting a second-level temperature sampling enable signal and a second-level enable control signal includes: in response to detecting that the mode selection signal has switched from an valid signal to an invalid signal, or in response to detecting that the control register value has changed from a second value to a first value, generating a second-level temperature sampling enable signal and a second-level enable control signal, and outputting the second-level temperature sampling enable signal and the second-level enable control signal at least one clock cycle interval to turn off the temperature sensor.

[0067] Based on the above description, the mode selection signal is a signal used to indicate the temperature sampling mode of the temperature sensor. An invalid mode selection signal indicates an invalid sampling mode; a valid mode selection signal indicates the first sampling mode. Therefore, the switching of the mode selection signal from valid to invalid means that the temperature sampling mode changes from the first sampling mode to the invalid sampling mode. For example, in continuous sampling mode, the mode selection signal is 3'b010; in invalid sampling mode, the mode selection signal is 3'b000. The moment the temperature sampling mode switches from continuous sampling mode to invalid sampling mode is the moment the mode selection signal changes from 3'b010 to 3'b000.

[0068] Based on the above description, the register circuit includes multiple registers. In some embodiments, these multiple registers include a control register, which may be the second register described above. That is, the control register is used to store configuration information related to the enable control signal. This configuration information can be a first value or a second value, where the first and second values ​​respectively characterize whether the enable control signal is at a first level or a second level. For example, the first value is 1, and the second value is 0. Moreover, when the value of the control register is the first value, it indicates that a second-level enable control signal is generated; when the value of the control register is the second value, it indicates that a first-level enable control signal is generated. Therefore, the change of the control register value from the second value to the first value refers to the moment when the enable control signal jumps from the second level to the first level.

[0069] Based on the above description, the first level can be either low or high, and the second level can also be either low or high. When the first level is low, the second level is high; when the first level is high, the second level is low. When the second level is low, the moment when the enable control signal transitions from the second level to the first level refers to the rising edge of the enable control signal, i.e., the moment when the enable control signal transitions from low to high. In other words, the moment when the value of the control register changes from the second value to the first value is the moment when the enable control signal transitions from low to high. When the second level is high, the transition edge when the enable control signal transitions from the second level to the first level refers to the falling edge of the enable control signal, i.e., the moment when the enable control signal transitions from high to low. In other words, the moment when the value of the control register changes from the second value to the first value is the moment when the enable control signal transitions from high to low.

[0070] Based on the above description, the second-level temperature sampling enable signal and the second-level enable control signal are output at least one clock cycle after the mode selection signal switches from an active signal to an inactive signal, or after the value of the control register changes from a second value to a first value. This at least one clock cycle can be one clock cycle or multiple clock cycles. For details, please refer to the above description, which will not be repeated here.

[0071] It should be noted that the second-level temperature sampling enable signal and the second-level enable control signal can be output simultaneously or at intervals of several clock cycles, depending on the requirements. This application does not limit this. For example, at the rising edge of the first clock cycle after detecting that the mode selection signal has switched from an active signal to an inactive signal, the second-level enable control signal is output; at the rising edge of the second clock cycle after detecting that the mode selection signal has switched from an active signal to an inactive signal, the second-level temperature sampling enable signal is output.

[0072] For the timing sequence of the control circuit in continuous sampling mode, please refer to [reference needed]. Figure 5 Taking three consecutive samples as an example, `continuous_mode` represents the continuous sampling mode, `D1` represents the first temperature output by the temperature sensor, `D2` represents the second temperature output by the temperature sensor, and `D3` represents the third temperature output by the temperature sensor; `D11` represents the temperature converted from `D1` by the format conversion subcircuit, `D22` represents the temperature converted from `D2` by the format conversion subcircuit, and `D33` represents the temperature converted from `D3` by the format conversion subcircuit. Taking a low level for the first level and a high level for the second level as an example, after detecting the falling edge of the enable control signal, the temperature sampling enable signal is pulled low after one clock cycle to start the temperature sensor and begin temperature acquisition.

[0073] After the temperature sensor completes its first temperature acquisition, it raises the sampling enable signal high for one clock cycle and outputs the first temperature D1 acquired by the sensor. When the rising edge of the sampling enable signal is detected, it indicates that the temperature sensor has completed the first temperature acquisition. At this point, the format of the first temperature D1 acquired by the temperature sensor is converted, and after the format conversion is completed, the converted temperature D11 and a temperature enable signal indicating that the converted first temperature D11 is valid data are output. After the temperature sensor completes its second temperature acquisition, it raises the sampling enable signal high for one clock cycle and outputs the second temperature D2 acquired by the temperature sensor. When the rising edge of the sampling enable signal is detected, it indicates that the temperature sensor has completed the second temperature acquisition. At this point, the format of the second temperature D2 acquired by the temperature sensor is converted, and after the format conversion is completed, the converted temperature D22 and a temperature enable signal indicating that the converted second temperature D22 is valid data are output. After the temperature sensor completes the third temperature acquisition, the sampling enable signal is pulled high for one clock cycle, and the third temperature D3 acquired by the temperature sensor is output. When the rising edge of the sampling enable signal is detected, it indicates that the temperature sensor has completed the third temperature acquisition. At this time, the format of the third temperature D3 acquired by the temperature sensor is converted, and after the format conversion is completed, the converted temperature D33 and the temperature enable signal used to indicate that the converted third temperature D33 is valid data are output.

[0074] When the temperature sampling mode is detected to switch from continuous_mode to 0, it means that the temperature sensor has completed temperature acquisition. At this time, the enable control signal is pulled high at one clock cycle interval, and the temperature sampling enable signal is pulled high at two clock cycles to turn off the temperature sensor.

[0075] It should be noted that, Figure 5 This is merely a simple illustration of the working principle of the control circuit. The clock cycles in the figure are just an example and do not constitute a limitation on the embodiments of this application.

[0076] Please refer to Figure 6 The temperature sampling mode is either mean sampling mode or interval mean sampling mode. The data processing subcircuit includes a mean processing subcircuit and a format conversion subcircuit; the mean processing subcircuit is used to receive the temperature collected by the temperature sensor, and in response to the temperature sensor collecting temperature a number of times to reach the mean sampling number, it determines the mean of the temperature collected by the temperature sensor multiple times, and obtains the temperature mean; the format conversion subcircuit is used to convert the format of the temperature mean.

[0077] In industrial and electronic measurement applications, temperature data often contains random high-frequency noise and transient spikes due to factors such as inherent sensor noise, electromagnetic interference, and transient environmental disturbances. This results in large fluctuations and distortion in single sampling results. These distorted data can cause the system to respond incorrectly. For example, in temperature control systems (such as air conditioners), if temperature data fluctuates too drastically, the air conditioner compressor will frequently start and stop, reducing its lifespan or even causing it to malfunction. To extract stable, accurate, and reliable temperature data from the interfered signal and suppress the impact of occasional spikes on system judgment and control, temperature data processing is typically required. Therefore, the control circuit also includes an averaging sub-circuit. This sub-circuit uses a weighted average to process multiple consecutive temperature data points collected by the temperature sensor, thereby eliminating random noise, pulse interference, or transient fluctuations in the temperature data to ensure its stability and reliability.

[0078] After the temperature sensor is activated, it begins collecting temperature data. Each time the temperature sensor completes a data acquisition, it outputs the acquired temperature to the averaging sub-circuit. This sub-circuit receives the temperature data, stores each received temperature in a data buffer, and continuously sums all the temperatures in the buffer to obtain the current temperature sum. When the temperature sensor has collected enough samples for the averaging sub-circuit to reach the required number of samples (i.e., when the averaging sub-circuit has received all the temperatures from the current continuous sampling), it divides the total accumulated temperature sum by the number of temperatures used in the calculation (e.g., 3 times) to obtain the temperature average.

[0079] In some embodiments, the data buffer described above is a storage area used to temporarily store temperature data. This data buffer can be a hardware register, a memory array, a shift register, etc. For example, the data buffer can store all the temperature data needed to calculate the average temperature.

[0080] The aforementioned number of average samplings is a configuration message sent by the central processing unit (CPU) outside the temperature detection circuit. This configuration message indicates the number of average samplings; that is, in average sampling mode, the average processing sub-circuit needs to perform average processing on multiple collected temperature data points. For example, if the average sampling number is configured to be 5 in average sampling mode, then the average processing sub-circuit needs to perform average processing on 5 collected temperature data points.

[0081] Based on the above description, the register circuit may include multiple registers, including a fourth register for storing configuration information related to the number of mean samples. For example, if the configuration information written to the fourth register is 3, then the generated number of mean samples is 3.

[0082] In some embodiments, please refer to Figure 6 When the averaging sub-circuit outputs the average temperature value, it can also output a second-level average enable signal, which indicates that the average temperature value output by the averaging sub-circuit is valid data.

[0083] Based on the above description, the average temperature value and the average value enable signal output by the average value processing sub-circuit are sent to the format conversion sub-circuit. The format conversion sub-circuit receives the average temperature value and the average value enable signal, and performs format conversion on the received average temperature value. For details of the format conversion circuit, please refer to the above description, which will not be repeated here.

[0084] In some embodiments, the temperature sampling mode is the mean sampling mode. Please refer to... Figure 6 The averaging sub-circuit is also used to: receive a second-level sampling enable signal output by the temperature sensor each time the temperature is received, to indicate that the temperature collected by the temperature sensor is valid data; and in response to the temperature sensor collecting temperature a number of times to reach the average sampling count, output a second-level temperature sampling enable signal and a second-level enable control signal based on the last received second-level sampling enable signal, to turn off the temperature sensor.

[0085] Based on the above description, the temperature sensor can output a second-level sampling enable signal along with the acquired temperature, indicating that the temperature output by the temperature sensor is valid data. Thus, the averaging sub-circuit will only store the temperature acquired by the temperature sensor and sum all currently stored valid temperatures after receiving the second-level sampling enable signal.

[0086] The aforementioned last received second-level sampling enable signal refers to the second-level sampling enable signal output by the temperature sensor when the last temperature acquisition is completed. For example, if the average sampling number is 3, the last received second-level sampling enable signal refers to the second-level sampling enable signal output by the temperature sensor when the 3rd temperature acquisition is completed.

[0087] When the temperature sampling mode is the average sampling mode, the process of outputting the second-level temperature sampling enable signal and the second-level enable control signal based on the last received second-level sampling enable signal includes: in response to detecting the transition edge of the last received second-level sampling enable signal from the second level to the first level, generating the second-level temperature sampling enable signal and the second-level enable control signal, and outputting the second-level temperature sampling enable signal and the second-level enable control signal at least one clock cycle after detecting the transition edge of the last received second-level sampling enable signal from the second level to the first level to turn off the temperature sensor.

[0088] Based on the above description, the first level can be either low or high, and the second level can also be either low or high. When the first level is low, the second level is high; when the first level is high, the second level is low. When the second level is low, the transition edge from the last received second-level sampling enable signal to the first level refers to the rising edge of the last received second-level sampling enable signal, i.e., the moment when the last received second-level sampling enable signal transitions from low to high. When the second level is high, the transition edge from the last received second-level sampling enable signal to the first level refers to the falling edge of the last received second-level sampling enable signal, i.e., the moment when the last received second-level sampling enable signal transitions from high to low.

[0089] Based on the above description, the second-level temperature sampling enable signal and the second-level enable control signal are output at least one clock cycle after the transition edge from the second level to the first level of the last received second-level sampling valid enable signal. This at least one clock cycle can be one clock cycle or multiple clock cycles. For details, please refer to the above description, which will not be repeated here.

[0090] For the timing sequence of the control circuit in mean sampling mode, please refer to [reference needed]. Figure 7Taking an average sampling count of 4 as an example, `average_mode` represents the average sampling mode; `D1` represents the first temperature output by the temperature sensor; `D2` represents the second temperature output by the temperature sensor; `D3` represents the third temperature output by the temperature sensor; and `D4` represents the fourth temperature output by the temperature sensor, which is also the last temperature output by the temperature sensor. `AVG` represents the average temperature after the average processing subcircuit processes the above temperatures D1, D2, D3, and D4; and `RES` represents the temperature after the format conversion subcircuit converts the average temperature `AVG`. Taking a low level as the first level and a high level as an example, after detecting the falling edge of the enable control signal, the temperature sampling enable signal is pulled low after one clock cycle to start the temperature sensor and begin temperature acquisition.

[0091] Each time the temperature sensor completes a temperature acquisition, it raises the sampling enable signal for one clock cycle and outputs the temperature acquired by the sensor. When the falling edge of the last sampling enable signal is detected, the temperature sensor has completed its last temperature acquisition. At this time, the averaging subcircuit calculates the average of the four temperatures and outputs the average temperature AVG and an average enable signal indicating that the average temperature is valid after one clock cycle. Simultaneously with the output of the average temperature AVG, the format conversion subcircuit performs format conversion on the average temperature AVG. Using the rising edge of the average enable signal as a reference, it outputs the converted temperature RES and a temperature enable signal indicating that the converted temperature RES is valid after one clock cycle.

[0092] After detecting the falling edge of the last valid sampling enable signal, the enable control signal and the temperature sampling enable signal are pulled high after one clock cycle to turn off the temperature sensor.

[0093] It should be noted that, Figure 7 This is merely a simple illustration of the working principle of the control circuit. The clock cycles during which the signal is held at a high level and the clock cycles at intervals are just examples and do not constitute a limitation on the embodiments of this application.

[0094] Please refer to Figure 8The temperature sampling mode is either an interval continuous sampling mode or an interval average sampling mode. The control circuit also includes a delay sub-circuit. The above configuration information is also used to configure the delay duration. The delay sub-circuit is used to receive a second-level sampling valid enable signal output by the temperature sensor to indicate that the temperature collected by the temperature sensor is valid data. Each time a second-level sampling valid enable signal is received, a second-level delay valid enable signal is output based on the second-level sampling valid enable signal to start the timing of the delay sub-circuit. The above-mentioned enable control sub-circuit is also used to receive a second-level sampling valid enable signal, and each time a second-level sampling valid enable signal is received, a second-level temperature sampling enable signal is output based on the second-level sampling valid enable signal to turn off the temperature sensor. The delay sub-circuit is also used to output a first-level delay valid enable signal when the timing ends. The enable control sub-circuit is also used to re-output a first-level temperature sampling enable signal based on the first-level delay valid enable signal each time a first-level delay valid enable signal is received to start the temperature sensor.

[0095] The delayed enable signal is used to indirectly start the temperature sensor or control the delay sub-circuit for timing. This signal primarily controls the timing within the interval between two temperature samplings. This delayed enable signal can be either a first-level or a second-level signal. Specifically, the first-level delayed enable signal is used to output a first-level temperature sampling enable signal, which in turn starts the temperature sensor. In other words, the first-level delayed enable signal first outputs a first-level temperature sampling enable signal, and then controls the temperature sensor's activation based on this signal, thus indirectly starting the temperature sensor. The second-level delayed enable signal is used to control the delay sub-circuit for timing. The first level can be high or low; if the first level is high, the second level is low, and vice versa. For example, if the delayed enable signal is low, it indicates that the temperature sensor can be indirectly started; if it is high, it indicates that the temperature sensor is off, and the delay sub-circuit continues timing.

[0096] The process of the delay sub-circuit receiving a second-level sample valid enable signal and outputting a second-level delayed valid enable signal based on the second-level sample valid enable signal includes: in response to detecting a transition edge of the sample valid enable signal from the first level to the second level, generating a second-level delayed valid enable signal, and outputting a second-level delayed valid enable signal at least one clock cycle after detecting a transition edge of the sample valid enable signal from the first level to the second level, so as to start the delay sub-circuit from starting the timing.

[0097] The process of enabling the control sub-circuit to output a second-level temperature sampling enable signal based on the second-level sampling enable signal each time it receives a second-level sampling valid enable signal includes: in response to detecting a transition edge of the sampling valid enable signal from the first level to the second level, generating a second-level temperature sampling enable signal, and outputting the second-level temperature sampling enable signal at least one clock cycle after detecting a transition edge of the sampling valid enable signal from the first level to the second level, so as to turn off the temperature sensor.

[0098] Based on the above description, the first level can be either low or high, and the second level can also be either low or high. When the first level is low, the second level is high; when the first level is high, the second level is low. When the first level is low, the transition edge of the sampling enable signal from the first level to the second level refers to the rising edge of the sampling enable signal, that is, the moment when the sampling enable signal changes from low to high. When the first level is high, the transition edge of the sampling enable signal from the first level to the second level refers to the falling edge of the sampling enable signal, that is, the moment when the sampling enable signal changes from high to low.

[0099] Based on the above description, after detecting the transition edge of the sampling valid enable signal from the first level to the second level, the temperature sensor is turned off after at least one clock cycle. Simultaneously, a delayed valid enable signal of the second level is output to start the delay sub-circuit for timing. Timing continues while the delayed valid enable signal is at the second level. When the number of counts reaches the number of delay clock cycles corresponding to the delay duration, timing ends. At this point, a delayed valid enable signal of the first level is output, and the count is reset to zero.

[0100] In some embodiments, the delay sub-circuit, when the delay enable signal is at the second level, counts at each rising edge of the clock signal. Specifically, at each rising edge of the clock signal, the count is incremented by 1 until the count reaches the number of delay clock cycles corresponding to the delay duration. At this point, counting stops, a first-level delay enable signal is output, and the count is reset to zero. For example, if the number of delay clock cycles is 5000, when the delay enable signal is at the second level, the count is 1 at the first rising edge of the clock signal; 2 at the second rising edge; 3 at the third rising edge, and so on, until the count reaches 5000, at which point counting stops, a first-level delay enable signal is output, and the count is reset to zero.

[0101] The process of enabling the control sub-circuit to re-output the temperature sampling enable signal of the first level based on the delayed effective enable signal of the first level includes: in response to detecting the transition edge of the delayed effective enable signal from the second level to the first level, generating the temperature sampling enable signal of the first level, and outputting the temperature sampling enable signal of the first level at least one clock cycle after detecting the transition edge of the delayed effective enable signal from the second level to the first level, so as to restart the temperature sensor.

[0102] Based on the above description, the first level can be either low or high, and the second level can also be either low or high. When the first level is low, the second level is high; when the first level is high, the second level is low. When the first level is low, the transition edge of the delayed enable signal from the second level to the first level refers to the falling edge of the delayed enable signal, i.e., the moment when the delayed enable signal changes from high to low. When the first level is high, the transition edge of the delayed enable signal from the second level to the first level refers to the rising edge of the delayed enable signal, i.e., the moment when the delayed enable signal changes from low to high.

[0103] The above-mentioned interval can be one clock cycle or multiple clock cycles, as detailed in the above description, which will not be repeated here.

[0104] Based on the above description, after each temperature acquisition, the temperature sensor is turned off, and a second-level delay enable signal is output for delay counting. When the count reaches the number of delay clock cycles corresponding to the delay duration, counting stops, the temperature sensor is restarted, and the count is reset to zero. In other words, the temperature sensor is off during the interval between every two temperature samplings, and the off time is determined by the delay duration.

[0105] Based on the above description, the register circuit includes multiple registers. In some embodiments, these multiple registers may include a fifth register, which stores configuration information related to the delay enable signal, and this configuration information is used to configure the delay duration. The register parsing circuit can obtain the corresponding delay duration based on the correspondence between the configuration information and the delay duration. For example, if the configuration information written to the fifth register is 0, it indicates that the delay duration is 0.1 seconds; if the configuration information written to the fifth register is 15, it indicates that the delay duration is 5 minutes.

[0106] The correspondence between the above configuration information and the delay duration can be flexibly set according to requirements. The correspondence between the configuration information and the delay duration is different for different chips, and this application embodiment does not limit this.

[0107] Based on the above description, the register circuit includes multiple registers. In some embodiments, these multiple registers may include a sixth register, which stores configuration information related to the delay enable signal. This configuration information is a specific number of delay clock cycles obtained based on the configuration information in the fifth register. In conjunction with the above description, the register parsing circuit can obtain the specific delay duration based on the configuration information in the fifth register. Simultaneously, the register parsing circuit can also multiply the delay duration by the clock frequency to obtain the specific number of delay clock cycles, and store this number of delay clock cycles in the sixth register.

[0108] For example, if the clock frequency is set to 50kHz, and the configuration information written to the fifth register is 0, the corresponding delay duration is 0.1 seconds. In this case, the delay clock cycle number corresponding to 0.1 seconds is 5000. That is, when the configuration information written to the fifth register is 0, the configuration information written to the sixth register is 5000. In other words, when the fifth register is configured with data 0, the delay sub-circuit needs to count 5000 times within every two sampling intervals of the temperature sensor.

[0109] Clock frequency is the reciprocal of clock cycle, and it is a parameter that users can flexibly set according to their needs. For example, if the clock frequency is 50kHz, then one clock cycle is 20μs (microseconds).

[0110] For the timing sequence of the control circuit in the interval continuous sampling mode, please refer to [reference needed]. Figure 9 Taking a 2-sampling operation with a delay of 8000 clock cycles as an example, `continuous_interval_mode` indicates a continuous interval sampling mode. D1 represents the first temperature output by the temperature sensor, and D2 represents the second temperature output by the temperature sensor. D11 represents the temperature converted from D1 by the format conversion subcircuit, and D22 represents the temperature converted from D2 by the format conversion subcircuit. Taking a low level for the first level and a high level for the second level as an example, after detecting the falling edge of the enable control signal, the temperature sampling enable signal is pulled low after one clock cycle to start the temperature sensor and begin temperature acquisition.

[0111] After the temperature sensor completes its first temperature acquisition, it raises the sampling enable signal high for one clock cycle and outputs the first temperature D1 acquired by the sensor. When the rising edge of the sampling enable signal is detected, it indicates that the temperature sensor has completed the first temperature acquisition. At this point, the format of the first temperature D1 acquired by the temperature sensor is converted, and after the format conversion is completed, the converted temperature D11 and a temperature enable signal indicating that the converted first temperature D11 is valid data are output. After the temperature sensor completes its second temperature acquisition, it raises the sampling enable signal high for one clock cycle and outputs the second temperature D2 acquired by the temperature sensor. When the rising edge of the sampling enable signal is detected, it indicates that the temperature sensor has completed the second temperature acquisition. At this point, the format of the second temperature D2 acquired by the temperature sensor is converted, and after the format conversion is completed, the converted temperature D22 and a temperature enable signal indicating that the converted second temperature D22 is valid data are output.

[0112] After the temperature sensor completes the first temperature acquisition, a time interval is required before the second temperature acquisition. Specifically, upon detecting the rising edge of the sampling enable signal, the temperature sampling enable signal is raised after one clock cycle to turn off the temperature sensor. Upon detecting the falling edge of the sampling enable signal, the delay enable signal is raised after one clock cycle to start the delay sub-circuit counting. When the delay sub-circuit counts to 8000, counting stops, the delay enable signal is pulled low, and the count is reset to zero.

[0113] Based on the above description, after detecting the falling edge of the delayed enable signal, the temperature sampling enable signal is pulled low at least one clock cycle later to restart the temperature sensor and enable the temperature sensor to start the second temperature acquisition.

[0114] It should be noted that, Figure 9 This is merely a simple illustration of the working principle of the control circuit. The clock cycles during which the high-level signal is maintained and the intervals between clock cycles are only examples and do not constitute a limitation on the embodiments of this application.

[0115] Please refer to Figure 2 , Figure 3 , Figure 6 or Figure 8 The control circuit also includes an interrupt control sub-circuit. This interrupt control sub-circuit is used to: receive the aforementioned mode selection signal; receive a second-level sampling enable signal output by the temperature sensor to indicate that the temperature data collected by the temperature sensor is valid; and output a sampling completion interrupt signal based on the aforementioned mode selection signal and the second-level sampling enable signal.

[0116] The sampling completion interrupt signal is used to indicate the operating status of the temperature sensor. This signal can be either a first-level signal or a second-level signal. Specifically, a first-level sampling completion interrupt signal indicates that the temperature sensor has not completed temperature acquisition, or that the temperature sensor is in an idle waiting state. A second-level sampling completion interrupt signal indicates that the temperature sensor has completed temperature acquisition. The first level can be high or low; if the first level is high, the second level is low, and vice versa. For example, if the sampling completion interrupt signal is low, it indicates that the temperature sensor has not completed temperature acquisition, or that the temperature sensor is in an idle waiting state; if the sampling completion interrupt signal is high, it indicates that the temperature sensor has completed temperature acquisition.

[0117] The implementation process of outputting a sampling completion interrupt signal based on the above-mentioned mode selection signal and the second level sampling enable signal includes: in response to the temperature sampling mode indicated by the mode selection signal being any of the first sampling modes, when a transition edge of the sampling enable signal from the first level to the second level is detected, a sampling completion interrupt signal of the second level is generated, and after detecting the transition edge of the sampling enable signal from the first level to the second level, the sampling completion interrupt signal of the second level is output at least one clock cycle later to indicate that the temperature sensor has completed temperature sampling.

[0118] Based on the above description, the first level can be either low or high. When the first level is low, the transition edge of the sampling enable signal from the first level to the second level refers to the rising edge of the sampling enable signal, that is, the moment when the sampling enable signal changes from low to high. When the first level is high, the transition edge of the sampling enable signal from the first level to the second level refers to the falling edge of the sampling enable signal, that is, the moment when the sampling enable signal changes from high to low.

[0119] The above-mentioned interval can be one clock cycle or multiple clock cycles, as detailed in the above description, which will not be repeated here.

[0120] In some embodiments, the number of times the sampling completion interrupt signal is raised is different for different sampling modes in the first sampling mode. For example, when the temperature sampling mode is any one of single sampling mode, average sampling mode, or interval average sampling mode, the sampling completion interrupt signal is raised only once in the entire temperature sampling period, that is, the sampling completion interrupt signal only jumps from the first level to the second level when the last temperature sampling in the entire temperature sampling period is completed; when the temperature sampling mode is continuous sampling or interval continuous sampling, the sampling completion interrupt signal is raised multiple times in the entire temperature sampling period, that is, the sampling completion interrupt signal is raised once every time a temperature sampling is completed in the entire temperature sampling period.

[0121] The entire temperature sampling period refers to the entire process from when the control circuit first receives the temperature sampling command to when it outputs the first converted temperature. For example, for single-sampling mode, the entire temperature sampling period includes only one temperature acquisition; for continuous sampling, the entire temperature sampling period includes multiple temperature acquisitions.

[0122] Based on the above description, the register circuit includes multiple registers. In some embodiments, these multiple registers may include a sixth register, which stores configuration information related to the sampling completion interrupt signal. This configuration information is used to configure whether the sampling completion interrupt function is enabled or disabled. That is, when the sampling completion interrupt function is enabled, the interrupt control subcircuit operates, thereby outputting the sampling completion interrupt signal; conversely, when the sampling completion interrupt function is disabled, the interrupt control subcircuit does not operate, thus failing to output the sampling completion interrupt signal. For example, if the configuration information written to the sixth register is 1, the sampling completion interrupt function is enabled, the interrupt control subcircuit operates, and the sampling completion interrupt signal is output; if the configuration information written to the sixth register is 0, the sampling completion interrupt function is disabled, the interrupt control subcircuit does not operate, and the sampling completion interrupt signal cannot be output.

[0123] Please refer to Figure 10 The control circuit also includes a temperature warning sub-circuit, and the above configuration information is also used to configure the temperature warning range; the above interrupt control sub-circuit is used to: receive the mode selection signal and the temperature collected by the temperature sensor; receive the second-level sampling valid enable signal output by the temperature sensor to indicate that the temperature collected by the temperature sensor is valid data; and in response to the temperature collected by the temperature sensor being within the temperature warning range, output a temperature warning interrupt signal based on the mode selection signal and the second-level sampling valid enable signal.

[0124] The temperature warning interrupt signal is used to indicate the temperature status of the temperature sensor. This signal can be either a first-level or a second-level signal. A first-level temperature warning interrupt signal indicates that the temperature collected by the temperature sensor is outside the temperature warning range, meaning the temperature is within the normal temperature range. A second-level temperature warning interrupt signal indicates that the temperature collected by the temperature sensor is within the temperature warning range, meaning the temperature is within the abnormal temperature range. The first level can be high or low; if the first level is high, the second level is low, and vice versa. For example, if the temperature warning interrupt signal is low, it indicates that the temperature collected by the temperature sensor is within the normal temperature range; if the temperature warning interrupt signal is high, it indicates that the temperature collected by the temperature sensor is within the abnormal temperature range.

[0125] Based on the above description, the register circuit includes multiple registers. In some embodiments, these multiple registers may include a seventh register, which stores configuration information related to a temperature warning interruption signal. This configuration information configures an upper and lower temperature limit, indicating a temperature warning range. When the temperature sensor detects a temperature higher than the upper temperature limit or lower than the lower temperature limit, it indicates that the detected temperature is within the temperature warning range. For example, if the upper temperature limit configured in the seventh register is 100 degrees Celsius and the lower temperature limit is 10 degrees Celsius, then the temperature warning range is a temperature range indicated by a temperature greater than 100 degrees Celsius or less than 10 degrees Celsius.

[0126] When the temperature collected by the temperature sensor is within the temperature warning range, the process of outputting a temperature warning interrupt signal based on the mode selection signal and the second-level sampling enable signal includes: responding to the temperature sampling mode indicated by the mode selection signal being any of the first sampling modes, and the temperature collected by the temperature sensor being within the temperature warning range, generating a second-level temperature warning interrupt signal when a transition edge of the sampling enable signal from the first level to the second level is detected, and outputting the second-level temperature warning interrupt signal at least one clock cycle after detecting the transition edge of the sampling enable signal from the first level to the second level, to indicate that the temperature collected by the temperature sensor is in an abnormal temperature range.

[0127] Based on the above description, the first level can be either low or high. When the first level is low, the transition edge of the sampling enable signal from the first level to the second level refers to the rising edge of the sampling enable signal, that is, the moment when the sampling enable signal changes from low to high. When the first level is high, the transition edge of the sampling enable signal from the first level to the second level refers to the falling edge of the sampling enable signal, that is, the moment when the sampling enable signal changes from high to low.

[0128] The above-mentioned interval can be one clock cycle or multiple clock cycles, as detailed in the above description, which will not be repeated here.

[0129] Based on the above description, the register circuit includes multiple registers. In some embodiments, these multiple registers may include an eighth register, which stores configuration information related to the temperature warning interrupt signal. This configuration information is used to configure whether the temperature warning interrupt function is enabled or disabled. That is, when the temperature warning interrupt function is enabled, the temperature warning sub-circuit operates, thereby outputting a temperature warning interrupt signal; conversely, when the temperature warning interrupt function is disabled, the temperature warning sub-circuit does not operate, and therefore cannot output a temperature warning interrupt signal. For example, if the configuration information written to the eighth register is 1, the temperature warning interrupt function is enabled, the temperature warning sub-circuit operates, and outputs a temperature warning interrupt signal; if the configuration information written to the eighth register is 0, the temperature warning interrupt function is disabled, the temperature warning sub-circuit does not operate, and therefore cannot output a temperature warning interrupt signal.

[0130] To avoid the randomness of single sampling, in some embodiments, the temperature warning interruption function is mostly applied in continuous sampling mode or interval continuous sampling mode. For example, if the temperature sensor collects five consecutive temperatures that are all within the temperature warning range, then the chip is confirmed to be overheated.

[0131] In the temperature detection circuit provided in this application embodiment, the register circuit is used to parse the configuration information, and the control circuit controls the temperature sensor based on the parsed data, causing it to sample the temperature according to the specified temperature sampling mode. The temperature sensor is used to complete the temperature acquisition. In other words, this application embodiment implements temperature data processing and decision-making through hardware circuitry. The entire path is implemented by hardware logic, which not only effectively shortens data latency but also eliminates the unnecessary energy consumption caused by software polling, thus effectively improving the overall energy efficiency of the system. Specifically, this application embodiment implements the entire path from temperature data acquisition to output interrupt entirely through hardware circuitry, achieving microsecond-level, deterministic response latency and solving the problem of unpredictable software response time. Furthermore, in the above process, the central processing unit (CPU) only needs to configure parameters during initialization and execute the corresponding strategy after receiving an interrupt, without participating in the specific sampling process. This significantly reduces the CPU's utilization rate, thereby greatly reducing the CPU's load. Moreover, the static and dynamic power consumption of the hardware circuitry is far lower than the power consumption of the CPU running software with the same functions, and the unnecessary energy consumption caused by software polling is eliminated, improving the overall system energy efficiency.

[0132] This application also provides a chip equipped with the temperature detection circuit described in the above embodiments. This temperature detection circuit is connected to the system bus via a digital interface. That is, the temperature detection circuit can be connected to the system bus as a hardware IP address via a digital interface.

[0133] Since this temperature detection circuit can be used as a standalone hardware IP, it can be integrated with analog IPs of temperature sensors from different suppliers and with different interfaces in a "plug-and-play" manner, which greatly improves design reusability, effectively accelerates product development time, and reduces development costs.

[0134] In some embodiments, the digital interface is typically a standard interface. For example, the digital interface may be an Advanced High-performance Bus (AHB) interface or an Advanced Peripheral Bus (APB) interface.

[0135] This application also provides a computer device that includes the aforementioned chip.

[0136] It should be noted that the temperature detection circuit provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the temperature detection circuit can be divided into different functional modules to complete all or part of the functions described above.

[0137] It should be understood that "at least one" as mentioned herein refers to one or more, and "multiple" refers to two or more. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. In addition, in order to clearly describe the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and the terms "first," "second," etc., are not necessarily different.

[0138] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0139] The above descriptions are embodiments provided in this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A temperature detection circuit, characterized in that, The temperature detection circuit includes a register circuit, a control circuit, and a temperature sensor; The register circuit is used to receive configuration information, which is used to configure the temperature sampling mode. The control circuit is used to control the temperature sensor according to the temperature sampling mode; The temperature sensor is used to collect temperature and output the collected temperature. The control circuit is also used to process the temperature collected by the temperature sensor.

2. The temperature detection circuit as described in claim 1, characterized in that, The control circuit includes a mode selection sub-circuit, an enable control sub-circuit, and a data processing sub-circuit. The mode selection sub-circuit is used to receive the mode selection signal corresponding to the temperature sampling mode; The enable control sub-circuit is used to receive a first-level enable control signal, and output a first-level temperature sampling enable signal based on the first-level enable control signal and the mode selection signal to activate the temperature sensor. The data processing sub-circuit is used to receive the temperature collected by the temperature sensor and process the temperature collected by the temperature sensor.

3. The temperature detection circuit as described in claim 1 or 2, characterized in that, The temperature sampling modes include single sampling mode, continuous sampling mode, average sampling mode, interval continuous sampling mode, or interval average sampling mode.

4. The temperature detection circuit as described in claim 2, characterized in that, The temperature sampling mode is a single sampling mode, a continuous sampling mode, or an interval continuous sampling mode. The data processing sub-circuit includes a format conversion sub-circuit, which is used to receive the temperature collected by the temperature sensor and convert the format of the temperature collected by the temperature sensor.

5. The temperature detection circuit as described in claim 4, characterized in that, The temperature sampling mode is a single sampling mode; the enable control subcircuit is also used for: The system receives a second-level sampling enable signal output by the temperature sensor to indicate that the temperature collected by the temperature sensor is valid data. Based on the sampling enable signal of the second level, output a temperature sampling enable signal of the second level and an enable control signal of the second level to turn off the temperature sensor.

6. The temperature detection circuit as described in claim 4, characterized in that, The temperature sampling mode is a continuous sampling mode; the enable control sub-circuit is also used for: In response to the temperature sensor acquiring a certain number of temperature samples in a continuous sampling period, if the mode selection signal is invalid or the control register value is a first value, a second-level temperature sampling enable signal and a second-level enable control signal are output to turn off the temperature sensor. The control register is used to configure the enable control signal.

7. The temperature detection circuit as described in claim 2, characterized in that, The temperature sampling mode is either a mean sampling mode or an interval mean sampling mode; the data processing sub-circuit includes a mean processing sub-circuit and a format conversion sub-circuit. The average value processing sub-circuit is used to receive the temperature collected by the temperature sensor, and in response to the temperature sensor collecting temperature a number of times and reaching the average sampling number, to determine the average value of the temperature collected by the temperature sensor multiple times and obtain the average temperature value. The format conversion sub-circuit is used to convert the format of the average temperature value.

8. The temperature detection circuit as described in claim 7, characterized in that, The temperature sampling mode is an average sampling mode; the average processing sub-circuit is also used for: Each time the temperature collected by the temperature sensor is received, a second-level sampling enable signal output by the temperature sensor is received to indicate that the temperature collected by the temperature sensor is valid data; In response to the temperature sensor acquiring temperature a number of times that the average number of samplings is reached, a second-level temperature sampling enable signal and a second-level enable control signal are output based on the last received second-level sampling valid enable signal to turn off the temperature sensor.

9. The temperature detection circuit as described in claim 4 or 7, characterized in that, The temperature sampling mode is either an interval continuous sampling mode or an interval average sampling mode; the control circuit also includes a delay sub-circuit; the configuration information is also used to configure the delay duration; The delay sub-circuit is used to receive a second-level sampling valid enable signal output by the temperature sensor to indicate that the temperature collected by the temperature sensor is valid data; each time the second-level sampling valid enable signal is received, a second-level delayed valid enable signal is output based on the second-level sampling valid enable signal to start the timing of the delay sub-circuit. The enable control sub-circuit is also used to receive the second level sampling valid enable signal, and each time the second level sampling valid enable signal is received, it outputs the second level temperature sampling enable signal based on the second level sampling valid enable signal to turn off the temperature sensor. The delay sub-circuit is also used to output a first-level delay-enabled signal when the timing ends; The enable control sub-circuit is also used to re-output a temperature sampling enable signal of the first level based on the first level delayed enable signal each time the first level delayed enable signal is received, so as to activate the temperature sensor.

10. The temperature detection circuit as described in claim 2, characterized in that, The control circuit further includes an interrupt control sub-circuit; the interrupt control sub-circuit is used for: Receive the mode selection signal; The system receives a second-level sampling enable signal output by the temperature sensor to indicate that the temperature data collected by the temperature sensor is valid. Based on the mode selection signal and the second level sampling enable signal, a sampling completion interrupt signal is output.

11. The temperature detection circuit as described in claim 2 or 10, characterized in that, The control circuit further includes a temperature warning sub-circuit, and the configuration information is also used to configure the temperature warning range; the interrupt control sub-circuit is used for: Receive the mode selection signal and the temperature collected by the temperature sensor; The system receives a second-level sampling enable signal output by the temperature sensor to indicate that the temperature data collected by the temperature sensor is valid. In response to the temperature collected by the temperature sensor being within the temperature warning range, a temperature warning interruption signal is output based on the mode selection signal and the second-level sampling valid enable signal.

12. A chip, characterized in that, The chip is equipped with a temperature detection circuit as described in any one of claims 1-11, and the temperature detection circuit is connected to the system bus via a digital interface.

13. A computer device, characterized in that, The computer device includes the chip of claim 12.