Metering circuit, working method thereof and electronic system
By introducing low-frequency and high-frequency oscillation modules into the metering circuit system, the auxiliary control module periodically detects environmental changes and extends the sleep state of the main control module, the high power consumption problem caused by frequent CPU wake-up is solved, and lower power consumption and Quick response effect.
Patent Information
- Application Number
- CN202310526126.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-10
- Publication Date
- 2024-11-12
AI Technical Summary
In existing metering circuit systems, the frequent wake-up of the CPU leads to large power consumption and affects the battery life. However, if the wake-up interval is extended, the system will respond slowly, resulting in poor customer experience.
By introducing low-frequency oscillation modules and high-frequency oscillation modules, the main control module cooperates with the auxiliary control module to periodically detect changes in the external environment, extend the time when the main control module is in a sleep state, avoid frequent wake-ups, and use auxiliary control modules and high-frequency oscillation modules to use auxiliary control modules and high-frequency oscillation modules Check with the analog-to-digital conversion module and wake up the main control module if necessary.
It realizes reducing system power consumption without affecting response speed, extending battery life, and improving the system's fast response capability.
Smart Images

Figure CN118937789A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power electronics, and in particular to a metering circuit and a working method thereof, and an electronic system. Background Art
[0002] In the metering circuit system, in order to ensure fast measurement and take into account the low power consumption requirements, the current popular practice is that the CPU (central processing unit) is periodically awakened and the high-frequency oscillator and ADC (analog-to-digital converter) are enabled to detect whether the sensor signal has changed. The specific implementation circuit is as follows Figure 1 shown.
[0003] If a change in the sensor signal is detected, the CPU measures the sensor signal through the ADC, and then performs corresponding calculations, processing and display; if no change in the sensor signal is detected, the CPU turns off the high-frequency oscillator and ADC and continues to enter the sleep state.
[0004] When the existing metering circuit system is working, the CPU is frequently awakened, and the operating current of the CPU and ROM (read-only memory) is large, which makes the system power consumption large, thereby shortening the battery life; but if the wake-up interval is extended, the system will respond slowly, resulting in a poor customer experience. Summary of the invention
[0005] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a metering circuit and a working method thereof, and an electronic system, so as to solve the problem of high system power consumption caused by frequent CPU wake-up in the prior art metering circuit system.
[0006] To achieve the above-mentioned object and other related objects, the present invention provides a metering circuit, the metering circuit comprising:
[0007] A low frequency oscillation module, used for generating a low frequency oscillation signal;
[0008] A high-frequency oscillation module, used for generating a high-frequency oscillation signal;
[0009] A main control module, connected to the low-frequency oscillation module and the high-frequency oscillation module respectively, and generating a conversion enable signal after entering a working state;
[0010] an analog-to-digital conversion module, connected to the high-frequency oscillation module and the main control module respectively, and configured to perform analog-to-digital conversion according to the conversion enable signal sent by the main control module to generate a conversion result and send the result to the main control module;
[0011] It also includes: an auxiliary control module, which is connected to the low-frequency oscillation module, the high-frequency oscillation module and the main control module respectively, and is used to trigger the generation of a conversion enable signal and a comparison enable signal according to the received low-frequency oscillation signal after the main control module sends out an auxiliary control enable signal; the main control module enters a sleep state from a working state after sending out the auxiliary control enable signal, and the analog-to-digital conversion module also performs analog-to-digital conversion according to the conversion enable signal sent out by the auxiliary control module to generate a conversion result;
[0012] A comparison module is respectively connected to the main control module, the analog-to-digital conversion module and the auxiliary control module, and is used for comparing the conversion result sent by the analog-to-digital conversion module with a set threshold after the auxiliary control module sends the comparison enable signal, generating a comparison result and sending it to the main control module; the main control module is also triggered to wake up from the sleep state to the working state according to the comparison result, and the auxiliary control enable signal is invalid after entering the working state.
[0013] Optionally, the metering circuit further includes: a threshold module, connected to the comparison module, and configured to provide the set threshold.
[0014] Optionally, the threshold module is also connected to the main control module, and the set threshold is set and written through the main control module.
[0015] Optionally, the low-frequency oscillation module is connected to the main control module, and the low-frequency oscillation module is controlled to be always turned on by a low-frequency enable signal sent by the main control module.
[0016] Optionally, the high-frequency oscillation module is connected to the main control module and the auxiliary control module, and the operation of the high-frequency oscillation module is controlled by a high-frequency enable signal issued by the main control module or the auxiliary control module; the conversion enable signal, the comparison enable signal and the high-frequency enable signal issued by the auxiliary control module are periodic enable signals, and the main control module is also used to set the number of clocks for the high and low levels of three periodic enable signals to last, and the auxiliary control module triggers the generation of three periodic enable signals by counting the clocks of the low-frequency oscillation signal, and sets the high level duration of the three periodic enable signals by counting the clocks of the high-frequency oscillation signal.
[0017] Optionally, the main control module is also used to set the conversion accuracy of the analog-to-digital conversion module; the analog-to-digital conversion module performs analog-to-digital conversion with a first conversion accuracy according to the conversion enable signal sent by the main control module, and performs analog-to-digital conversion with a second conversion accuracy according to the conversion enable signal sent by the auxiliary control module, wherein the first conversion accuracy is greater than the second conversion accuracy.
[0018] Optionally, the main control module includes: a central processing unit and a program memory, the central processing unit serves as a main control unit, and the program memory is used to store program instructions when the central processing unit is running.
[0019] The present invention also provides an electronic device, the electronic device comprising: a sensor and the metering circuit as described above;
[0020] The sensor is used to detect changes in the external environment and generate an external detection signal;
[0021] The metering circuit periodically detects changes in the external environment through the auxiliary control module, the fast frequency oscillation module, the analog-to-digital conversion module and the comparison module, and wakes up the main control module to measure and process the external detection signal when the external environment changes.
[0022] The present invention also provides a working method of the metering circuit as described above, the working method comprising:
[0023] Before the main control module enters the sleep state, the main control module controls the auxiliary control module to start up and allows the comparison module to wake up;
[0024] After the main control module enters the sleep state, the auxiliary control module periodically controls the high-frequency oscillation module, the analog-to-digital conversion module and the comparison module to perform periodic detection of changes in the external environment, and determines whether to wake up the main control module according to the comparison result;
[0025] After the main control module is awakened and enters the working state, the main control module controls the auxiliary control module to shut down, and controls the high-frequency oscillation module and the analog-to-digital conversion module to work, so as to measure and process the changes in the external environment.
[0026] Optionally, before the main control module enters the sleep state, the main control module is also used to set the conversion accuracy of the analog-to-digital conversion module to a second conversion accuracy; after the main control module is awakened and enters the working state, the main control module controls the analog-to-digital conversion module to operate with a first conversion accuracy, wherein the first conversion accuracy is greater than the second conversion accuracy.
[0027] Optionally, before the main control module enters the sleep state, the main control module is further configured to write the set threshold into the threshold module.
[0028] As described above, the metering circuit and its working method and electronic system of the present invention transfer the control right of periodic detection from the main control module to the auxiliary control module, and periodically detect the changes in the external environment through the auxiliary control module, high-frequency oscillation module, analog-to-digital conversion module and comparison module, and wake up the main control module when the external environment changes, which can extend the time when the main control module is in a sleep state, avoid the large standby power consumption caused by the frequent awakening of the main control module, and achieve lower power consumption while maintaining fast response. Compared with the prior art, under the premise of equal response speed, the power consumption of the present invention is lower; under the premise of equal power consumption, the response speed of the present invention is faster. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Shown is a schematic diagram of the structure of an existing metering circuit.
[0030] Figure 2 Shown is a schematic diagram of the structure of the metering circuit of the present invention.
[0031] Figure 3 Shown is a timing diagram of relevant signals in the metering circuit of the present invention when the CPU is in a sleep state.
[0032] Figure 4 It shows a timing diagram of relevant signals in the metering circuit of the present invention when the CPU is in a sleep state-working state-sleep state.
[0033] Figure 5 Shown is a schematic structural diagram of the electronic device of the present invention.
[0034] Component number description
[0035] 10 Electronic devices
[0036] 100 Metering circuit
[0037] 110 Low frequency oscillation module
[0038] 120 High frequency oscillation module
[0039] 130 Main control module
[0040] 140 analog-to-digital conversion module
[0041] 150 Auxiliary control module
[0042] 160 Comparison module
[0043] 170 Threshold Module
[0044] 200 Sensors DETAILED DESCRIPTION
[0045] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0046] See also Figures 2 to 5 It should be noted that the illustrations provided in this embodiment are only schematic illustrations of the basic concept of the present invention. Although the illustrations only show components related to the present invention and are not drawn according to the number, shape and size of components in actual implementation, the form, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the component layout may also be more complicated.
[0047] Embodiment 1
[0048] like Figure 2 As shown, this embodiment provides a metering circuit 100, including: a low-frequency oscillation module 110, a high-frequency oscillation module 120, a main control module 130, an analog-to-digital conversion module 140, an auxiliary control module 150 and a comparison module 160; further, it also includes: a threshold module 170. Among them,
[0049] The low frequency oscillation module 110 is used to generate a low frequency oscillation signal LRC. In this embodiment, the low frequency oscillation module 110 is always turned on after the metering circuit 100 is powered on.
[0050] As an example, the low frequency oscillation module 110 is connected to the main control module 130 , and the low frequency enable signal LRC_EN sent by the main control module 130 controls the low frequency oscillation module 110 to be always turned on and generate the low frequency oscillation signal LRC.
[0051] The high frequency oscillation module 120 is used to generate a high frequency oscillation signal HRC.
[0052] As an example, the high-frequency oscillation module 120 is connected to the main control module 130 and the auxiliary control module 150, and the high-frequency oscillation module 120 is controlled to work and generate the high-frequency oscillation signal HRC through the high-frequency enable signal HRC_EN1 issued by the main control module 130 or the high-frequency enable signal HRC_EN2 issued by the auxiliary control module 150. It should be noted that the specific frequency values of the low-frequency oscillation signal LRC and the high-frequency oscillation signal HRC are determined by actual application requirements, and this embodiment does not limit this.
[0053] The main control module 130 is connected to the low-frequency oscillation module 110 and the high-frequency oscillation module 120 respectively, generates a conversion enable signal ADC_EN1 after entering the working state and sends it to the analog-to-digital conversion module 140, and enters the sleep state from the working state after sending the auxiliary control enable signal AC_EN; the main control module 130 also receives the comparison result CMP_OUT sent by the comparison module 160, and triggers wake-up from the sleep state to the working state according to the comparison result CMP_OUT, and invalidates the auxiliary control enable signal AC_EN after entering the working state.
[0054] Among them, the main control module 130 uses the low-frequency oscillation signal LRC as its low-frequency clock and the high-frequency oscillation signal HRC as its working clock; of course, the main control module 130 can also divide and / or multiply the low-frequency oscillation signal LRC to generate oscillation signals of other frequency values. Similarly, the main control module 130 can also divide and / or multiply the high-frequency oscillation signal HRC to generate oscillation signals of other frequency values. This embodiment does not limit this. In actual applications, when the main control module 130 enters the sleep state, the clock signal involved is usually the low-frequency oscillation signal LRC; and when the main control module 130 enters the working state, the clock signal involved includes the high-frequency oscillation signal HRC in addition to the low-frequency oscillation signal LRC.
[0055] In this embodiment, when the main control module 130 is triggered to wake up according to the comparison result CMP_OUT issued by the comparison module 160, a high-level pulse is used as a valid trigger wake-up signal. Of course, a low-level pulse can also be used as a valid trigger wake-up signal, which has no substantial impact on this embodiment; if the comparison result CMP_OUT is a low-level signal, the low-level signal cannot trigger the main control module 130 to wake up. At this time, the main control module 130 continues to remain in the sleep state; if the comparison result CMP_OUT is a high-level pulse, the high-level pulse triggers the main control module 130 to wake up. At this time, the main control module 130 is awakened and enters the working state from the sleep state.
[0056] After the main control module 130 enters the working state from the sleep state, the main control module 130 will invalidate the auxiliary control enable signal AC_EN, such as turning off the auxiliary control module 150 by pulling down the auxiliary control enable signal AC_EN; in addition, the main control module 130 also generates a high-frequency enable signal HRC_EN1 and a conversion enable signal ADC_EN1, such as turning on the high-frequency oscillation module 120 by pulling up the high-frequency enable signal HRC_EN1, and turning on the analog-to-digital conversion module 140 by pulling up the conversion enable signal ADC_EN1; after the main control module 130 receives the conversion result ADC_OUT1 output by the analog-to-digital conversion module 140, the main control module 130 also calculates, processes and displays the conversion result ADC_OUT1.
[0057] When the main control module 130 is ready to enter the sleep state after processing the conversion result ADC_OUT1, the main control module 130 turns on the auxiliary control module 150 by pulling up the auxiliary control enable signal AC_EN to ensure that the auxiliary control module 150 is turned on when the main control module 130 is in the sleep state, and allows the comparison module 160 to wake up, that is, allows the comparison result CMP_OUT output by the comparison module 160 to be used as its trigger wake-up signal.
[0058] In the scheme recorded in the above embodiment, the main control module 130 does not set the conversion accuracy of the analog-to-digital conversion module 140; the external detection signal generated by the sensor when the main control module 130 is controlled is regarded as the first detection signal, and the external detection signal generated by the sensor when the auxiliary control module 150 is controlled is regarded as the second detection signal, and the analog-to-digital conversion module 140 performs analog-to-digital conversion on the first detection signal and the second detection signal with the same conversion accuracy (such as high conversion accuracy); however, in combination with actual application scenarios, the measurement of the second detection signal does not require accurate measurement results, and can be a fast measurement, while measuring the second detection signal with high conversion accuracy will reduce the circuit response speed and increase the circuit power consumption.
[0059] In order to improve the circuit response speed and reduce the circuit power consumption, the conversion accuracy of the analog-to-digital conversion module 140 can be set by the main control module 130, so that the conversion accuracy of the analog-to-digital conversion module 140 for the first detection signal is higher than the conversion accuracy of the second detection signal. In this embodiment, after the main control module 130 enters the working state from the sleep state, the main control module 130 turns on the analog-to-digital conversion module 140 and generates a first conversion configuration signal, and configures the conversion accuracy of the analog-to-digital conversion module 140 to the first conversion accuracy through the first conversion configuration signal; when the main control module 130 processes the conversion result ADC_OUT1 and prepares to enter the sleep state, the main control module 130 also generates a second conversion configuration signal, and configures the conversion accuracy of the analog-to-digital conversion module 140 to the second conversion accuracy through the second conversion configuration signal; wherein the first conversion accuracy is higher than the second conversion accuracy.
[0060] As an example, the main control module 130 includes: a central processing unit (CPU) and a program memory, wherein the CPU is used as a main control unit, and the program memory is used to store program instructions when the CPU is running. Specifically, the program memory is implemented by a read-only memory (ROM).
[0061] The analog-to-digital conversion module 140 is connected to the high-frequency oscillation module 120 and the main control module 130, respectively, and is used to perform analog-to-digital conversion according to the conversion enable signal ADC_EN1 sent by the main control module 130 to generate a conversion result ADC_OUT1 and send it to the main control module 130; the analog-to-digital conversion module 140 also performs analog-to-digital conversion according to the conversion enable signal ADC_EN2 sent by the auxiliary control module 150 to generate a conversion result ADC_OUT2 and send it to the comparison module 160. The analog-to-digital conversion module 140 is implemented by an analog-to-digital converter (ADC), and uses the high-frequency oscillation signal HRC as its working clock.
[0062] When the main control module 130 does not set the conversion accuracy of the analog-to-digital conversion module 140, the analog-to-digital conversion module 140 is controlled by the conversion enable signal ADC_EN1 issued by the main control module 130 or the conversion enable signal ADC_EN2 issued by the auxiliary control module 150 to perform analog-to-digital conversion with the same conversion accuracy to generate conversion results ADC_OUT1 and ADC_OUT2.
[0063] When the main control module 130 sets the conversion accuracy of the analog-to-digital conversion module 140, the analog-to-digital conversion module 140 performs analog-to-digital conversion of a first conversion accuracy according to the conversion enable signal ADC_EN1 issued by the main control module 130 and generates a conversion result ADC_OUT1, thereby completing the precise measurement of the external detection signal, and performs analog-to-digital conversion of a second conversion accuracy according to the conversion enable signal ADC_EN2 issued by the auxiliary control module 150 and generates a conversion result ADC_OUT2, thereby completing the rapid measurement of the external detection signal.
[0064] The auxiliary control module 150 is respectively connected to the low-frequency oscillation module 110, the high-frequency oscillation module 120 and the main control module 130, and is used to trigger the generation of a conversion enable signal ADC_EN2 and a comparison enable signal CMP_EN according to the received low-frequency oscillation signal LRC after the main control module 130 sends out the auxiliary control enable signal AC_EN; the auxiliary control module 150 also triggers the generation of a high-frequency enable signal HRC_EN2 according to the received low-frequency oscillation signal LRC.
[0065] As an example, the high-frequency enable signal HRC_EN2, the conversion enable signal ADC_EN2 and the comparison enable signal CMP_EN issued by the auxiliary control module 150 are periodic enable signals. The main control module 130 is also used to set the number of clocks for the high and low levels of the three periodic enable signals. The auxiliary control module 150 triggers the generation of the three periodic enable signals by counting the clocks of the low-frequency oscillation signal LRC, and sets the high level duration of the three periodic enable signals by counting the clocks of the high-frequency oscillation signal HRC.
[0066] Specifically, the main control module 130 sets the number of clocks that continue at a low level in one cycle to a first preset value and the number of clocks that continue at a high level to a second preset value for the high-frequency enable signal HRC_EN2; sets the number of clocks that continue at a low level in one cycle to a third preset value and the number of clocks that continue at a high level to a fourth preset value for the conversion enable signal ADC_EN2; and sets the number of clocks that continue at a low level in one cycle to a fifth preset value and the number of clocks that continue at a high level to a sixth preset value for the comparison enable signal CMP_EN.
[0067] The auxiliary control module 150 includes a first signal generating unit, a second signal generating unit and a third signal generating unit (not shown in the figure); the first signal generating unit is used to generate a periodic high-frequency enable signal HRC_EN2, wherein within one cycle, the length of the low level is obtained by clock counting the low-frequency oscillation signal LRC to a first preset value and jumps to a high level after completing the corresponding count, and the length of the high level is obtained by clock counting the high-frequency oscillation signal HRC to a second preset value; the second signal generating unit is used to generate a periodic conversion enable signal ADC_EN2, wherein within one cycle, The length of the low level is obtained by clock counting the low-frequency oscillation signal LRC to a third preset value and jumping to a high level after completing the corresponding count, while the length of the high level is obtained by clock counting the high-frequency oscillation signal HRC to a fourth preset value; the third signal generating unit is used to generate a periodic comparison enable signal CMP_EN, wherein, within one cycle, the length of the low level is obtained by clock counting the low-frequency oscillation signal LRC to a fifth preset value and jumping to a high level after completing the corresponding count, while the length of the high level is obtained by clock counting the high-frequency oscillation signal HRC to a sixth preset value.
[0068] For example, for the high-frequency enable signal HRC_EN2, within one cycle, the low level length is 1s and the high level length is 10ms; for the conversion enable signal ADC_EN2, within one cycle, the low level length is 1s and the high level length is 10ms; for the comparison enable signal CMP_EN, within one cycle, the low level length is 1s and the high level length is 0.1ms, etc.; Of course, the above high and low level lengths are only given as an example, and can also be designed to other values according to actual application requirements, which has no substantial impact on this embodiment. However, it should be noted that when designing the high and low level lengths, the high level lengths of the high-frequency enable signal HRC_EN2 and the conversion enable signal ADC_EN2 should be sufficient for the analog-to-digital conversion module 140 to output a relatively stable value, and the performance and average power consumption of the analog-to-digital conversion module 140 can be considered comprehensively, and the high level length of the comparison enable signal CMP_EN should be kept as much as possible before the falling edge of the conversion enable signal ADC_EN2, at which time the output value of the analog-to-digital conversion module 140 is relatively stable.
[0069] The comparison module 160 is connected to the main control module 130, the analog-to-digital conversion module 140 and the auxiliary control module 150 respectively, and is used to compare the conversion result ADC_OUT2 issued by the analog-to-digital conversion module 140 with the set threshold DREF to generate a comparison result CMP_OUT and send it to the main control module 130 after the auxiliary control module 150 sends a comparison enable signal CMP_EN.
[0070] As an example, the comparison module 160 is implemented using a comparator; the control end of the comparator is connected to the comparison enable signal CMP_EN issued by the auxiliary control module 150, the non-phase input end is connected to the conversion result ADC_OUT2 output by the analog-to-digital conversion module 140, the inverting input end is connected to the set threshold DREF output by the threshold module 170, and the output end generates a comparison result CMP_OUT.
[0071] In this embodiment, the comparator is controlled by the comparison enable signal CMP_EN to be turned on, and compares the conversion result ADC_OUT2 with the set threshold DREF; when the conversion result ADC_OUT2 is greater than the set threshold DREF, a high level pulse is output. At this time, the high level pulse serves as a valid trigger wake-up signal to trigger the main control module 130 to wake up; when the conversion result ADC_OUT2 is less than the set threshold DREF, a low level signal is output. At this time, the main control module 130 will not be triggered to wake up.
[0072] The threshold module 170 is connected to the comparison module 160 and is used to provide a set threshold DREF. Furthermore, the threshold module 170 is also connected to the main control module 130 and is used to set and write the set threshold DREF through the main control module 130.
[0073] As an example, the threshold module 170 is implemented by a threshold register, and the set threshold stored in the threshold register is set and written by the main control module 130 .
[0074] This embodiment also provides a working method of the metering circuit as described above. Figure 2 , see Figure 3 and Figure 4 , the working method of this embodiment is described; wherein, the working method includes the following steps.
[0075] Step 1) Before the main control module 130 enters the sleep state, the main control module 130 controls the auxiliary control module 150 to start up and allows the comparison module 160 to wake up, so as to transfer the control right of periodically enabling the high-frequency oscillation module 120, the analog-to-digital conversion module 140 and the comparison module 160 to the auxiliary control module 150. Furthermore, the main control module 130 is also used to write the set threshold DREF to the threshold module 170.
[0076] Step 2) After the main control module 130 enters the sleep state, the auxiliary control module 150 periodically controls the high-frequency oscillation module 120, the analog-to-digital conversion module 140 and the comparison module 160 to work, so as to periodically detect changes in the external environment, and decide whether to wake up the main control module 130 according to the comparison result; for example, when the comparison result is a low-level signal (i.e., the external environment has not changed), the main control module 130 is not awakened and continues to remain in the sleep state to reduce the overall power consumption, while the high-frequency oscillation module 120, the analog-to-digital conversion module 140 and the comparison module 160 continue to be awakened periodically to quickly detect changes in the external environment; when the comparison result is a high-level pulse (i.e., the external environment has changed), the main control module 130 is awakened.
[0077] Step 3) After the main control module 130 is awakened and enters the working state, the main control module 130 controls the auxiliary control module 150 to shut down, and controls the high-frequency oscillation module 120 and the analog-to-digital conversion module 140 to work, so as to measure and process the changes in the external environment.
[0078] In the above working method, the two analog-to-digital conversions involved in step 2) and step 3) are performed by the analog-to-digital conversion module 140 with the same conversion accuracy, which will reduce the response speed. In the design, the analog-to-digital conversion module 140 can complete the two analog-to-digital conversions with different conversion accuracy, such as the second conversion accuracy involved in step 2) is lower than the first conversion accuracy involved in step 3). At this time, the following adjustments are made to the above working method:
[0079] In step 1), before the main control module 130 enters the sleep state, the main control module 130 also sets the conversion accuracy of the analog-to-digital conversion module 140 to the second conversion accuracy, such as the main control module 130 configures the conversion accuracy of the analog-to-digital conversion module 140 to the second conversion accuracy by generating a second conversion configuration signal.
[0080] In step 2), after the main control module 130 enters the sleep state, the auxiliary control module 150 periodically controls the high-frequency oscillation module 120, the analog-to-digital conversion module 140 and the comparison module 160 to operate, wherein the analog-to-digital conversion module 140 performs analog-to-digital conversion on the external detection signal with a second conversion accuracy to achieve fast measurement.
[0081] In step 3), after the main control module 130 is awakened and enters the working state, the main control module 130 turns on the analog-to-digital conversion module 140 and sets its conversion accuracy to the first conversion accuracy, such as the main control module 130 configures the conversion accuracy of the analog-to-digital conversion module 140 to the first conversion accuracy by generating a first conversion configuration signal; thereafter, the analog-to-digital conversion module 140 performs analog-to-digital conversion on the external detection signal with the first conversion accuracy to achieve accurate measurement; wherein the first conversion accuracy is higher than the second conversion accuracy.
[0082] Embodiment 2
[0083] like Figure 5 As shown, this embodiment further provides an electronic device 10, comprising: a measuring circuit 100 and a sensor 200 as described in the first embodiment.
[0084] The sensor 200 is used to detect changes in the external environment and generate an external detection signal. It should be noted that the type of the sensor 200 should be selected according to actual application requirements, and this embodiment does not limit this; for example, the electronic device 10 is an electronic scale, and the sensor 200 is a weighing sensor, etc.
[0085] The metering circuit 100 periodically detects changes in the external environment through the auxiliary control module 150, the fast frequency oscillation module 120, the analog-to-digital conversion module 140 and the comparison module 160, and wakes up the main control module 130 to measure and process the external detection signal when the external environment changes. The specific working principle of the metering circuit 100 can be found in the first embodiment, which will not be repeated here.
[0086] In summary, a metering circuit and its working method and electronic system of the present invention transfer the control right of periodic detection from the main control module to the auxiliary control module, and perform periodic detection of external environmental changes through the auxiliary control module, high-frequency oscillation module, analog-to-digital conversion module and comparison module, and wake up the main control module when the external environment changes, which can extend the time when the main control module is in a sleep state, avoid the large standby power consumption caused by the frequent awakening of the main control module, and achieve lower power consumption while maintaining fast response. Compared with the prior art, under the premise of equal response speed, the power consumption of the present invention is lower; under the premise of equal power consumption, the response speed of the present invention is faster. Therefore, the present invention effectively overcomes the various shortcomings of the prior art and has a high industrial utilization value.
[0087] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A metering circuit, characterized in that: The metering circuit comprises: A low frequency oscillation module, used for generating a low frequency oscillation signal; A high-frequency oscillation module, used for generating a high-frequency oscillation signal; A main control module, connected to the low-frequency oscillation module and the high-frequency oscillation module respectively, and generating a conversion enable signal after entering a working state; an analog-to-digital conversion module, connected to the high-frequency oscillation module and the main control module respectively, and configured to perform analog-to-digital conversion according to the conversion enable signal sent by the main control module to generate a conversion result and send the result to the main control module; It also includes: an auxiliary control module, which is connected to the low-frequency oscillation module, the high-frequency oscillation module and the main control module respectively, and is used to trigger the generation of a conversion enable signal and a comparison enable signal according to the received low-frequency oscillation signal after the main control module sends out an auxiliary control enable signal; the main control module enters a sleep state from a working state after sending out the auxiliary control enable signal, and the analog-to-digital conversion module also performs analog-to-digital conversion according to the conversion enable signal sent out by the auxiliary control module to generate a conversion result; A comparison module is respectively connected to the main control module, the analog-to-digital conversion module and the auxiliary control module, and is used for comparing the conversion result sent by the analog-to-digital conversion module with a set threshold after the auxiliary control module sends the comparison enable signal, generating a comparison result and sending it to the main control module; the main control module is also triggered to wake up from the sleep state to the working state according to the comparison result, and the auxiliary control enable signal is invalid after entering the working state.
2. The metering circuit according to claim 1, characterized in that: The metering circuit further includes: a threshold module connected to the comparison module and configured to provide the set threshold.
3. The metering circuit according to claim 2, characterized in that: The threshold module is also connected to the main control module, and the set threshold is set and written through the main control module.
4. The metering circuit according to claim 1, characterized in that The low-frequency oscillation module is connected to the main control module, and the low-frequency oscillation module is controlled to be turned on all the time by a low-frequency enable signal sent by the main control module.
5. The metering circuit according to claim 1, characterized in that: The high-frequency oscillation module is connected to the main control module and the auxiliary control module, and the operation of the high-frequency oscillation module is controlled by the high-frequency enable signal issued by the main control module or the auxiliary control module; the conversion enable signal, the comparison enable signal and the high-frequency enable signal issued by the auxiliary control module are periodic enable signals, the main control module is also used to set the number of clocks for the high and low levels of the three periodic enable signals to last, and the auxiliary control module triggers the generation of three periodic enable signals by counting the clocks of the low-frequency oscillation signal, and sets the high level duration of the three periodic enable signals by counting the clocks of the high-frequency oscillation signal.
6. The metering circuit according to claim 1, characterized in that The main control module is also used to set the conversion accuracy of the analog-to-digital conversion module; the analog-to-digital conversion module performs analog-to-digital conversion with a first conversion accuracy according to the conversion enable signal sent by the main control module, and performs analog-to-digital conversion with a second conversion accuracy according to the conversion enable signal sent by the auxiliary control module, wherein the first conversion accuracy is greater than the second conversion accuracy.
7. The metering circuit according to any one of claims 1 to 6, characterized in that: The main control module includes: a central processing unit and a program memory. The central processing unit serves as a main control unit, and the program memory is used to store program instructions when the central processing unit is running.
8. An electronic device, characterized in that: The electronic device comprises: a sensor and a metering circuit as claimed in any one of claims 1 to 7; The sensor is used to detect changes in the external environment and generate an external detection signal; The metering circuit periodically detects changes in the external environment through the auxiliary control module, the fast frequency oscillation module, the analog-to-digital conversion module and the comparison module, and wakes up the main control module to measure and process the external detection signal when the external environment changes.
9. A method for operating a metering circuit according to any one of claims 1 to 7, characterized in that: The working method comprises: Before the main control module enters the sleep state, the main control module controls the auxiliary control module to start up and allows the comparison module to wake up; After the main control module enters the sleep state, the auxiliary control module periodically controls the high-frequency oscillation module, the analog-to-digital conversion module and the comparison module to perform periodic detection of changes in the external environment, and determines whether to wake up the main control module according to the comparison result; After the main control module is awakened and enters the working state, the main control module controls the auxiliary control module to shut down, and controls the high-frequency oscillation module and the analog-to-digital conversion module to work, so as to measure and process the changes in the external environment.
10. The operating method of the metering circuit according to claim 9, characterized in that: Before the main control module enters the sleep state, the main control module is also used to set the conversion accuracy of the analog-to-digital conversion module to a second conversion accuracy; after the main control module is awakened and enters the working state, the main control module controls the analog-to-digital conversion module to operate with a first conversion accuracy, wherein the first conversion accuracy is greater than the second conversion accuracy.
11. The operating method of the metering circuit according to claim 9, characterized in that: Before the main control module enters the sleep state, the main control module is further configured to write the set threshold into the threshold module.
