CN115665836A - Calibration method for ensuring low-power Bluetooth time reference in deep sleep mode - Google Patents

Calibration method for ensuring low-power Bluetooth time reference in deep sleep mode Download PDF

Info

Publication number
CN115665836A
CN115665836A CN202211239465.3A CN202211239465A CN115665836A CN 115665836 A CN115665836 A CN 115665836A CN 202211239465 A CN202211239465 A CN 202211239465A CN 115665836 A CN115665836 A CN 115665836A
Authority
CN
China
Prior art keywords
bluetooth
clock
low
frequency
deep sleep
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211239465.3A
Other languages
Chinese (zh)
Inventor
王薇
王付维
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Beelinker Technology Co ltd
Original Assignee
Suzhou Beelinker Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Beelinker Technology Co ltd filed Critical Suzhou Beelinker Technology Co ltd
Priority to CN202211239465.3A priority Critical patent/CN115665836A/en
Publication of CN115665836A publication Critical patent/CN115665836A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a calibration method for ensuring low-power Bluetooth time reference in a deep sleep mode, which comprises the following steps of setting an active mode and a deep sleep mode in a Bluetooth system, designing a high-frequency master clock and a low-frequency clock in a Bluetooth link layer, and calibrating the method by the following steps: the active mode is switched to a deep sleep mode, the high-frequency main clock is closed, the low-frequency clock starts to take over the system, and counting is started; triggering and awakening, starting to exit from a deep sleep mode, and recording the actual sleep time under the low-frequency clock; the high-frequency master clock is started again, the system is taken over again, and the counter starts to count at high frequency; and awakening the interrupt service program to start calibration work, starting to calculate the compensation value of the Bluetooth time reference counter, and correcting the Bluetooth time reference according to the compensation value. The invention is suitable for the software and hardware design mode of the low-power-consumption Bluetooth link layer, realizes the function of the low-power-consumption Bluetooth link layer, ensures that the system can work normally when the modes are switched, and can also reduce the idle power consumption of the Bluetooth system.

Description

Calibration method for ensuring low-power-consumption Bluetooth time reference in deep sleep mode
Technical Field
The invention belongs to the field of digital integrated circuits and low-power-consumption Bluetooth communication, and particularly relates to a calibration method for ensuring a low-power-consumption Bluetooth time reference in a deep sleep mode.
Background
At the present time of continuous development of the internet of things, the idea of interconnection of everything goes into the heart and also permeates into various fields of society. Wireless communication technologies are also diverse nowadays, including NFC, UWB, bluetooth, zigBee, wiFi, and so on. As a wireless communication technology with a narrow transmission bandwidth and a short transmission distance, bluetooth is commonly applied to smart devices such as mobile phones, wristbands and watches. An important performance index of the equipment of the Internet of things is cruising ability, and the power consumption of the low-power Bluetooth chip is an important factor needing attention in design.
Bluetooth was first developed by ericsson in 1994, and the Bluetooth alliance (Bluetooth SIG) was established in 1998, which has greatly advanced the development of Bluetooth wireless technology and has begun to formulate a low-cost wireless specification that enables Bluetooth to be better applied to mobile devices connected over short distances and to market it. Compared with the common Bluetooth, the low-power Bluetooth has the advantages that the power consumption and the cost are reduced, the robustness is enhanced, and the Bluetooth technology obtains a wider application space. The low power and low energy consumption of the low power consumption Bluetooth, the convenient and safe connection and the like, so that the low power consumption Bluetooth chip can be used as sensor equipment in the Internet of things.
As one of the more complex parts of the bluetooth low energy architecture, it defines how two devices use radio frequencies for the transmission and exchange of information. The link layer includes detailed definitions of states, messages and channels, and also specifies the data broadcasting process, device discovery process, connection establishment, and the packet format, timing specification and interface protocol in various states. The link layer provides a logical transmission channel between two or more devices on the basis of the physical layer, which is irrelevant to the physical layer, thereby shielding the characteristics of the physical layer and avoiding the need of understanding the information of the physical layer by the link layer. The design of the link layer is a crucial step of the low-power-consumption bluetooth design, and the design mode can be full software, full hardware or a combination mode of the software and the hardware, and the three modes are different in thousands of years.
However, how to further reduce the power consumption of bluetooth low energy has a bottleneck in the development process, so a new technical solution is needed to solve the problem.
Disclosure of Invention
The purpose of the invention is as follows: in order to overcome the defects in the prior art, a calibration method for ensuring the low-power Bluetooth time reference in a deep sleep mode is provided, and the calibration method is suitable for a software and hardware design mode of a low-power Bluetooth link layer. In the mode, hardware design and software design are matched, so that the low-power-consumption Bluetooth link layer function is realized, the system is ensured to normally work when the modes are switched, and the idle power consumption of the Bluetooth system can be reduced.
The technical scheme is as follows: in order to achieve the above object, the present invention provides a calibration method for guaranteeing a bluetooth low energy time reference in a deep sleep mode, wherein an active mode and a deep sleep mode are set in a bluetooth system, and a high frequency master clock and a low frequency clock are designed in a bluetooth link layer, the calibration method comprises the following steps:
s1: the Bluetooth system is switched from an active mode to a deep sleep mode, the high-frequency master clock is closed, the low-frequency clock starts to take over the system, and counting is started;
s2: when the system reaches the set sleep time or the external event triggers to wake up, the system starts to exit the deep sleep mode and records the actual sleep time under the low-frequency clock;
s3: the high-frequency master clock is started again, the system is taken over again, and the counter starts to count at high frequency;
s4: the Bluetooth circuit sends a wakeup interrupt signal to the CPU, a wakeup interrupt service program starts calibration work, a compensation value of a Bluetooth time reference counter starts to be calculated, and the Bluetooth time reference is corrected according to the compensation value until the Bluetooth local time reference is completely recovered and then enters an active mode.
Further, the high frequency master clock and the low frequency clock generate two minimum time references of the bluetooth system, which are 625 microseconds and 1 microsecond respectively, and the reference clock of the counter of the bluetooth system is divided into a 312.5us reference clock and a 0.5us reference clock.
Further, the operation process of switching from the active mode to the deep sleep mode in step S1 is:
a1: configuring a sleep duration counter before switching, and informing the time required by deep sleep;
a2: a switching mode to transition from an active mode to a deep sleep mode;
a3: recording the value of a counter of 312.5us under the high-frequency main clock at the moment, and temporarily storing the value in a register CLKN for a subsequent awakening process;
a4: and the high-frequency master clock is turned off, the low-frequency clock is in an operating state all the time, and the low-frequency clock replaces the high-frequency master clock to maintain the local Bluetooth time reference of 312.5 us.
Further, the calculation formula of the actual sleep time under the low frequency clock in the step S2 is as follows:
T Sleep =T OSC *DEEPSLDUR (1)
wherein, T Sleep For actual deep sleep time, T OSC The low frequency clock is 32KHz period, DEEPSLDUR is the period number of the low frequency clock.
Further, the process of correcting the bluetooth time reference in step S4 is as follows:
calculating the time length of a 312.5us time reference in a deep sleep period under a low-frequency clock by using a formula (2), firstly calculating an integer part K of the time reference, storing the integer part K in a register CLKnORR, wherein the value range of the K is in the value range of a register CLKN used by 312.5us under an original high-frequency clock, namely 0 to 2^28-1, and a floor function is rounded downwards, so that the integer part of the used time to 312.5us can be calculated;
Figure BDA0003884572980000021
then, calculating a decimal part R of the passing time length of the 312.5us time reference under the low-frequency clock during the deep sleep period by using a formula (3), storing the decimal part R in a register FINECORR, wherein the value range of R is in a target register Fine Counter value range of 0.5us precision, namely 0 to 624, an int function is an integer algorithm, downwards taking the closest integer, and finally calculating the integral multiple of 0.5us precision, and converting the integral multiple into the integer to facilitate the storage of the register;
R=2*[312.5us-int(T Sleep -K*312.5us)] (3)
finally, the corrected correction value is reloaded into the original register of the bluetooth circuit, the 312.5us correction value reloads into the CLKN register by using the formula (4), because the correction is performed after the first 312.5us tick switched to high frequency arrives, the old value not only needs to add the compensation value (integer part K) but also needs to add 1, and then the 0.5us correction value (decimal part R) is directly loaded into the Fine Counter register, as shown in the formula (5):
CLKN new =CLKN old +CLKNCORR+1 (4)
Fine_Counter=FINECORR (5)
further, the criterion for the complete restoration of the local bluetooth time reference in step S4 is as follows:
after a first 312.5us tick comes after the high-frequency master clock is restarted, loading a corrected value into a 312.5us counter and a 0.5us counter, and counting from the corrected value;
waiting again for the arrival of the tick of 312.5us, both counters of 312.5us and 0.5us resume normal counting, after which the bluetooth local time reference is fully restored.
The invention selects a design mode combining software and hardware from the perspective of a chip design scheme. Based on data flow analysis, reasonable overall architecture design and module division are carried out on a hardware part from the low-power-consumption design requirement, and in view of the complexity of Bluetooth 5, the hardware part can use software to participate in design to realize functions, so that the power consumption is reduced from the system level; clock management is carried out in hardware design, and power consumption generated by a clock network is reduced as much as possible by gating a clock; according to the working characteristics of the Bluetooth, the use mode is switched, after the Bluetooth enters the deep sleep mode, the high-frequency clock is turned off, the low-frequency clock is used, the power consumption of the system is further reduced, and after the Bluetooth is awakened, the accuracy is guaranteed by using a calibration algorithm, and normal communication is guaranteed.
The invention can be suitable for the software and hardware design of the low-power-consumption Bluetooth link layer under each version. The method comprises a software algorithm part and a hardware design part, and the two parts are matched to finish the maintenance and calibration of the low-power-consumption Bluetooth time reference. The hardware part generates a clock of the low-power Bluetooth link layer module for the operation of each module; the calibration algorithm of the software part solves the time reference error phenomenon which occurs when the mode is switched.
The software and hardware coordination logic in the invention is as follows: the designed system can switch the active mode and the deep sleep mode according to the requirement so as to save the power consumption of the system. In the transition from the active mode to the deep sleep mode, turning off the high-frequency clock, maintaining the system by using the low-frequency clock, and simultaneously keeping the current value of the time register in the active mode; when the deep sleep mode is recovered to the active mode, the high-frequency clock can control the system again after waking up, and the software can calculate the error value through the calibration algorithm and compensate the counter, and finally the system is continuously maintained to operate by the calibration value.
The hardware module of the invention comprises: the low-power consumption Bluetooth link layer design uses two sets of high-frequency and low-frequency clocks, and the low-frequency clock is used for generating time processing signals required by a hardware circuit during mode switching. The bluetooth low energy protocol specifies two minimum time units, 625 microseconds and 1 microsecond, respectively, and the remaining various specified times are multiples of the two minimum time units. The timing generation module of the hardware generates two minimum time units by frequency division using high frequency (8M) and low frequency (32K), respectively.
In order to generate the required time reference, the timing generation module generates two minimum time references of the Bluetooth system, namely 625 microseconds and 1 microsecond, by using a master clock master1_ gclk and a low-power consumption clock low _ power _ clk. This configuration produces a minimum time reference of 312.5 microseconds and 0.5 microseconds for better synchronization with the software, facilitating implementation of the calibration algorithm and various controls for the software settings. Meanwhile, two time reference signals of 625 microseconds and 1 microsecond are generated by the two times in the hardware and are used as time references for event processing in the hardware. The 0.5 microsecond reference is derived from the master clock master1_ gclk by dividing it by half its frequency value, and 312.5 microseconds is similarly derived by dividing it, either from the master clock or from a low power consumption clock. In deep sleep mode, master1_ gclk will be turned off under the control of gate control enable signal, and turned on after waiting to wake up, and in sleep mode, reference time base of 312.5 microseconds will be generated by low power consumption clock. While in the active mode, master1_ gclk is continuously on.
The low power consumption Bluetooth 5.2 protocol of the invention uses two sets of clock precision requirements. During a connection, active scan, request connection, and BIG or CIG event, the active clock drifts to within + -50 ppm, the instantaneous timing and average timing drift must not exceed 2us, while the sleep clock drifts for other activities to within + -500 ppm, the instantaneous timing and average timing drift must not exceed 16us. The worst case drift and instantaneous deviation of the active clock should be less than or equal to the sleep clock. The protocol allows the crystal oscillator clock with lower power consumption to be selected and used when the Bluetooth device is in sleep, and the precision of the crystal oscillator clock is lower, and the drift time of the anchor point is considered. Therefore, during deep sleep, a 32KHz low-frequency clock with lower precision can be used for maintaining the local Bluetooth time reference, at the moment, the high-frequency clock can be turned off to reduce dynamic power consumption, and a power supply of a Bluetooth circuit can be cut off to save leakage power consumption. If the master is in active mode and the slave is in sleep mode, the worst case maximum drift between the two devices is 550ppm. If the two parties are in a connected state and the packet interaction time between the two parties is 4s, the drift will reach + -4 s × 550e (-6) = + -2.2 ms, which is about + -8 times of 312.5 us. If the master device and the slave device enter the sleep mode in the connected state, the worst case drift between the master device and the slave device reaches +/-1000 ppm, and the time is close to +/-4 s multiplied by 1000e (-6) = 4ms and is about +/-13 times of 312.5 us. Therefore, to solve various problems in dual modes, a calibration mechanism is necessary.
The software algorithm flow in the invention comprises the following steps: when the bluetooth circuit switches from deep sleep mode to active mode, the two important counters, 312.5us and 0.5us, the local time reference must be restored to the more accurate current time. The calibration algorithm converts the real deep sleep time into the compensation values of two counters of 312.5us and 0.5us, and calibrates and compensates two local time references after the first 312.5us tick comes after the wakeup operation, so that the local time references are finally recovered.
The specific correction method comprises the following steps: firstly, calculating actual deep sleep time which may be preset sleep time or time used by early awakening due to an external event, and multiplying the number of cycles of a low-frequency clock by frequency to obtain time; then, calculating an integral part of the duration of the 312.5 microsecond deep sleep time reference under the low-frequency clock by using a floor function; then calculate the fractional part of 312.5 microseconds; finally, the corrected value is compensated for the original counter, and the operation with the calibrated value is started.
Has the beneficial effects that: compared with the prior art, the low-power-consumption Bluetooth link layer is designed based on software and hardware, the working modes of the system are divided into an active mode and a deep sleep mode, and the calibration work can be well completed along with the switching of a high-frequency clock and a low-frequency clock during the mode switching, so that the time error problem during the mode switching is solved, the communication work with opposite-end equipment can be normally completed during the mode switching, data is not lost, the power consumption of the low-power-consumption Bluetooth idle state can be greatly reduced, the power supply can be turned off, the power consumption can be more thoroughly saved, and the normal realization of the functions of the link layer can be ensured.
Drawings
FIG. 1 is a diagram of the hardware circuit timing generation of the present invention;
FIG. 2 is a flow chart of mode switching of the present invention;
FIG. 3 is a timing diagram illustrating the active switching to deep sleep mode of the present invention;
FIG. 4 is a timing diagram illustrating deep sleep switching to active mode according to the present invention;
fig. 5 is a timing diagram of the calibration process of the present invention.
Detailed Description
The present invention is further illustrated by the following figures and specific examples, which are to be understood as illustrative only and not as limiting the scope of the invention, which is to be given the full breadth of the appended claims and any and all equivalent modifications thereof which may occur to those skilled in the art upon reading the present specification.
The invention provides a low power consumption Bluetooth hardware circuit, as shown in figure 1, the hardware circuit includes a timing generation module, the timing generation module uses a main clock master1_ gclk and a low power consumption clock low _ power _ clk to generate two minimum time references of a Bluetooth system, 625 microseconds and 1 microsecond. Clk _ sel in fig. 1 is determined by the clock frequency of master1_ gclk, the master1_ gclk clock is set to 8MHz, and clk _ sel is therefore also that value. The structure generates the minimum time reference of 312.5 microseconds and 0.5 microseconds, and aims to better synchronize with software and facilitate the realization of a calibration algorithm and various controls of software setting. Meanwhile, two time reference signals of 625 microseconds and 1 microsecond are generated by the two times in the hardware and are used as time references for event processing in the hardware. The 0.5 microsecond reference is derived from the master clock master1_ gclk by dividing it by half its frequency value, and 312.5 microseconds is similarly derived by dividing it, either from the master clock or from a low power consumption clock.
The invention also provides a software system of the low power consumption Bluetooth, which comprises an active mode and a deep sleep mode, and is mainly divided into two parts of switching from the active mode to the deep sleep mode and switching from the deep sleep mode to the active mode.
The power consumption is positively correlated with factors such as the transmission rate, the transmission time, the transmission power, the modulation efficiency and the like of data, and BLE also depends on long-time deep sleep, periodic awakening and data transmission to greatly reduce the average power consumption and prolong the endurance time in order to reduce the power consumption and can start from the aspects of reducing the transmission rate, reducing the transmission time, reducing the standby power consumption of non-transmission time, reducing the transmission power during transmission, improving the modulation efficiency and the like. The low-power consumption Bluetooth device has small working time ratio and is in an idle state for most of time, so that the Bluetooth system sets an active mode and a deep sleep mode on a chip mode. In the idle state, the device is put into a deep sleep mode to reduce power consumption. Besides, the link layer in the connected state can also enable the slave device to ignore data packets of the master device within a period of time, and the slave device enters the dormant state within the period of time, so that part of power consumption can also be reduced. In the switching between the deep sleep mode and the active mode, the device needs to ensure a certain precision, otherwise the connection will fail, or the two parties can no longer communicate. Therefore, a solution for maintaining the local time and calibration of bluetooth is urgently needed.
The bluetooth low energy 5.2 protocol in this embodiment uses two sets of clock accuracy requirements. During the connection, active scan, request connection, and BIG or CIG events, the active clock drifts to within + -50 ppm, the instantaneous timing and average timing drift must not exceed 2us, while the sleep clock drifts to within + -500 ppm for other activities, the instantaneous timing and average timing drift must not exceed 16us. The worst case drift and instantaneous deviation of the active clock should be less than or equal to the sleep clock. The protocol allows the crystal oscillator clock with lower power consumption to be selected and used when the Bluetooth device is in sleep, and the precision of the crystal oscillator clock is lower, and the drift time of the anchor point is considered. Therefore, during the deep sleep period, a 32KHz low-frequency clock with lower precision can be used for maintaining the local Bluetooth time reference, at the moment, the high-frequency clock can be turned off to reduce dynamic power consumption, and a power supply of a Bluetooth circuit can be cut off to save leakage power consumption.
There are two most important points in bluetooth low energy, a local time count of 312.5us and a local time count of 0.5 us. In the active mode, the count clock error of the 312.5us counter is maintained within ± 50ppm using an 8M high frequency clock, while during deep sleep, the 312.5us and 0.5us time references will be maintained using a 32KHz low frequency clock. And a retention time recorder is used under a low-frequency clock to record the sleep duration, and the link layer software corrects and recovers the Bluetooth local time again after the time passes through a calibration algorithm so as to ensure the Bluetooth local time precision, so that the communication can be continued correctly at the next Anchorpoint, and the data interaction can be carried out normally.
Based on the above, this embodiment provides a calibration method for guaranteeing a bluetooth low energy time reference in a deep sleep mode, where an active mode and a deep sleep mode are set in a bluetooth system, and a high-frequency master clock and a low-frequency clock are designed in a bluetooth link layer, and the calibration method includes the following steps:
under the non-transmission condition, the Active state is switched to the deep Sleep state to save power consumption, and at the moment, the high-frequency master clock of the Bluetooth circuit stops running to reduce the leakage current of the Bluetooth circuit. But in order to guarantee that the communication can be continued at the next agreed synchronization point Anchorpoint by both parties, the local bluetooth time must be kept, and the keeping process is carried out on a low-frequency clock of 32 KHz. The timing diagram is shown in fig. 3, and the steps are as follows:
1) A sleep duration counter is configured prior to the handoff to inform of the time needed for deep sleep.
2) And switching the mode from Active to Sleep.
3) The value of 312.5us at the high frequency master clock is recorded and buffered in register CLKN for use in subsequent wake-up processes.
4) The Bluetooth master clock is turned off to save power consumption, and the 32KHz low-frequency clock is always in an operating state, so that the local Bluetooth time 312.5us reference is maintained instead of the high-frequency master clock.
External events such as interruption and the like are achieved or are suddenly generated at the set deep Sleep time point, so that the module is awakened, the Bluetooth circuit is switched back to the Active state from the Sleep state, and a local Bluetooth time reference is required to be restored immediately after the module is awakened, and communication is guaranteed. The timing diagram is shown in fig. 4, and the steps are as follows:
1) And starting the high-frequency master clock, and recovering the master clock to be the system master control clock.
2) After waking up, the value that was stopped counting before is restored, the 312.5us value temporarily stored in the register is loaded back into the original Counter CLKN, and the value of the Counter of 0.5us under the low frequency clock is also loaded into the target register Fine Counter, and the Counter starts counting immediately.
3) The software recalibrates the values of the two counters 312.5us and 0.5us using a calibration algorithm and after the first 312.5us tick has come after the master clock has recovered, the corrective values are loaded into the two counters, after which the bluetooth time reference is calibrated and recovered.
4) Formally switching to the active mode and continuing the communication.
In this embodiment, the wake-up mode has two types, namely a natural set time and an external event trigger, and the difference is that the duration of the deep sleep mode is different. Under the condition of awakening by an external event, the actual event of circuit dormancy is small and the set deep dormancy time is short. This time will be used for the correction of the two counter values in the calibration algorithm.
When the bluetooth circuit switches from deep sleep mode to active mode, two important counters, 312.5us and 0.5us, the local time reference must be restored to the more accurate current time. The calibration algorithm converts the real deep sleep time into the compensation values of two counters of 312.5us and 0.5us, and calibrates and compensates two local time references after the first 312.5us tick comes after the wakeup operation, so that the local time references are finally recovered. The implementation is as follows.
The actual deep sleep time is first calculated. It may be a preset sleep time or a time used for waking up in advance due to an external event. Using equation (1), T _ Sleep is the actual deep Sleep time, T _ OSC is the low frequency clock 32KHz period, and DEEPSLDUR is the period number at the low frequency clock.
T Sleep =T OSC *DEEPSLDUR (1)
Then, the elapsed time of the 312.5us time reference in the deep sleep period under the low frequency clock is calculated by using equation (2), and the integer part K is calculated and stored in the register CLKNCORR. The value of K ranges from the value of the register CLKN used at 312.5us in the original high frequency clock, i.e., 0 to 2 < Lambda > 28-1. The floor function is rounded down so that the time spent can be calculated for the integer part of 312.5 us.
Figure BDA0003884572980000081
Then, the fractional part R of the elapsed time length in the deep sleep period 312.5us time reference and the low frequency clock is calculated by using the equation (3) and stored in the register FINECORR. The value range of R is in the target register Fine coupler value domain of 0.5us precision, namely 0 to 624. The int function is an integer algorithm, the nearest integer is taken down, the final calculated result is an integer multiple of 0.5us precision, and the integer is converted into an integer which is more convenient for storage of a register.
R=2*[312.5us-int(T Sleep -K*312.5us)] (3)
Finally, the corrected correction value is reloaded into an original register of the Bluetooth circuit, the correction value is reloaded into the CLKN register by using a 312.5us correction value through an equation (4), and because the correction is carried out after the tick of the first 312.5us switched to high frequency arrives, the old value not only needs to be added with a compensation value (an integer part K), but also needs to be added with 1. Then, the 0.5us correction value (fractional part R) is directly loaded into the Fine Counter register as shown in equation (5).
CLKN new =CLKN old +CLKNCORR+1 (4)
Fine_Counter=FINECORR (5)
Calibration timing from deep sleep to active mode capable of normal operation as shown in fig. 5, referring to fig. 2 and fig. 5, the operation process of the calibration method for guaranteeing bluetooth low energy time reference in deep sleep mode according to this embodiment can be summarized as the following steps:
1) The system enters a deep sleep mode, the high-frequency master clock of the Bluetooth circuit is closed, the low-frequency 32KHz clock starts to take over the system, and counting is started.
2) When the system reaches the set sleep time or the external event triggers to wake up, the system starts to exit the deep sleep mode and records the actual sleep event under the low-frequency clock.
3) The high frequency master clock is turned back on, the system is taken over again and the counter starts counting at high frequency.
4) The Bluetooth circuit sends a wakeup interrupt signal to the CPU, the wakeup interrupt service program starts calibration work, and the compensation value of the Bluetooth time reference counter starts to be calculated for correction.
5) After the first 312.5us tick comes after the high-frequency restart, the correction value is used to load a 312.5us counter and a 0.5us counter, and counting is started from the correction value.
6) Waiting again for the tick of 312.5us to come, both counters of 312.5us and 0.5us resume normal counting, after which the bluetooth local time reference is fully restored.
Based on the above scheme, in order to verify the practical effect of the scheme provided by the present invention, the power consumption data of the bluetooth low energy are compared in this embodiment. The link layer is the core of time sequence control in the communication process of the Bluetooth device, the power consumption of the link layer accounts for most of the total low-power Bluetooth power consumption, and the dynamic power consumption accounts for 70% -90% of the power consumption of the digital integrated circuit, so that compared with the two documents in recent years, the link layer module is required to have certain advantages in the aspect of dynamic power consumption.
The dynamic power consumption of the document hardware design of a low-power Bluetooth 4.0 link layer under the working voltage of 130nm technology, 8M clock and 1.08V is 0.96mW, and the dynamic power consumption of the document SoC platform design oriented to the application of the Internet of things under the working voltage of 55nm technology, 8M clock and 1.0V is 0.3mW. Finally, the dynamic power consumption of the invention is 0.3mW under the process of 40nm, the clock frequency of 8M and the working voltage of 1.0V. The details are shown in the following table.
Figure BDA0003884572980000091
Under the premise of realizing a low-power consumption Bluetooth 4.0 link layer, the two documents have different comprehensive conditions, so that the power consumption is slightly different. The link layer controller designed by the invention uses a calibration method for ensuring the low-power-consumption Bluetooth time reference in a deep sleep mode, and ensures correct functions while reducing the power consumption of a system. Compared with the standard paper, the comprehensive utilization process of the module is more advanced, the power consumption result is theoretically much lower than that of the standard paper, and finally, the actual power consumption index has more obvious advantages compared with the standard paper.

Claims (6)

1. A calibration method for ensuring low-power Bluetooth time reference in a deep sleep mode is characterized in that an active mode and a deep sleep mode are set in a Bluetooth system, a high-frequency master clock and a low-frequency clock are designed in a Bluetooth link layer, and the calibration method comprises the following steps:
s1: the Bluetooth system is switched from an active mode to a deep sleep mode, the high-frequency master clock is closed, the low-frequency clock starts to take over the system, and counting is started;
s2: when the system reaches the set sleep time or the external event triggers to wake up, the system starts to exit the deep sleep mode and records the actual sleep time under the low-frequency clock;
s3: the high-frequency master clock is started again, the system is taken over again, and the counter starts to count at high frequency;
s4: the Bluetooth circuit sends a wakeup interrupt signal to the CPU, the wakeup interrupt service program starts calibration work, starts to calculate the compensation value of the Bluetooth time reference counter, and corrects the Bluetooth time reference according to the compensation value until the Bluetooth local time reference is completely recovered and then enters an active mode.
2. The calibration method for guaranteeing bluetooth low energy time reference in deep sleep mode according to claim 1, wherein the high frequency master clock and the low frequency clock generate two minimum time references of the bluetooth system, which are 625 microseconds and 1 microsecond respectively, and the reference clock of the counter of the bluetooth system is divided into 312.5us reference clock and 0.5us reference clock.
3. The calibration method for guaranteeing bluetooth low energy time reference in deep sleep mode according to claim 1, wherein the operation procedure of switching from active mode to deep sleep mode in step S1 is as follows:
a1: configuring a sleep duration counter before switching to inform the time required by deep sleep;
a2: a switching mode to transition from an active mode to a deep sleep mode;
a3: recording the value of a counter of 312.5us under the high-frequency main clock at the moment, and temporarily storing the value in a register CLKN for a subsequent awakening process;
a4: and the high-frequency master clock is turned off, the low-frequency clock is in an operating state all the time, and the low-frequency clock replaces the high-frequency master clock to maintain the local Bluetooth time reference of 312.5 us.
4. The calibration method for guaranteeing the bluetooth low energy time reference in the deep sleep mode as claimed in claim 1, wherein the calculation formula of the actual sleep time under the low frequency clock in the step S2 is:
T sleep =T OSC *DEEPSLDUR (1)
wherein, T Sleep For actual deep sleep time, T OSC The low frequency clock is 32KHz period, DEEPSLDUR is the period number of the low frequency clock.
5. The calibration method for guaranteeing bluetooth low energy time reference in deep sleep mode according to claim 4, wherein the step S4 of correcting the bluetooth time reference comprises:
calculating the time length of a 312.5us time reference in a deep sleep period under a low-frequency clock by using a formula (2), firstly calculating an integer part K of the time length, storing the integer part K in a register CLKnORR, wherein the value range of the K is in the value range of a register CLKN used by 312.5us under an original high-frequency clock, and a floor function is rounded downwards, so that the integer part of the used time to 312.5us can be calculated;
Figure FDA0003884572970000021
then, calculating a decimal part R of the passing time length of the 312.5us time reference under the low-frequency clock in the deep sleep period by using a formula (3), storing the decimal part R in a register FINECORR, wherein the value range of R is in a target register Fine Counter value range of 0.5us precision, an int function is an integer algorithm, downwards taking the nearest integer, and finally calculating the result to be integral multiple of 0.5us precision;
R=2*[312.5us-int(T Sleep -K*312.5us)] (3)
finally, the corrected correction value is reloaded into an original register of the Bluetooth circuit, the 312.5us correction value reloads into a CLKN register by using a formula (4), because the correction is carried out after the first 312.5us tick switched to high frequency arrives, the old value not only needs to be added with a compensation value K, but also needs to be added with 1, and then 0.5us correction value R is directly loaded into a Fine Counter register, as shown in a formula (5):
CLKN new =CLKN old +CLKNCORR+1 (4)
Fine_Counter=FINECORR (5)。
6. the calibration method for guaranteeing bluetooth low energy time reference in deep sleep mode according to claim 1, wherein the criterion for fully recovering the bluetooth local time reference in step S4 is:
after the high-frequency master clock is restarted and the first 312.5us tick comes, the correction value is loaded into a 312.5us counter and a 0.5us counter, and counting is started from the correction value;
waiting again for the arrival of the tick of 312.5us, both counters of 312.5us and 0.5us resume normal counting, after which the bluetooth local time reference is fully restored.
CN202211239465.3A 2022-10-11 2022-10-11 Calibration method for ensuring low-power Bluetooth time reference in deep sleep mode Pending CN115665836A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211239465.3A CN115665836A (en) 2022-10-11 2022-10-11 Calibration method for ensuring low-power Bluetooth time reference in deep sleep mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211239465.3A CN115665836A (en) 2022-10-11 2022-10-11 Calibration method for ensuring low-power Bluetooth time reference in deep sleep mode

Publications (1)

Publication Number Publication Date
CN115665836A true CN115665836A (en) 2023-01-31

Family

ID=84987671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211239465.3A Pending CN115665836A (en) 2022-10-11 2022-10-11 Calibration method for ensuring low-power Bluetooth time reference in deep sleep mode

Country Status (1)

Country Link
CN (1) CN115665836A (en)

Similar Documents

Publication Publication Date Title
CN1130096C (en) Synchronisation of a low power clock in a wireless communication device
EP0865167B1 (en) Power saving scheme for a digital wireless communications terminal
JP4387473B2 (en) Method for clock calibration for radiotelephone and slotted paging mode in a CDMA radiotelephone system
KR101412676B1 (en) Control of sleep modes in a wireless transceiver
JP4696198B2 (en) Time base unit synchronization
US6691071B2 (en) Synchronizing clock enablement in an electronic device
JP2002026723A (en) Method and system for generating clock signal
JPH09121192A (en) Device and method for calling start logic of processor from low-power stopping mode after predetermined term in electronic system
CN103327586B (en) The synchronous method of wireless sensing net node suspend mode low power consumption protocol
KR20010102438A (en) Reduction of power consumption with increased standby time in wireless communications device
CN101155355A (en) Control method, device and equipment for sleeping mode of user&#39;s set
US7496774B2 (en) Method and system for generating clocks for standby mode operation in a mobile communication device
TW201519611A (en) Communication device and frequency bias calibrating method
KR100342637B1 (en) Cdma receiver comprising a synchronous timing notifying section capable of reaching low consumption of current
EP0924947A1 (en) Power saving in a digital cellular system terminal
CN115665836A (en) Calibration method for ensuring low-power Bluetooth time reference in deep sleep mode
CN110999417B (en) Low power supporting programmable hardware sleep cycle controller for 802.11 wireless devices
CN214480603U (en) Bluetooth clock circuit structure
US20040013167A1 (en) Low power RC clocking system for wireless communications
US11895588B2 (en) Timing precision maintenance with reduced power during system sleep
CN100358383C (en) Method of improving preciseness of mobile communication terminal low frequency crystal oscillator
CN201066913Y (en) 3G and 4G terminal dormant mode control device
CN113079497A (en) Calibration method and circuit structure of Bluetooth clock
JP2000049682A (en) Portable telephone terminal
CN106411444A (en) Timing compensation method and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination