Method for ensuring calibration of a low-power bluetooth time reference in deep sleep mode

By employing high- and low-frequency clock switching and calibration algorithms in the Bluetooth Low Energy link layer, the problems of power consumption and time reference in deep sleep mode are solved, achieving efficient communication and long battery life for the Bluetooth Low Energy system.

CN115665836BActive Publication Date: 2026-02-27SUZHOU BOLIAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211239465.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-11
Publication Date
2026-02-27
Estimated Expiration
2042-10-11

AI Technical Summary

Technical Problem

In existing technologies, Bluetooth Low Energy (BLE) struggles to effectively reduce power consumption and maintain time accuracy in deep sleep mode, leading to communication failures or data loss during mode switching.

Method used

The design adopts a combination of hardware and software, setting high-frequency and low-frequency clocks in the Bluetooth Low Energy link layer. Through mode switching and calibration algorithms, it ensures that the high-frequency clock is turned off in deep sleep mode, the low-frequency clock is used to maintain the time reference, and the counter is compensated and calibrated after waking up.

Benefits of technology

It reduces power consumption in the idle state in Bluetooth Low Energy systems, ensures the accuracy of the time base during mode switching, avoids communication failures, and extends device battery life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665836B_ABST
    Figure CN115665836B_ABST
Patent Text Reader

Abstract

The application discloses a method for calibrating low-power Bluetooth time reference in deep sleep mode, which comprises the following steps: setting active mode and deep sleep mode in a Bluetooth system, designing high-frequency master clock and low-frequency clock in a Bluetooth link layer, switching the active mode to the deep sleep mode, closing the high-frequency master clock, starting the low-frequency clock to take over the system and starting counting, triggering wake-up, starting to quit the deep sleep mode, recording actual sleep time under the low-frequency clock, restarting the high-frequency master clock to take over the system again and starting the counter to count under high frequency, starting calibration work by a wake-up interrupt service program, starting to calculate compensation value of the Bluetooth time reference counter, and modifying the Bluetooth time reference according to the compensation value. The application is applicable to the software and hardware design mode of the low-power Bluetooth link layer, realizes the low-power Bluetooth link layer function, ensures normal work of the system during mode switching, and can also reduce power consumption of the Bluetooth system in idle state.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of digital integrated circuits and low-power Bluetooth communication, and particularly relates to a calibration method for guaranteeing a low-power Bluetooth time reference in a deep sleep mode. BACKGROUND

[0002] In today's development of the Internet of Things, the idea of Internet of Everything is deeply rooted in people's minds and has penetrated into various fields of society. Wireless communication technologies are also relatively diverse today, including NFC, UWB, Bluetooth, ZigBee, WiFi, etc. Among them, Bluetooth, as a wireless communication technology with narrow transmission bandwidth and short transmission distance, is commonly used in smart devices such as mobile phones, bracelets and watches. An important performance indicator of Internet of Things devices is the endurance capability, and the power consumption of the low-power Bluetooth chip is an important factor that needs to be concerned in the design.

[0003] Bluetooth was first developed by Ericsson in 1994, and the Bluetooth Special Interest Group (Bluetooth SIG) was established in 1998, which greatly promoted the development of Bluetooth wireless technology and began to develop low-cost wireless specifications to make Bluetooth better applied to short-range connected mobile devices and push them to the market. Compared with ordinary Bluetooth, low-power Bluetooth has lower power consumption and cost and enhanced robustness, allowing Bluetooth technology to have a wider application space. The low power, low energy consumption, convenient and safe connection characteristics of low-power Bluetooth make the low-power Bluetooth chip itself can be used as a sensor device in the Internet of Things.

[0004] As one of the more complex parts of the low-power Bluetooth system, it defines how two devices use radio frequency to transmit and exchange information. The link layer contains detailed definitions of states, messages and channels, and also specifies the data broadcast process, device discovery process, connection establishment, and data packet format, timing specification and interface protocol in various states. The link layer provides a logical transmission channel between two or more devices, independent of the physical layer, which masks the characteristics of the physical layer. The link layer no longer needs to understand the information of the physical layer. The design of the link layer is a crucial step in the design of low-power Bluetooth, and its design can be all software, all hardware, or a combination of software and hardware, each with its own advantages.

[0005] However, how to further reduce the power consumption of low-power Bluetooth has encountered a bottleneck in the research and development process, so a new technical solution is needed to solve this problem. SUMMARY

[0006] Invention purposes: In order to overcome the deficiencies in the prior art, a calibration method for ensuring the time reference of low-power Bluetooth in deep sleep mode is provided, which is suitable for the software and hardware design of low-power Bluetooth link layer. The hardware design and software design are matched to realize the low-power Bluetooth link layer function, ensure the normal work of the system during mode switching, and also reduce the power consumption of the Bluetooth system when it is idle.

[0007] Technical solutions: In order to achieve the above purpose, the present application provides a calibration method for ensuring the time reference of low-power Bluetooth in deep sleep mode, which sets active mode and deep sleep mode in the Bluetooth system, designs high-frequency master clock and low-frequency clock in the Bluetooth link layer, and the calibration method comprises the following steps:

[0008] S1: The Bluetooth system switches from active mode to deep sleep mode, the high-frequency master clock is closed, the low-frequency clock starts to take over the system and starts counting;

[0009] S2: When the system reaches the set sleep time or an external event triggers wake-up, start to exit the deep sleep mode, and record the actual sleep time under the low-frequency clock;

[0010] S3: The high-frequency master clock is restarted to take over the system again, and the counter starts counting under high frequency;

[0011] S4: The Bluetooth circuit sends a wake-up interrupt signal to the CPU, the wake-up interrupt service program starts the 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 restored and enters the active mode.

[0012] 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 312.5us reference clock and 0.5us reference clock.

[0013] Further, the operation process of switching from active mode to deep sleep mode in step S1 is:

[0014] A1: Configure the sleep duration counter before switching, and inform the time required for deep sleep;

[0015] A2: Switch mode, change from active mode to deep sleep mode;

[0016] A3: Record the value of the 312.5us counter under the high-frequency master clock at this time, and temporarily store it in the register CLKN for subsequent wake-up process;

[0017] A4: turn off the high frequency main clock, the low frequency clock is always in operation, through the low frequency clock instead of the high frequency main clock, maintain the local Bluetooth time 312.5us reference.

[0018] Further, the formula for calculating the actual sleep time under the low frequency clock in step S2 is:

[0019] T Sleep = T OSC *DEEPSLDUR (1)

[0020] Wherein, T Sleep is the actual deep sleep time, T OSC is the low frequency clock 32KHz period, DEEPSLDUR is the period number under the low frequency clock.

[0021] Further, the process of correcting the Bluetooth time reference in step S4 is:

[0022] Use formula (2) to calculate the time length of 312.5us reference during deep sleep under the low frequency clock, first calculate the integer part K and store it in the register CLKNCORR, the value range of K is in the value domain of the original high frequency clock 312.5us register CLKN, that is, 0 to 2^28-1, the floor function is the floor function, so the integer part of the used time for 312.5us can be calculated;

[0023]

[0024] Then use formula (3) to calculate the decimal part R of the time length of 312.5us reference during deep sleep under the low frequency clock, and store it in the register FINECORR, the value range of R is in the value domain of the target register Fine Counter with 0.5us precision, that is, 0 to 624, the int function is the integer algorithm, and the final result is the integer multiple of 0.5us precision, which is easier to store in the register as an integer;

[0025] R=2*[312.5us-int(T Sleep -K*312.5us)] (3)

[0026] Finally, the corrected correction value is reloaded into the original register of the Bluetooth circuit, and the 312.5us correction value is reloaded into the CLKN register using formula (4). Because the correction is performed after the first 312.5us tick arrives after switching to high frequency, the old value needs to be added to the compensation value (integer part K) and 1, and then the 0.5us correction value (decimal part R) is directly loaded into the Fine Counter register, as shown in formula (5):

[0027] CLKN new = CLKN old + CLKNCORR + 1 (4)

[0028] Fine_Counter = FINECORR (5)

[0029] Further, the standard for the complete recovery of the Bluetooth local time reference in step S4 is:

[0030] After waiting for the first 312.5us tick after the high-frequency master clock restarts, the modified value is loaded into the 312.5us and 0.5us counters, and the counting starts from the modified value;

[0031] Again, after waiting for the 312.5us tick, the 312.5us and 0.5us counters resume normal counting, and then the Bluetooth local time reference is completely recovered.

[0032] From the chip design scheme, the design method of combining software and hardware is selected. From the low-power design requirement, based on data flow analysis, the overall architecture design and module division of the hardware part are reasonably designed. In view of the complexity of Bluetooth 5, part of the software is used to participate in the design to realize the function, and the power consumption is reduced from the system level; clock management is carried out in the hardware design, the clock network generated by the clock is reduced as much as possible through gated clock; according to the working characteristics of Bluetooth, mode switching is used, after entering the deep sleep mode, the high-frequency clock is turned off, the low-frequency clock is used, the system power consumption is further reduced, and after waking up, the calibration algorithm is used to ensure the accuracy, and the normal communication is ensured.

[0033] The application can be applied to the software and hardware design of the low-power Bluetooth link layer under each version. The method includes software algorithm and hardware design two parts, and the two cooperate to complete the maintenance and calibration of the low-power Bluetooth time reference. The hardware part generates the clock of the low-power Bluetooth link layer module, which is used for the operation of each module; the calibration algorithm of the software part solves the time reference error phenomenon in mode switching.

[0034] The cooperation logic of software and hardware in the application is: the designed system will switch between the active mode and the deep sleep mode according to the needs, so as to save the power consumption of the system. In the transition from the active mode to the deep sleep mode, the high-frequency clock will be turned off, the low-frequency clock will be used to maintain the system, and the current value of the time register in the active mode is also reserved; when the deep sleep mode is restored to the active mode, the high-frequency clock will control the system again after waking up, and the software will calculate the error value through the calibration algorithm and compensate the counter, and finally the calibration value is used to continue maintaining the system operation.

[0035] The hardware module in the application includes: low-power Bluetooth link layer design uses high and low frequency two sets of clock, and low frequency clock is used to produce time processing signal required by hardware circuit when mode switching. Low-power Bluetooth protocol stipulates two minimum time units, 625 microseconds and 1 microsecond respectively, and the rest of various stipulated time is multiple of the two minimum time units. The timing generation module of hardware uses high frequency (8M) and low frequency (32K) to produce two minimum time units through frequency division.

[0036] In order to generate the required time reference, the timing generation module uses master clock master1_gclk and low-power clock low_power_clk to generate two minimum time references of Bluetooth system, 625 microseconds and 1 microsecond. The structure generates 312.5 microseconds and 0.5 microsecond, which is to better synchronize with software, facilitate the implementation of calibration algorithm and various control set by software. At the same time, the hardware will also generate 625 microseconds and 1 microsecond two time reference signals through the two time, which is used for time reference of event processing in hardware. The 0.5 microsecond reference is obtained by frequency division of master clock master1_gclk at half of its frequency value, and 312.5 microseconds is also obtained by frequency division, which can be generated by master clock or low-power clock. In deep sleep mode, master1_gclk will be closed under the control of gate enable signal, and will be opened after waiting for wake-up. In sleep mode, 312.5 microsecond reference time will be generated by low-power clock. In active mode, master1_gclk is in the open state continuously.

[0037] In the invention, two sets of clock accuracy requirements are used in Bluetooth 5.2 protocol. During connection, active scanning, connection request and BIG or CIG event, the active clock drift is within ±50ppm, the instantaneous timing and average timing deviation should not exceed 2us, while the sleep clock drift of other activities is within ±500ppm, the instantaneous timing and average timing deviation should 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 use of a lower power crystal clock when the Bluetooth device is sleeping, and the accuracy of the crystal clock is also lower. The drift time of the anchor point should be considered. Therefore, a low-precision 32KHz low-frequency clock can be used to maintain the local Bluetooth time reference during deep sleep. At this time, the high-frequency clock can be turned off to reduce dynamic power consumption, and the Bluetooth circuit power supply can be cut off to save leakage power consumption. If the master device is in active mode and the slave device is in sleep mode, the maximum drift between the two devices in the worst case is 550ppm. If both parties are in a connected state, the time for packet interaction between the two is 4s, and the drift will reach ±4s*550e^(-6)=±2.2ms, which is about ±8 times of 312.5us. If the master device and the slave device are in a connected state and both enter sleep mode, the worst-case drift between the two will reach ±1000ppm, which is close to ±4s*1000e^(-6)=±4ms, which is about ±13 times of 312.5us. Therefore, in order to solve various problems in dual mode, a calibration mechanism is necessary.

[0038] The software algorithm flow in the invention includes: when the Bluetooth circuit switches from deep sleep mode to active mode, two important counters, 312.5us and 0.5us local time references must be restored to the current time with higher accuracy. The calibration algorithm converts the actual deep sleep time into compensation values of the 312.5us and 0.5us counters, and compensates the two local time references when the first 312.5us tick after waking up arrives. Finally, the local time reference is restored. With the two time references, the Bluetooth local time can work normally, and the system can also complete communication with the opposite device at the next time anchor point.

[0039] The specific correction method is: first, calculate the actual deep sleep time, which may be the previously set sleep time, or the time used due to early wake-up due to external events. The time can be obtained by multiplying the period number under the low-frequency clock with the frequency; then use the floor function to calculate the integer part of the time length of the 312.5us deep sleep time reference under the low-frequency clock; then calculate the decimal part of 312.5us; finally, compensate the original counter with the correction value and start running with the calibration value.

[0040] Beneficial effects: compared with the prior art, the application is based on the low-power Bluetooth link layer designed by hardware and software, the working mode of the system is divided into active and deep sleep, and when the mode is switched, the calibration work can be well completed with the switching of high and low frequency clocks, the time error problem during mode switching is solved, the communication work with the opposite device during mode switching is ensured, the data is not lost, the power consumption of low-power 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 link layer function is also ensured. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 is the timing generation diagram of the hardware circuit of the application;

[0042] Figure 2 is the mode switching flowchart of the application;

[0043] Figure 3 is the timing diagram when the active mode is switched to the deep sleep mode of the application;

[0044] Figure 4 is the timing diagram when the deep sleep mode is switched to the active mode of the application;

[0045] Figure 5 is the timing diagram of the calibration process of the application. DETAILED DESCRIPTION

[0046] The application will be further illustrated below in combination with the drawings and specific embodiments, and it should be understood that these embodiments are only used to illustrate the application and not used to limit the scope of the application, and after reading the application, the modification of various equivalent forms of the application by those skilled in the art falls within the scope defined by the claims attached to the application.

[0047] The application provides a low-power Bluetooth hardware circuit, as shown in Figure 1 The hardware circuit includes a timing generation module, and the timing generation module generates two minimum time references of the Bluetooth system, 625 microseconds and 1 microsecond, using a master clock master1_gclk and a low-power clock low_power_clk. Figure 1The clock frequency of clk_sel in the master1_gclk is determined by the master1_gclk clock, which is set to 8MHz, so clk_sel is also this value. The structure generates the minimum time reference of 312.5 microseconds and 0.5 microseconds, which is to better synchronize with the software, facilitate the implementation of the calibration algorithm and various controls set by the software. At the same time, the hardware will also generate two time reference signals of 625 microseconds and 1 microsecond through these two times, which are used for time reference in event processing in hardware. The 0.5 microsecond reference reference is obtained by dividing the frequency value of the master clock master1_gclk by half, and the 312.5 microsecond is also obtained by dividing the frequency value, which can be generated by the master clock or by the low-power clock.

[0048] The application also provides a low-power Bluetooth software system, which includes an active mode and a deep sleep mode, and is mainly divided into two parts: switching from the active mode to the deep sleep mode and switching from the deep sleep mode to the active mode.

[0049] The power consumption is positively correlated with the transmission rate, transmission time, transmission power, modulation efficiency and other factors. To reduce power consumption, we can start from reducing the transmission rate, reducing the transmission time, reducing the standby power consumption of non-transmission time, reducing the transmission power, improving the modulation efficiency, etc. BLE relies on long-term deep sleep, periodic wake-up and data transmission to achieve a significant reduction in average power consumption and prolong the battery life. The low-power Bluetooth device working time accounts for a small proportion, and most of the time is in an idle state, so the Bluetooth system sets active and deep sleep modes on the chip mode. In the idle state, the device enters deep sleep mode to reduce power consumption. In addition, the link layer in the connected state can also make the slave device ignore the data packet of the master device for a period of time, and the slave device enters sleep state during this period, which can also reduce part of the power consumption. In the switching between deep sleep mode and active mode, the device needs to ensure a certain accuracy, otherwise the connection will fail or will cause both sides to be unable to communicate. Therefore, there is an urgent need for a scheme that can maintain the Bluetooth local time and calibration.

[0050] In this embodiment, the low-power Bluetooth 5.2 protocol uses two sets of clock accuracy requirements. During connection, active scanning, connection request, and BIG or CIG events, the active clock drift is within ±50ppm, and the instantaneous timing and average timing deviation should not exceed 2us. The sleep clock drift of other activities is within ±500ppm, and the instantaneous timing and average timing deviation should 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 use of a lower-power crystal clock when the Bluetooth device is sleeping, and the accuracy of the crystal clock is also lower. The drift time of the anchor point should be considered. Therefore, a low-precision 32KHz low-frequency clock can be used to maintain the local Bluetooth time reference during deep sleep, which can not only turn off the high-frequency clock to reduce dynamic power consumption, but also cut off the power supply of the Bluetooth circuit to save leakage power consumption.

[0051] There are two most important time points in low-power Bluetooth, 312.5us local time count and 0.5us local time count. In active mode, the 8M high-frequency clock is used to maintain the count clock error of the 312.5us counter within ±50ppm, and during deep sleep, the 32KHz low-frequency clock is used to maintain the 312.5us time reference and 0.5us time reference. The hold time recorder is used under the low-frequency clock to record the sleep duration, and the link layer software recalibrates and restores the Bluetooth local time after the calibration algorithm to ensure the accuracy of the Bluetooth local time, so that the communication can continue correctly at the next Anchorpoint, and the data interaction can be carried out normally.

[0052] Based on the above, the embodiment provides a calibration method for ensuring the low-power Bluetooth time reference in deep sleep mode. The active mode and deep sleep mode are set in the Bluetooth system, and the high-frequency master clock and low-frequency clock are designed in the Bluetooth link layer. The calibration method includes the following steps:

[0053] In the non-transmission case, the Active state is switched to the Sleep state to save power, at which time the high-frequency master clock of the Bluetooth circuit stops running, reducing the leakage current of the Bluetooth circuit. However, to ensure that the local Bluetooth time can continue to communicate at the next agreed synchronization point Anchorpoint, the local Bluetooth time must be maintained, and the maintenance process is carried out on the low-frequency clock 32KHz. The timing diagram is shown in Figure 3 The steps are as follows:

[0054] 1) Configure the sleep duration counter before switching, and inform the required time of deep sleep.

[0055] 2) Switch mode, from Active to Sleep.

[0056] 3) Record the value of 312.5us at this time under high frequency master clock, and temporarily store in register CLKN for later use in wake-up process.

[0057] 4) Turn off the Bluetooth master clock to save power consumption, while the 32KHz low frequency clock is always in operation, which replaces the high frequency master clock to maintain the local Bluetooth time reference of 312.5us.

[0058] At the set deep sleep time point or when an external event occurs, the module is woken up, the Bluetooth circuit is switched from Sleep state back to Active state, and the local Bluetooth time reference needs to be restored immediately after wake-up to ensure communication. The timing chart is shown in Figure 4 , and the steps are as follows:

[0059] 1) Start the high frequency master clock, and the master clock is restored as the system master clock.

[0060] 2) After wake-up, restore the value of 312.5us previously stopped counting and temporarily stored in the register to the original counter CLKN, and the value of 0.5us counter under low frequency clock is also loaded to the target register Fine Counter, and the counter starts counting immediately.

[0061] 3) The software uses calibration algorithm to correct the values of 312.5us and 0.5us counters, and after the first 312.5us tick of the master clock after restoration, the corrected values are loaded to the two counters, and the Bluetooth time reference is calibrated and restored.

[0062] 4) Switch to active mode formally, and continue communication.

[0063] In this embodiment, the wake-up forms include natural reaching of set time and external event triggering, and the difference lies in the different duration of deep sleep mode. In the case of external event wake-up, the actual event of circuit sleep is less than the set deep sleep time. The time will be used for correction of the values of two counters in calibration algorithm.

[0064] When the Bluetooth circuit is switched from deep sleep mode to active mode, two important counters, 312.5us and 0.5us local time references must be restored to the current time. The calibration algorithm converts the actual deep sleep time into compensation values of 312.5us and 0.5us counters, and after the first 312.5us tick after wake-up, the two local time references are calibrated and compensated, so that the local time reference is restored. With the two time references, the Bluetooth local time can work normally, and the system can also complete communication with the peer device at the next time anchor point. The implementation process is shown as follows.

[0065] First, the actual deep sleep time is calculated. It can be the sleep time set in advance, or the time used to wake up in advance due to an external event. It is calculated using equation (1), where T_Sleep is the actual deep sleep time, T_OSC is the 32 kHz period of the low frequency clock, and DEEPSLDUR is the number of periods of the low frequency clock.

[0066] T Sleep = T OSC *DEEPSLDUR (1)

[0067] Then, equation (2) is used to calculate the time length of the 312.5 us time reference during the deep sleep period under the low frequency clock. The integer part K is calculated first and stored in the register CLKNCORR. The value of K is within the value range of the register CLKN under the original high frequency clock, i.e. 0 to 2^28-1. The floor function is the floor function, so the integer part of the time used for 312.5 us can be calculated.

[0068]

[0069] Then, equation (3) is used to calculate the decimal part R of the time length of the 312.5 us time reference during the deep sleep period under the low frequency clock and store it in the register FINECORR. The value of R is within the value range of the target register Fine Coumer with 0.5 us precision, i.e. 0 to 624. The int function is the rounding algorithm, which takes the nearest integer downward, and the final result is an integer multiple of 0.5 us precision. Converting to an integer is more convenient for register storage.

[0070] R = 2*[312.5 us-int(T Sleep -K*312.5 us)] (3)

[0071] Finally, the calibrated correction value is reloaded into the original register of the Bluetooth circuit. The 312.5 us correction value is reloaded into the CLKN register using equation (4). Since the correction is performed after the first 312.5 us tick after switching to the high frequency, the old value needs to be added to the compensation value (integer part K) and 1. Then, the 0.5 us correction value (decimal part R) is directly loaded into the Fine Counter register, as shown in equation (5).

[0072] CLKN new = CLKN old +CLKNCORR+1 (4)

[0073] Fine_Counter = FINECORR (5)

[0074] The calibration timing from deep sleep to normal working active mode is shown in Figure 5 Referring to Figure 2 and Figure 5 The working process of the calibration method for ensuring the low-power Bluetooth time reference in the deep sleep mode provided by the embodiment can be summarized as the following steps.

[0075] 1) The system enters the deep sleep mode, the high-frequency main clock of the Bluetooth circuit is turned off, the low-frequency 32KHz clock starts to take over the system and starts counting.

[0076] 2) When the system reaches the set sleep time or an external event triggers the wake-up, the deep sleep mode is started to exit, and the actual sleep event under the low-frequency clock is recorded.

[0077] 3) The high-frequency main clock is restarted to take over the system again, and the counter starts to count under the high frequency.

[0078] 4) The Bluetooth circuit sends a wake-up interrupt signal to the CPU, the wake-up interrupt service program starts the calibration work, starts to calculate the compensation value of the Bluetooth time reference counter, and performs correction.

[0079] 5) After waiting for the first 312.5us tick after the high-frequency restart, the modified value is loaded into the 312.5us and 0.5us counters, and the counting starts from the modified value.

[0080] 6) The 312.5us tick is waited again, the 312.5us and 0.5us counters resume normal counting, and then the Bluetooth local time reference is completely restored.

[0081] Based on the above scheme, in order to verify the actual effect of the scheme provided by the embodiment, the power consumption data of the low-power Bluetooth is compared. The link layer is the core of timing control in the communication process of the Bluetooth device, and its power consumption accounts for a large part of the total power consumption of the low-power Bluetooth. The dynamic power consumption accounts for 70% to 90% of the power consumption of the digital integrated circuit. Therefore, the present application will be compared with two documents in recent years, and the link layer module is required to have certain advantages in dynamic power consumption.

[0082] The dynamic power consumption of the document "Hardware Design of Low-Power Bluetooth 4.0 Link Layer" under the 130nm process, 8M clock and 1.08V working voltage is 0.96mW, and the dynamic power consumption of the document "Low-Power SoC Platform Design for Internet of Things Application" under the 55nm process, 8M clock and 1.0V working voltage is 0.3mW. Finally, the dynamic power consumption of the present application under the 40nm process, 8M clock frequency and 1.0V working voltage is 0.3mW. The specific data is shown in the following table.

[0083]

[0084] Two documents in the premise of realizing low-power Bluetooth 4.0 link layer, comprehensive conditions are different, so there is some difference in power consumption. The link layer controller designed in the application uses a calibration method to ensure the low-power Bluetooth time reference in deep sleep mode, which reduces the system power consumption while ensuring the correct function. The process used by the module is more advanced than the benchmark paper, and the power consumption result is much lower than the benchmark paper in theory. Finally, the actual power consumption index has more obvious advantages compared with the benchmark paper.

Claims

1. A method of guaranteeing calibration of a low power Bluetooth time reference in a deep sleep mode, characterized by, The active mode and the deep sleep mode are set in the Bluetooth system, a high-frequency master clock and a low-frequency clock are designed in the Bluetooth link layer, and the calibration method comprises the following steps: S1: the Bluetooth system is switched from the active mode to the 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 a set sleep time or an external event triggers wake-up, the deep sleep mode is started to exit, and an actual sleep time under the low-frequency clock is recorded; S3: the high-frequency master clock is restarted to take over the system again, and the counter starts to count under the high frequency; S4: the Bluetooth circuit sends a wake-up interrupt signal to the CPU, a wake-up interrupt service program is started to perform calibration work, a compensation value of a Bluetooth time reference counter is calculated, the Bluetooth time reference is corrected according to the compensation value, and the active mode is entered after the Bluetooth local time reference is completely restored; The calculation formula of the actual sleep time under the low-frequency clock in step S2 is as follows: (1); wherein, is the actual deep sleep time, is the low frequency clock 32KHz period, is the number of periods at low frequency clock; The correction process of the Bluetooth time reference in step S4 is as follows: The time length of the 312.5us time reference under the low-frequency clock during the deep sleep is calculated by using formula (2), the integer part K is calculated first, and is stored in the register CLKNCORR, the value range of K is in the value domain of the register CLKN under the original high-frequency clock, the floor function is a down rounding algorithm, and the integer part of the used time for 312.5us is calculated; (2); The decimal part R of the time length of the 312.5us time reference under the low-frequency clock during the deep sleep is calculated by using formula (3), and is stored in the register FINECORR, the value range of R is in the value domain of the target register Fine Counter with the accuracy of 0.5us, the int function is an integer algorithm, and the final calculated result is an integer multiple with the accuracy of 0.5us; (3); Finally, the corrected correction value is reloaded into the original register of the Bluetooth circuit, the 312.5us correction value is reloaded into the CLKN register by using formula (4), because the correction is performed after the first 312.5us tick under the high frequency arrives, so the old value needs to be added with the compensation value K and 1, and then the 0.5us correction value R is directly reloaded into the FineCounter register, as shown in formula (5): (4); (5)。 2. The calibration method for ensuring a low-power Bluetooth time base in deep sleep mode according to claim 1, characterized in that, The high-frequency master clock and the low-frequency clock generate two minimum time references of the Bluetooth system, 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 method of claim 1, wherein the method further comprises: determining whether the time reference is within a predetermined range of the time reference; and if the time reference is not within the predetermined range of the time reference, then adjusting the time reference to be within the predetermined range of the time reference. The operation process of switching from the active mode to the deep sleep mode in step S1 is as follows: A1: before switching, the sleep duration counter is configured to inform the required time of the deep sleep; A2: the mode is switched, and the active mode is changed into the deep sleep mode; A3: the value of the 312.5us counter under the high-frequency master clock at this time is recorded, and is temporarily stored in the register CLKN for subsequent wake-up process; A4: Close the high frequency main clock, low frequency clock is always in operation, through the low frequency clock instead of high frequency main clock, maintain the local Bluetooth time 312.5us reference.

4. The method of claim 1, wherein the method further comprises: determining whether the time reference is within a predetermined range of the time reference of the low energy Bluetooth device; and if the time reference is not within the predetermined range of the time reference of the low energy Bluetooth device, then adjusting the time reference of the low energy Bluetooth device. The standard for the complete recovery of the Bluetooth local time reference in step S4 is: After waiting for the first 312.5us tick after the high frequency main clock restarts, load the correction value into the 312.5us and 0.5us counters, and count from the correction value; Wait for the 312.5us tick again, and the 312.5us and 0.5us counters resume normal counting, after which the Bluetooth local time reference is completely recovered.

Citation Information

Patent Citations

  • Bluetooth clock calibration method and circuit structure

    CN113079497A