Clock self-correcting unit of ultra-low power consumption micro-control processor

文档序号:1295935 发布日期:2020-08-07 浏览:32次 中文

阅读说明:本技术 超低功耗微控制处理器时钟自校正单元 (Clock self-correcting unit of ultra-low power consumption micro-control processor ) 是由 庞伟 于 2020-04-08 设计创作,主要内容包括:本发明提供了一种超低功耗微控制处理器时钟自校正单元,所述超低功耗微控制处理器时钟自校正单元包括触发模块、待校正时钟源模块及校准模块,触发模块、待校正时钟源模块及校准模块接收时间基准;触发模块提供一触发信号至所述校准模块与所述待校正时钟源模块,所述待校正时钟源模块收到所述触发信号后,由休眠状态转换至校准工作状态;所述校准模块收到所述触发信号后,所述校准模块对所述待校正时钟源模块的时间进行多次校准,以调节待校正时钟源模块的时间值及时间频率,直至所述待校正时钟源模块获取基准时间;所述待校正时钟源模块为所述超低功耗微控制处理器提供基准时间,以使所述超低功耗微控制处理器根据所述基准时间与外部设备通信。(The invention provides a clock self-correcting unit of an ultra-low power consumption micro control processor, which comprises a trigger module, a clock source module to be corrected and a calibration module, wherein the trigger module, the clock source module to be corrected and the calibration module receive a time reference; the trigger module provides a trigger signal to the calibration module and the clock source module to be calibrated, and the clock source module to be calibrated is converted into a calibration working state from a dormant state after receiving the trigger signal; after the calibration module receives the trigger signal, the calibration module performs multiple times of calibration on the time of the clock source module to be calibrated so as to adjust the time value and the time frequency of the clock source module to be calibrated until the clock source module to be calibrated acquires the reference time; the clock source module to be corrected provides reference time for the ultra-low power consumption micro control processor, so that the ultra-low power consumption micro control processor communicates with external equipment according to the reference time.)

1. The clock self-correcting unit of the ultra-low power consumption micro control processor is characterized by comprising a trigger module, a clock source module to be corrected and a calibration module, wherein:

the trigger module, the clock source module to be corrected and the calibration module receive a time reference;

the trigger module provides a trigger signal to the calibration module and the clock source module to be calibrated, and the clock source module to be calibrated is converted from a dormant state to a calibration working state after receiving the trigger signal;

after the calibration module receives the trigger signal, the calibration module performs multiple times of calibration on the time of the clock source module to be calibrated so as to adjust the time value and the time frequency of the clock source module to be calibrated until the clock source module to be calibrated acquires the reference time;

the clock source module to be corrected provides reference time for the ultra-low power consumption micro control processor, so that the ultra-low power consumption micro control processor communicates with external equipment according to the reference time.

2. The clock self-calibration unit of claim 1, further comprising an input clock module, wherein the input clock module provides a clock source, and the triggering module, the clock source to be calibrated module and the calibration module use the clock source as a time reference.

3. The clock self-calibration unit of claim 2, wherein the input clock module is an external low-speed crystal oscillator or an external low-speed clock.

4. The ultra-low power microcontroller processor clock self-calibration unit of claim 3 wherein the trigger module comprises one or more of a software start sub-module, an external trigger sub-module, an auto-trigger sub-module, a timed trigger sub-module, wherein:

the software starting sub-module is used for directly and continuously sending the trigger signal to the calibration module and the clock source module to be corrected when the ultra-low power consumption micro-control processor works in a normal power consumption mode;

the external trigger submodule is used for continuously sending the trigger signal to the calibration module and the clock source module to be corrected after receiving an external interrupt signal when the ultra-low power consumption micro-control processor works in a sleep mode or a low power consumption mode;

the automatic trigger sub-module is used for continuously sending the trigger signal to the calibration module and the clock source module to be corrected after receiving a wake-up interrupt signal when the ultra-low power consumption micro-control processor works in a sleep mode;

and the timing trigger submodule is used for continuously sending the trigger signal to the calibration module and the clock source module to be corrected after receiving a timing interrupt signal of a timer when the ultra-low power consumption micro-control processor works in a low power consumption mode.

5. The clock self-calibration unit of claim 4, wherein the clock source module to be calibrated is an internal high-speed clock of the ultra-low power microcontroller processor or an internal low-speed clock of the ultra-low power microcontroller processor.

6. The ultra low power microcontroller processor clock self-correction unit of claim 5,

when the software starts the sub-module to work, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock;

when the external trigger submodule works, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock;

when the automatic trigger submodule works, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock;

and when the timing trigger submodule works, sending the trigger signal to the internal low-speed clock.

7. The ultra low power microcontroller processor clock self-correction unit of claim 2 wherein each calibration comprises:

acquiring a clock source time value and a clock source module time value to be corrected in real time;

the calibration module calculates the correction value of the clock source module to be corrected according to the clock source time value and the clock source module time value to be corrected, and sends the correction value to the clock source module to be corrected;

and the clock source module to be corrected adjusts the time value of the clock source module to be corrected according to the correction value of the clock source module to be corrected and sends the time value to the calibration module in real time.

8. The clock self-calibration unit of claim 7, wherein the calibration module further provides the clock source module to be calibrated with a clock frequency of a clock source, so that the clock source module to be calibrated approaches the clock frequency of the clock source step by step, or the clock source module to be calibrated directly uses the clock frequency of the clock source as its own clock frequency.

9. The ultra low power microcontroller processor clock self-correction unit of claim 8 wherein the calibration module sets one or more of a maximum number of corrections, a maximum total time of correction, a single correction time, a time value correction error threshold, and a time frequency correction error threshold, wherein:

when the time for the calibration module to perform multiple times of calibration on the time of the clock source module to be calibrated exceeds the maximum total correction time, triggering interruption by the calibration module; and/or

When the times of the calibration module for calibrating the time of the clock source module to be calibrated for multiple times exceed the maximum calibration times, triggering interruption by the calibration module; and/or

When the calibration module performs multiple times of calibration on the time value of the clock source module to be calibrated until the difference between the time value of the clock source module to be calibrated and the time value of the clock source is smaller than a time value calibration error threshold, triggering interruption by the calibration module; and/or

When the calibration module performs multiple times of calibration on the time value of the clock source module to be calibrated until the difference between the time frequency of the clock source module to be calibrated and the clock frequency of the clock source is smaller than a time frequency correction error threshold, triggering interruption by the calibration module;

and after receiving the interrupt signal, the ultra-low power consumption micro control processor is switched from the calibration working state to the calibration completion state.

10. The clock self-calibration unit of claim 9, wherein after the ultra-low power micro control processor enters the calibration complete state, the ultra-low power micro control processor provides the reference time for the external device as a clock source of the external device.

Technical Field

The invention relates to the technical field of microprocessors, in particular to a clock self-correcting unit of an ultra-low power consumption micro-control processor.

Background

At present, with the vigorous development of the internet of things, a large number of node devices are powered by batteries, so that due to the requirement of low power consumption, an ultra-low power consumption micro control processor (MCU) is used as a main control unit in the node devices, the node devices generally comprise a wireless communication module, and data collected by the main control unit are sent to a collector or gateway equipment through the wireless communication module (such as WIFI, GPS, GPRS and NB).

The low-power consumption micro-control processor is communicated with the wireless communication module through the serial port UART. Because some node equipment is in a severe environment (such as outdoor installation), the deviation of an internal clock is usually within +/-2% to +/-3% under the influence of high and low temperature (-40 ℃ -85 ℃) environments of the MCU. The serial port of the wireless communication module is also influenced by high and low temperature (-40-85 ℃) environments, and the deviation is about +/-2% -3%. In the communication process of the two serial ports, if the deviation superposition of the two sides exceeds 4%, the serial port communication is possibly abnormal.

Disclosure of Invention

The invention aims to provide a clock self-correcting unit of an ultra-low power consumption micro control processor, which aims to solve the problem that the serial port communication between the existing low power consumption micro control processor and external equipment is influenced by temperature.

In order to solve the above technical problem, the present invention provides an ultra-low power consumption clock self-calibration unit for a micro control processor, where the ultra-low power consumption clock self-calibration unit includes a trigger module, a clock source module to be calibrated, and a calibration module, where:

the trigger module, the clock source module to be corrected and the calibration module receive a time reference;

the trigger module provides a trigger signal to the calibration module and the clock source module to be calibrated, and the clock source module to be calibrated is converted from a dormant state to a calibration working state after receiving the trigger signal;

after the calibration module receives the trigger signal, the calibration module performs multiple times of calibration on the time of the clock source module to be calibrated so as to adjust the time value and the time frequency of the clock source module to be calibrated until the clock source module to be calibrated acquires the reference time;

the clock source module to be corrected provides reference time for the ultra-low power consumption micro control processor, so that the ultra-low power consumption micro control processor communicates with external equipment according to the reference time.

Optionally, the clock self-calibration unit of the ultra-low power consumption micro-control processor further includes an input clock module, the input clock module provides a clock source, and the trigger module, the clock source module to be calibrated, and the calibration module use the clock source as a time reference.

Optionally, in the clock self-correcting unit of the ultra-low power consumption micro-control processor, the input clock module is an external low-speed crystal oscillator or an external low-speed clock.

Optionally, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, the trigger module includes one or more of a software start sub-module, an external trigger sub-module, an automatic trigger sub-module, and a timing trigger sub-module, where:

the software starting sub-module is used for directly and continuously sending the trigger signal to the calibration module and the clock source module to be corrected when the ultra-low power consumption micro-control processor works in a normal power consumption mode;

the external trigger submodule is used for continuously sending the trigger signal to the calibration module and the clock source module to be corrected after receiving an external interrupt signal when the ultra-low power consumption micro-control processor works in a sleep mode or a low power consumption mode;

the automatic trigger sub-module is used for continuously sending the trigger signal to the calibration module and the clock source module to be corrected after receiving a wake-up interrupt signal when the ultra-low power consumption micro-control processor works in a sleep mode;

and the timing trigger submodule is used for continuously sending the trigger signal to the calibration module and the clock source module to be corrected after receiving a timing interrupt signal of a timer when the ultra-low power consumption micro-control processor works in a low power consumption mode.

Optionally, in the clock self-calibration unit of the ultra-low power consumption micro control processor, the clock source module to be calibrated is an internal high-speed clock of the ultra-low power consumption micro control processor or an internal low-speed clock of the ultra-low power consumption micro control processor.

Optionally, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, when the software starts the sub-module to work, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock;

when the external trigger submodule works, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock;

when the automatic trigger submodule works, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock;

and when the timing trigger submodule works, sending the trigger signal to the internal low-speed clock.

Optionally, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, each calibration includes:

acquiring a clock source time value and a clock source module time value to be corrected in real time;

the calibration module calculates the correction value of the clock source module to be corrected according to the clock source time value and the clock source module time value to be corrected, and sends the correction value to the clock source module to be corrected;

and the clock source module to be corrected adjusts the time value of the clock source module to be corrected according to the correction value of the clock source module to be corrected and sends the time value to the calibration module in real time.

Optionally, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, the calibration module further provides a clock frequency of a clock source for the clock source module to be calibrated, so that the clock frequency of the clock source module to be calibrated gradually approaches the clock frequency of the clock source, or the clock source module to be calibrated directly uses the clock frequency of the clock source as the clock frequency of the clock source.

Optionally, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, the calibration module sets one or more of a maximum calibration time, a maximum total calibration time, a single calibration time, a time value calibration error threshold, and a time frequency calibration error threshold, where:

when the time for the calibration module to perform multiple times of calibration on the time of the clock source module to be calibrated exceeds the maximum total correction time, triggering interruption by the calibration module; and/or

When the times of the calibration module for calibrating the time of the clock source module to be calibrated for multiple times exceed the maximum calibration times, triggering interruption by the calibration module; and/or

When the calibration module performs multiple times of calibration on the time value of the clock source module to be calibrated until the difference between the time value of the clock source module to be calibrated and the time value of the clock source is smaller than a time value calibration error threshold, triggering interruption by the calibration module; and/or

When the calibration module performs multiple times of calibration on the time value of the clock source module to be calibrated until the difference between the time frequency of the clock source module to be calibrated and the clock frequency of the clock source is smaller than a time frequency correction error threshold, triggering interruption by the calibration module;

and after receiving the interrupt signal, the ultra-low power consumption micro control processor is switched from the calibration working state to the calibration completion state.

Optionally, in the clock self-calibration unit of the ultra-low power consumption micro control processor, after the ultra-low power consumption micro control processor enters the calibration completion state, the ultra-low power consumption micro control processor provides the reference time for the external device as a clock source of the external device.

In the clock self-correcting unit of the ultra-low power consumption micro-control processor provided by the invention, a trigger module, a clock source module to be corrected and a correcting module are used for receiving a time reference, the trigger module provides a trigger signal to the correcting module and the clock source module to be corrected, the clock source module to be corrected is converted into a correcting working state from a dormant state after receiving the trigger signal, the correcting module performs multiple times of correction on the time of the clock source module to be corrected after receiving the trigger signal so as to adjust the correcting value of the clock source module to be corrected, the clock source module to be corrected acquires a new clock frequency and gradually approaches the clock frequency of a clock source until a reference time is acquired, the clock source module to be corrected provides the reference time for the ultra-low power consumption micro-control processor so that the ultra-low power consumption micro-control processor communicates with an external device according to the reference time, and the communication between the low power consumption micro-control processor and the external device is based on, the application problem caused by inaccurate clock precision in the low-power consumption micro-control processor at high and low temperatures is solved.

Drawings

FIG. 1 is a schematic diagram of a clock self-calibration unit of a conventional ultra-low power consumption micro-control processor;

FIG. 2 is a schematic diagram of a clock self-calibration unit of an ultra-low power consumption micro-control processor according to an embodiment of the present invention;

shown in the figure: 11-external low-speed crystal oscillator; 12-an external low speed clock; 20-a trigger module; 30-clock source module to be corrected; 40-a calibration module; 50-low power microcontroller processor core.

Detailed Description

The clock self-calibration unit of the ultra-low power consumption micro-control processor provided by the invention is further described in detail with reference to the attached drawings and specific embodiments. Advantages and features of the present invention will become apparent from the following description and from the claims. It is to be noted that the drawings are in a very simplified form and are not to precise scale, which is merely for the purpose of facilitating and distinctly claiming the embodiments of the present invention.

The invention provides a clock self-correcting unit of an ultra-low power consumption micro control processor, which aims to solve the problem that the serial port communication between the existing low power consumption micro control processor and external equipment is influenced by temperature.

As shown in fig. 1, the deviation of the external high-speed crystal oscillator due to the influence of the high and low temperatures is 50ppm under the influence of the temperature environment. The micro control processor adopts an external high-speed clock crystal oscillator to generate a clock as a serial port UART clock, and the phenomenon of abnormal serial port communication can be solved. Due to limited size and cost considerations, some node devices cannot provide an external high-speed crystal oscillator clock to the MCU. Low power node devices mostly require an external low speed clock, for example: a 32.768KHz clock crystal oscillator serves as the clock source for the RTC (Real _ TimeClock, a clock chip) clock.

For this phenomenon, there are generally two solutions:

the first scheme is as follows: the low power consumption micro controller processor 200 communicating with the wireless communication module 300 can correct the internal high speed clock 202 by means of the external low speed clock 100 and the internal self-correcting unit 201, reducing the internal clock 202 deviation. Because the node equipment has the characteristic of ultra-low power consumption, the MCU is in a low power consumption mode most of the time and cannot correct the internal clock all the time. Currently, most MCUs integrate a clock correction mechanism internally for this phenomenon. After the MCU wakes up, the internal high-speed clock is corrected by a software method in a normal working mode. Since the calibration mechanism requires multiple calibrations to achieve the high accuracy requirement, at least 125ms to 500ms is required. Meanwhile, the correction mechanism needs to work in a normal working mode, and needs a certain time, so that the corresponding power consumption is increased.

In the second scheme, the low-power consumption micro-control processor 200 is used as a serial port peripheral clock after frequency multiplication by an external low-speed clock 100 (the clock frequency is 32.768KHz) P LL.

Aiming at the problem of abnormal serial port communication under high and low temperature at present, the invention provides a built-in clock self-correction unit mechanism of the ultra-low power consumption micro-control processor, so that software intervention is reduced, hardware automatically finishes internal clock correction, and the module can work in a low power consumption mode.

In order to realize the idea, the invention provides an ultra-low power consumption micro control processor clock self-correcting unit, which comprises a trigger module, a clock source module to be corrected and a calibration module, wherein: the trigger module, the clock source module to be corrected and the calibration module receive a time reference; the trigger module provides a trigger signal to the calibration module and the clock source module to be calibrated, and the clock source module to be calibrated is converted from a dormant state to a calibration working state after receiving the trigger signal; after the calibration module receives the trigger signal, the calibration module performs multiple times of calibration on the time of the clock source module to be calibrated so as to adjust the time value and the time frequency of the clock source module to be calibrated until the clock source module to be calibrated acquires the reference time; the clock source module to be corrected provides reference time for the ultra-low power consumption micro control processor, so that the ultra-low power consumption micro control processor communicates with external equipment according to the reference time.

< example one >

The present embodiment provides an ultra-low power consumption micro control processor clock self-calibration unit, as shown in fig. 2, the ultra-low power consumption micro control processor clock self-calibration unit includes a trigger module 20, a clock source module 30 to be calibrated, and a calibration module 40, wherein: the triggering module 20, the clock source module to be corrected 30 and the calibration module 40 receive a time reference; the trigger module 20 provides a trigger signal to the calibration module 40 and the clock source module 30 to be calibrated, and the clock source module 30 to be calibrated switches from a sleep state to a calibration working state after receiving the trigger signal, wherein the calibration working state includes a calibration-only state, a time providing state while calibrating, a time providing state after calibrating, and the like; after the calibration module 40 receives the trigger signal, the calibration module 40 performs multiple calibrations on the time of the clock source module 30 to be calibrated, so as to adjust the time value and the time frequency of the clock source module 30 to be calibrated until the clock source module 30 to be calibrated obtains the reference time; the clock source module 30 to be corrected provides a reference time for the ultra-low power consumption micro control processor, so that the ultra-low power consumption micro control processor communicates with an external device according to the reference time.

In an embodiment of the present invention, the clock self-calibration unit of the ultra-low power consumption micro control processor further includes an input clock module 10, the input clock module 10 provides a clock source, and the trigger module 20, the clock source module 30 to be calibrated, and the calibration module 40 use the clock source as a time reference.

Specifically, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, each calibration includes: acquiring a clock source time value and a clock source module time value to be corrected in real time; the calibration module 40 calculates the clock source module correction value to be corrected according to the clock source time value and the clock source module time value to be corrected, and sends the clock source module correction value to be corrected to the clock source module 30 to be corrected; the clock source module to be corrected 30 adjusts the time value of the clock source module to be corrected according to the corrected value of the clock source module to be corrected, and sends the time value to the calibration module 40 in real time; and finishing the single calibration. In the clock self-calibration unit of the ultra-low power consumption micro-control processor, the calibration module 40 further provides a clock source clock frequency for the clock source module 30 to be calibrated, so that the clock source module time frequency to be calibrated gradually approaches the clock source clock frequency, or the clock source module 30 to be calibrated directly takes the clock source clock frequency as its own time frequency.

Further, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, the calibration module 40 sets one or more of a maximum calibration time, a maximum total calibration time, a single calibration time, a time value calibration error threshold and a time frequency calibration error threshold, wherein: when the time for the calibration module 40 to calibrate the time of the clock source module 30 to be calibrated for multiple times exceeds the maximum total calibration time, the calibration module 40 triggers an interrupt; and/or when the number of times that the calibration module 40 performs multiple calibrations on the time of the clock source module 30 to be corrected exceeds the maximum number of times of correction, the calibration module 40 triggers an interrupt; and/or when the calibration module 40 performs multiple calibrations on the time value of the clock source module 30 to be calibrated until the difference between the time value of the clock source module 30 to be calibrated and the time value of the clock source is smaller than a time value calibration error threshold, the calibration module 40 triggers an interrupt; and/or when the calibration module 40 performs multiple calibrations on the time value of the clock source module 30 to be calibrated until the difference between the time frequency of the clock source module 30 to be calibrated and the clock frequency of the clock source is smaller than the time frequency correction error threshold, the calibration module 40 triggers an interrupt; and after receiving the interrupt signal, the ultra-low power consumption micro control processor is switched from the calibration working state to the calibration completion state. According to the embodiment, the maximum correction time, the maximum correction times and the error threshold are specified, correction can be flexibly performed according to actual correction requirements, and once the correction requirements are met, correction can be finished at the highest speed.

In addition, in the clock self-calibration unit of the ultra-low power consumption micro control processor, after the ultra-low power consumption micro control processor enters the calibration completion state, the ultra-low power consumption micro control processor (the kernel 50) provides the reference time for the external device as a clock source of the external device. In the clock self-correcting unit of the ultra-low power consumption micro control processor, the external equipment comprises a wireless communication module, gateway equipment, a data acquisition unit and an upper computer. In the clock self-calibration unit of the ultra-low power consumption micro-control processor, the input clock module 10 is an external low-speed crystal oscillator 11 or an external low-speed clock 12, the crystal oscillator frequency of the external low-speed crystal oscillator 11 (for example, an X32K clock crystal oscillator) or the clock frequency of the external low-speed clock 12 is 32.768kHz, and the precision range of the input clock module 10 is 50 ppm. The input clock module is a high-precision clock source provided by the outside: the external low-speed 32.768KHz crystal oscillator, the external input low-speed clock two choose one. Since the clock accuracy of the external crystal oscillator is within 50ppm at high and low temperatures, it can be considered that the accuracy does not change with high and low temperatures. In the clock self-calibration unit of the ultra-low power consumption micro control processor, the clock source module 30 to be calibrated is an internal high-speed clock of the ultra-low power consumption micro control processor (core 50) or an internal low-speed clock of the ultra-low power consumption micro control processor, and the clock frequency of the internal high-speed clock is between 4MHz and 16 MHz. The clock frequency of the internal low-speed clock is between 40kHz and 128 kHz.

Specifically, in the clock self-calibration unit of the ultra-low power consumption micro-control processor, the trigger module 20 includes one or more of the following modules: software opens submodule, outside trigger submodule, automatic trigger submodule, regularly triggers submodule, wherein: the software starting sub-module is used for directly and continuously sending the trigger signal to the calibration module 40 and the clock source module 30 to be corrected when the ultra-low power consumption micro-control processor works in a normal power consumption mode; the external trigger sub-module is configured to, when the ultra-low power consumption micro-control processor operates in a sleep mode or a low power consumption mode, continuously send the trigger signal to the calibration module 40 and the clock source module to be calibrated 30 after receiving an external interrupt signal; the automatic trigger sub-module is configured to, when the ultra-low power consumption micro-control processor operates in a sleep mode, continuously send the trigger signal to the calibration module 40 and the clock source module to be calibrated 30 after receiving a wakeup interrupt signal; the timing trigger sub-module is configured to, when the ultra-low power consumption micro-control processor operates in a low power consumption mode, receive a timing interrupt signal of a timer and continuously send the trigger signal to the calibration module 40 and the clock source module 30 to be corrected.

In an embodiment of the present invention, when the timing trigger sub-module continuously sends the trigger signal to the clock source module 30 to be corrected, and the clock source module 30 to be corrected may be in a calibration-only state, the clock source module 30 to be corrected may perform timing and periodic calibration in a low power consumption mode, but may not be temporarily sent to the ultra-low power consumption micro control processor for use, and the ultra-low power consumption micro control processor may maintain a sleep state, and once the ultra-low power consumption micro control processor wakes up and needs a precise reference time, the ultra-low power consumption micro control processor may timely obtain the reference time from the clock source module 30 to be corrected, and does not need field calibration.

In an embodiment of the present invention, when the external trigger submodule receives the external interrupt signal and then continuously sends the trigger signal to the clock source module 30 to be calibrated, the clock source module 30 to be calibrated may be in a state of providing time after calibration, at this time, the clock source module 30 to be calibrated may enter the calibration program first after receiving the external calibration requirement, and provide the ultra-low power consumption micro control processor with the accurate reference time after the calibration is completed, so that the real-time performance of calibration is satisfied, the time loss is reduced, and the accurate time can be obtained.

In another embodiment of the present invention, when the software start sub-module directly and continuously sends the trigger signal to the clock source module 30 to be corrected, or the automatic trigger sub-module receives the wake-up interrupt signal and then continuously sends the trigger signal to the clock source module 30 to be corrected, the clock source module 30 to be corrected may be in a state of providing time while calibrating, at this time, the ultra-low power consumption micro control processor needs to use the reference time urgently, and if the reference time is obtained after the calibration is waited, program disorder of the ultra-low power consumption micro control processor or a task processing error may be caused, so that the two modules can effectively ensure that the reference time is provided to the ultra-low power consumption micro control processor by the clock source module 30 to be corrected at the first time.

In summary, through the cooperation of the sub-modules, not only can the time be corrected with low power consumption, but also the time can be corrected in time, and the time loss (the time loss caused by software intervention) is reduced. The multiple trigger sub-modules can work in different modes and start to work under different conditions, such as direct start of normal work, external interruption, wake-up interruption and timer interruption. For example, some sub-modules can correct both the internal high-speed clock and the internal low-speed clock, and some sub-modules only correct the low-speed clock, so that the final purposes of flexible configuration for some operation scenes, reduction of software interference and automatic starting and correction of a hardware mechanism can be achieved.

Further, in the clock self-correcting unit of the ultra-low power consumption micro-control processor, when the software starts the sub-module to work, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock; when the external trigger submodule works, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock; when the automatic trigger submodule works, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock; and when the timing trigger submodule works, sending the trigger signal to the internal low-speed clock.

In the clock self-correcting unit of the ultra-low power consumption micro-control processor provided by the invention, a clock source is provided by an input clock module 10, a trigger module 20, a clock source module 30 to be corrected and a calibration module 40 take a clock source as a time reference, the trigger module 20 provides a trigger signal to the calibration module 40 and the clock source module 30 to be corrected, the clock source module 30 to be corrected is converted to a calibration working state from a dormant state after receiving the trigger signal, the calibration module 40 performs multiple times of calibration on the time of the clock source module 30 to be corrected after receiving the trigger signal so as to adjust the correction value of the clock source module 30 to be corrected, the clock source module 30 to be corrected acquires a new clock frequency and gradually approaches the clock frequency of the clock source until the reference time is acquired, the clock source module 30 to be corrected provides the reference time for the ultra-low power consumption micro-control processor so that the ultra-low power consumption micro-control processor communicates with an external device according to the reference time, the communication between the low-power consumption micro-control processor and the external equipment is based on the reference time, and the application problem caused by inaccurate clock precision in the low-power consumption micro-control processor at high and low temperatures is solved.

In an embodiment of the invention, the clock self-correcting unit of the ultra-low power consumption micro control processor is connected with an external low-speed clock (for example, an external input clock provided by other MCUs) or an external low-speed crystal oscillator (for example, a 32.768Hz clock crystal oscillator commonly used by the MCUs) as an input clock module, the input clock module has the characteristics of external connection, stability and high accuracy, and the ultra-low power consumption micro control processor needs to be connected with the external low-speed clock or the external low-speed crystal oscillator in common application occasions, and the external low-speed clock or the external low-speed crystal oscillator is a necessary condition for ensuring the normal work of the MCUs.

In one embodiment of the invention, an automatic correction mechanism is employed to correct the internal clock. Clock self-correction principle: and selecting an accurate clock source to calibrate the inaccurate clock source, repeatedly calibrating, and adjusting the parameters of the inaccurate clock source until the frequency of the calibrated clock source meets the precision requirement.

The calibration module can automatically correct the internal high-speed clock after the trigger module wakes up the MCU by externally providing an external low-speed clock with the frequency of 32.768KHz or an external low-speed crystal oscillator, for example, when the software starts the sub-module to work, the trigger signal is sent to the internal high-speed clock or the internal low-speed clock, or the internal low-speed clock can be always corrected in a low power consumption mode, for example, when the timing trigger sub-module works, the trigger signal is sent to the internal low-speed clock. For communication with the speed lower than 9600bps and below, the MCU can use the internal low-speed clock without starting the internal high-speed clock, so that the power consumption can be effectively reduced. The method can be flexibly configured aiming at some operation scenes, reduces software intervention, and automatically starts correction by a hardware mechanism.

In a high-temperature and low-temperature environment, the clock correction module is arranged in the ultra-low power consumption micro-control processor, so that the internal clock precision can be automatically corrected, and the module can run in a low power consumption mode; aiming at the problem of abnormal serial port communication under high and low temperature at present, a built-in clock self-correction unit mechanism of the ultra-low power consumption micro-control processor is provided, software intervention is reduced, hardware automatically finishes internal clock correction work, and the module can work in a low power consumption mode; the internal correction mode of the traditional ultra-low power consumption micro-control processor is changed to be only single correction and only a software trigger mode; by using a linkage triggering mechanism, correction is realized without software intervention, the time of a normal working mode of the equipment is reduced, and the power consumption of the equipment is reduced.

In summary, the above embodiments have described in detail different configurations of the clock self-calibration unit of the micro control processor with ultra-low power consumption, and it is understood that the present invention includes but is not limited to the configurations listed in the above embodiments, and any modifications based on the configurations provided by the above embodiments are within the scope of the present invention. One skilled in the art can take the contents of the above embodiments to take a counter-measure.

The above description is only for the purpose of describing the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention, and any variations and modifications made by those skilled in the art based on the above disclosure are within the scope of the appended claims.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种处理器阵列的授时方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!