Specific embodiment
In the following description, in order to make the reader understand this application better, many technical details are proposed.But this
The those of ordinary skill in field is appreciated that even if without these technical details and many variations based on the following respective embodiments
And modification, each claim of the application technical solution claimed can also be realized.
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to implementation of the invention
Mode is described in further detail.
First embodiment of the invention is related to a kind of data broadcasting method of low consumption circuit.Fig. 1 is the low consumption circuit
Data broadcasting method flow diagram.
The low consumption circuit includes external clock and the microcontroller for wireless communication, wherein microcontroller includes just
Normal operating mode, first order sleep pattern and second level sleep pattern, wherein sleeping in microcontroller under first order sleep pattern
Dormancy timer is opened, and the sleep timer under the sleep pattern of the second level in microcontroller is closed, and microcontroller is slept in the first order
Power consumption under mode is higher than the power consumption under the sleep pattern of the second level, and the power consumption of external clock is slept lower than microcontroller in the first order
Power consumption under mode.
Specifically, as shown in Figure 1, the data broadcasting method of the low consumption circuit the following steps are included:
In a step 101, microcontroller emits radio broadcasting signal in the normal mode of operation.
In the present embodiment, it is preferable that radio broadcasting signal is Bluetooth broadcast signal.
Furthermore, it is to be understood that in another example, radio broadcasting signal is Wifi broadcast singal.In another example, nothing
Line broadcast singal is Zigbee broadcast singal etc..
Then into step 102, microcontroller enters first order sleep pattern.
Then into step 103, microcontroller is waken up by the sleep timer of itself.
Then into step 104, microcontroller re-emits radio broadcasting signal in the normal mode of operation.
Then into step 105, microcontroller enters second level sleep pattern, and triggers external clock reclocking.
It should be noted that so-called external clock is an independence except microcontroller in each embodiment of the application
Module, the offer including clock signal also include some basic signal detections and arbitration functions.
Furthermore, it is to be understood that microcontroller is laid equal stress on before entering second level sleep pattern into first order sleep pattern
The step of sending out radio broadcasting signal can execute once, can also execute repeatedly.
Then into step 106, judge whether the first scheduled duration of external clock is overtime.
If so, entering step 107;If it is not, then returning to step 106.
In step 107, triggering microcontroller enters normal mode.
For external clock after the first scheduled duration time-out, triggering microcontroller enters normal mode of operation.
Hereafter step 101 is come back to.
Slept before the repeating transmission of radio broadcasting signal with first order sleep pattern, and complete all repeating transmission it
Enter second level sleep pattern afterwards, and realize the wake-up of microcontroller with the external clock of more low-power consumption, preciousness can be saved
Electric energy realizes long-term work.
Further, it is preferable that
After the step of " for external clock after the first scheduled duration time-out, triggering microcontroller enters normal mode of operation "
It is further comprising the steps of:
If external clock the second scheduled duration time-out, resets the microcontroller, wherein the second scheduled duration is greater than the
One scheduled duration.
External clock detects the output signal of microcontroller, if it is decided that the micro- device of micro-control does not enter normal work mould
Formula then resets the microcontroller, to guarantee that system can operate normally, substantially increases fault-tolerant ability.
In the present embodiment, it is preferable that low consumption circuit further includes sensor.
Before the step of " microcontroller emits radio broadcasting signal in the normal mode of operation " the following steps are included:
Microcontroller obtains measurement data from sensor.
It include measurement data in the radio broadcasting signal emitted.
In the present embodiment, it is preferable that low consumption circuit is mounted in recyclable physical distribution apparatus, radio broadcasting signal packet
Include the mark of the recyclable physical distribution apparatus.
Fig. 2 is a kind of system framework figure of recyclable physical distribution apparatus for being equipped with low consumption circuit.As shown in Fig. 2, described
System includes recyclable physical distribution apparatus, low consumption circuit (not shown go out), four part of mobile terminal and server.It can wherein follow
Ring physical distribution apparatus and low consumption circuit design have the structure that can be used for placing and fix;Lead between low consumption circuit and wireless terminal
The communications such as bluetooth, Wifi or Zigbee are crossed to be communicated;Pass through Wifi/2G/3G/4G between wireless terminal and server
Etc. being communicated.
Each method embodiment of the invention can be realized in a manner of software, hardware, firmware etc..Regardless of the present invention be with
Software, hardware or firmware mode realize that instruction code may be stored in any kind of computer-accessible memory
In (such as permanent perhaps revisable volatibility is perhaps non-volatile solid or non-solid, it is fixed or
The replaceable medium etc. of person).Equally, memory may, for example, be programmable logic array (Programmable Array
Logic, referred to as " PAL "), random access memory (Random Access Memory, referred to as " RAM "), it may be programmed read-only deposit
Reservoir (Programmable Read Only Memory, referred to as " PROM "), read-only memory (Read-Only Memory, letter
Claim " ROM "), electrically erasable programmable read-only memory (Electrically Erasable Programmable ROM, referred to as
" EEPROM "), disk, CD, digital versatile disc (Digital Versatile Disc, referred to as " DVD ") etc..
Second embodiment of the invention is related to a kind of low consumption circuit.Fig. 3 is the structural schematic diagram of the low consumption circuit.
The low consumption circuit includes external clock and the microcontroller for wireless communication, wherein
Microcontroller includes normal mode of operation, first order sleep pattern and second level sleep pattern, and wherein the first order is slept
Sleep timer under sleep mode in microcontroller is opened, and the sleep timer under the sleep pattern of the second level in microcontroller closes
It closes, microcontroller is higher than the power consumption under the sleep pattern of the second level, the power consumption of external clock in the power consumption under first order sleep pattern
Lower than power consumption of the microcontroller under first order sleep pattern.
The output port that the external clock of microcontroller enables signal is connected to the defeated of the clock resetting signal of external clock
Inbound port.
Microcontroller is used to emit radio broadcasting signal in the normal mode of operation, and after emitting the radio broadcasting signal
Into first order sleep pattern, it is wireless wide to re-emit this in the normal mode of operation after being waken up by the sleep timer of itself
Signal is broadcast, subsequently into second level sleep pattern and exports external clock enabling signal triggering external clock reclocking.
First scheduled duration timeout signal output port of external clock is connected to the wake-up signal input terminal of microcontroller
Mouthful, which makes the microcontroller enter normal mode of operation from second level sleep pattern.
In the present embodiment, it is preferable that radio broadcasting signal is Bluetooth broadcast signal.
Furthermore, it is to be understood that in another example, radio broadcasting signal is Wifi broadcast singal.In another example, nothing
Line broadcast singal is Zigbee broadcast singal etc..
Microcontroller into first order sleep pattern and retransmits radio broadcasting signal before entering second level sleep pattern
The step of, can execute primary, can also execute repeatedly.
Further, it is preferable to ground, the second scheduled duration timeout signal output port of external clock is connected to microcontroller
Micro-controller resetting signal input port, the micro-controller resetting signal is for resetting the microcontroller, wherein second is pre-
Timing is long to be greater than the first scheduled duration.
In low consumption circuit, external clock is also connect with a timing resistor.
External clock sets the timing length of oneself by the timing resistor.
Microcontroller is also connect with sensor.
Microcontroller obtains measurement data from sensor.It include these measurement data in radio broadcasting signal.
Sensor includes: one of temperature sensor, pressure sensor and Magnetic Sensor or any combination thereof.
The primary object of the application be that change microcontroller electricity-saving state sleep pattern, by current drain compared with
Big shallow sleep pattern is changed to the relatively small deep sleep mode of current drain, and the electric current under energy-saving mode is enable to reach several uA
Rank, it is even lower, to further reduced the power consumption of product.
It should be noted that in each embodiment of the application, the meaning phase of Active mode and normal mode of operation
Together, shallow sleep pattern, Suspend mode are identical as the meaning of first order sleep pattern, deep sleep mode, Deepsleep
Mode is identical as the meaning of second level sleep pattern, the input port meaning of the clock resetting signal of Done pin and external clock
Identical, Wake pin is identical as the first scheduled duration timeout signal output port meaning of external clock, RSTn pin and outside
Second scheduled duration timeout signal output port meaning of clock is identical, and the clock resetting signal of done signal and external clock contains
Justice is identical, and wakeup signal is identical as wake-up signal meaning, and reset signal is identical as micro-controller resetting signal meaning.
The technical solution of the application makes microcontroller can enter the depth of more low-power consumption by the clock outside introducing
Sleep pattern is finally reached the purpose of the optimization of power supply to further decrease the current drain of energy-saving mode.
Specifically, as shown in Fig. 3, Fig. 4 and Fig. 5,
In the present embodiment, it is preferable that microcontroller is a kind of bluetooth (the Bluetooth Low of low-power consumption
Energy, referred to as " BLE ") equipment, especially a kind of bluetooth equipment for requiring battery life to reach the several years.
Further, in the present embodiment, microcontroller is preferably a kind of TLSR8266 with low power consumption characteristic blue
Tooth chip, the TLSR8266 Bluetooth chip have 3 kinds of operating modes, are respectively as follows:
Active mode: this is a kind of normal operating mode, the master clock of CPU, low-frequency clock, RAM, timer with
And some other digital circuits and analog circuit are all in opening state;
Suspend mode: this is a kind of sleeping state, and the master clock of CPU is closed, low-frequency clock, RAM, sleep timing
Device is opened, and other digital circuits and analog circuit are all closed;
Deepsleep mode: this is a kind of deep sleep state, the master clock of CPU, low-frequency clock, sleep timer,
RAM, other digital circuits and analog circuit are all closed, and only a small number of simulation registers is saved at this time.
For normal operating mode, current drain is usually to be under the mode, microcontroller in mA rank
Interior all peripheral hardwares, I/O port all work normally.
For Suspend mode, current drain is microampere order, and under this sleep pattern, microcontroller is remain certainly
The ability that I wakes up.
For Deepslee mode, current drain is smaller than Suspend mode, and representative value is no more than 1uA.This
Under kind sleep pattern, because microcontroller does not have any clock, microcontroller self cannot be waken up, and need external interruption.
The technical solution of our the application exactly utilizes the third operating mode (Deepsleep mode), then
External clock is introduced to serve as the role in external wake source.The external clock has following characteristic:
(1) external clock itself has the electric current than the Deepsleep mode of microcontroller small
(2) there is timing function, and timing length is programmable
(3) it under the conditions of the minimum operating voltage of microcontroller, can still work normally
Above-mentioned 3 characteristics of external clock are further illustrated below:
It cuts for really, the power consumption of external clock itself must be more much smaller than the Deepsleep mode of microcontroller, in this way
The current drain that just not will lead to the new hardware generation of introducing has an impact to whole power consumption.Otherwise external clock is added just in we
Without in all senses.The Deepsleep mode electric current of microcontroller is previously mentioned less than 1uA, and external clock selected by us
Current drain should be in nA rank.
With programmable timing function, such developer can more actual use demand, the depth of self-defining device
Sleeping time flexibly copes with various scenes.
Third characteristic is critically important, because our Bluetooth chip TLSR8266 has the minium operation voltage of 2V,
It so requires the minimum operating voltage of external clock close to 2V, can just enable whole equipment to the maximum extent using electricity in this way
Pond.
The communication of the external clock and microcontroller of introducing, dependent on the pin of 3 connected between the two different function,
It is described below:
The sense of Done pin is needed by microcontroller to external clock when to control after it is waken up by external clock
A done signal is sent to external clock, indicates that it is waken up and worked normally by external clock
The sense of Wake pin is external when external clock generates time out event by external clock to microcontroller
Clock will generate a wakeup signal to microcontroller, it is therefore an objective to wake up the microcontroller for being in deep sleep
The sense of RSTn pin is by external clock to microcontroller, and the wakeup signal caused by the external clock is simultaneously
When not obtaining the response of microcontroller, external clock thinks microcontroller on-hook, can send a reset signal to micro-control
Device processed, effect also correspond to the house dog of an outside.
The working principle of external clock be it is such, read preset resistance value upon power-up, then according to this electricity
Resistance value sets oneself timing length.Specific level will be issued on Wake pin when timing time-out as interruption letter
Number.After issuing corresponding interrupt signal, which will be constantly in scouting before the arriving of next interrupt signal
State.It at this time can be there are two types of situation:
Interrupt signal when detecting that the respective pins being connected with microcontroller have particular level generation, before being considered as
Play the role of waking up microcontroller, when time-out arrives next time, interrupt signal will be generated again;When not detecting
When specific level, then it is assumed that this time wake up failure, external clock will issue reset signal and reset microcontroller.
The working method and characteristic of external clock described above ensure that BLE equipment in energy-saving mode with ultralow function
Consumption, while also playing the effect for monitoring and guarding BLE equipment normal operation.
The control method of bluetooth equipment sleep pattern is as follows:
Bluetooth equipment periodically works, in normal mode of operation, shallow sleep operation mode, deep sleep operating mode
Switchback is changed.
Furthermore, it is understood that control equipment enters depth after bluetooth equipment completes this data acquisition with broadcasting tasks
Spend sleep state.
Under deep sleep, work when bluetooth equipment is waken up, after completing first time acquisition-broadcasting tasks,
Whether request data link layer can enter sleeping state.
After obtaining the permission of data link layer, sleep timer can be set.Control bluetooth equipment enters sleeping state.
When sleep timer time-out, bluetooth equipment is understood self and is called out.Second of broadcasting tasks is carried out, secondary broadcast is appointed
Business is not related to the acquisition of data, it only simply goes out data broadcasting.
Later, bluetooth equipment, which can enter, is again introduced into deep sleep mode.And before entering deep sleep mode, it will do it phase
The data of pass save work.
Its affiliated process further comprises:
By important information preservation in simulation register, it is important that these can be restored after deep sleep wake-up in this way
Data.
When the time out event of external clock occurs, TLSR8266 will waken up by Wake pin.Then again
It starts counting.
It restarts counting process, for the first time can be always by the timing length value that reading resistance value obtains
Packet save, in this way after reload counter register when just need not again by simulation pin read resistance value method obtain determine
Shi Shichang.
For being now in the TLSR8266 of deep sleep, the work after being waken up has, and restores sound sleep from simulation register
The data saved before sleeping.
After restoring data, the acquisition of data will do it, and data are broadcasted through row.It can be to data link after sign-off
Layer issues the request for whether allowing access into shallow sleep pattern.
Be above bluetooth equipment through row periodic duty when sleep pattern control process.Generally summarize are as follows: every
Regular hour will acquire a data, then carry out 2 broadcast.Using shallow sleep mould in broadcast interval twice
Formula.The reason is that needing to keep self wake-up ability of TLSR8266, carries out second and broadcast.The original wherein broadcasted twice
Because being to reduce the packet loss of bluetooth accepting device.
The application is by introducing external clock, so that bluetooth equipment is able to use deep sleep state.To bluetooth equipment depth
The integrated application of sleep and sleeping state, the task of reasonable distribution bluetooth equipment control the work of entire bluetooth equipment system
Mode largely reduces the power consumption of bluetooth equipment, extends the cruise duration of battery.
The overall structure figure of low consumption circuit after introducing external clock is divided into power supply as shown in figure 3, divide with module
Module, external clock module and Bluetooth RF (microcontroller) module.The composition and function of each module are as follows:
Power module is the disposable lithium cell of a 3600mAh in our realization.Its initial voltage is 3.6v,
It is responsible for providing the power supply of external clock and Bluetooth chip.
External clock module using TI TPL5010 timer.TPL5010 is one with watchdog function
Nano timer.In system application, deep sleep wake source of the external clock module as Bluetooth chip TLSR8266 is responsible for week
The wake-up Bluetooth chip of phase property works.
Bluetooth RF module has TLSR8266 chip and its external module, sensor circuit, and other some states
Detection circuit.The module is responsible for data acquisition by various sensors and detection circuit, and passes through the specific broadcast of bluetooth frequency
Road is by data broadcasting.
The consumption electric current of the external clock TPL5010 selected in present embodiment only has 35nA, he can substitute microcontroller
The sleep timer integrated in device, so that microcontroller be allowed to use the mode of more low-power consumption.Using to battery life
Reach several years rank or the sensor application using smaller batteries.The selecting time interval that TPL5010 is provided is reachable
100ms to 7200s
The present invention selects to be integrated with 32 powerful MCU, BLE/2.4G radio frequency in microcontroller TLSR8266 monolithic chip
FLASH inside transceiver, 16KB SRAM, 128/256/512KB outside FLASH (TLSR8266) or 512KB
(TLSR8266F512), 14 ADC with PGA, 6 channel PWM, 3 quadrature decoders, hardware button scan module
(Keyscan), several needed for GPIO interface abundant, multi-stage power source management module and Bluetooth Low Energy (BLE) application and development
All peripheral hardwares.
Microcontroller TLSR8266 has multi-stage power source management, minimizes power consumption:
1) Rx/Tx mode current: 13mA
2) Suspend mode current: 20uA
3) deep sleep mode electric current: 0.7uA
In concrete implementation, Rx/Tx mode current is related with transmission power.By actual test, when me
Be arranged TLSR8266 be maximum transmission power when, peak point current has reached 30mA.As for Suspend mode current at us
Bluetooth equipment in by actual measurement reach 40uA.The actual current of deep sleep is 4uA or so in actual test.
The difference of its theoretical value and actual value, mainly since measurement environment between the two is different.The electric current of Rx/Tx mode
Size is not only influenced by temperature, supply voltage, and the transmission power of most importantly Bluetooth signal is related.Same Suspend mould
Formula electric current and deep sleep mode electric current all can be by temperature, the influences of supply voltage.
In the following, illustrating to introduce the power saving effect for not using external clock after external clock relatively with data.
The realization process of the operating mode control of bluetooth equipment is as shown in figure 4, corresponding current drain of each stage can be rough
Think as shown in Figure 5.
Here is the object that will use in calculating process:
Battery capacity (BC): the actual capacity of battery, unit are milliampere hour (mAh).
Deep sleep electric current (CDS): average current when deep sleep, unit are milliampere (mA).
Deep sleep time (TDS): the total time of deep sleep state is in one duty cycle of bluetooth equipment, unit is the second
(s)。
Shallow sleep current (CS): average current when shallow sleep, unit are milliampere (mA).
Shallow sleep time (TS): the total time of sleeping state is in one duty cycle of bluetooth equipment, unit is the second
(s)。
First time emission current (C1E): average current when transmitting, unit are milliampere (mA).
Launch time first time (T1E): it is completed required for returning sleep from waking up in sleep until broadcasting when continuous broadcast
Time, unit be the second (s).
Second of emission current (C2E): average current when transmitting, unit are milliampere (mA).
Second of launch time (T2E): it is completed required for returning sleep from waking up in sleep until broadcasting when continuous broadcast
Time, unit be the second (s).
Cycle duration (TC): a duty cycle duration of label, unit are the second (s).
Average current (CAvg): the second average operating current of label, unit are milliampere (mA).
Cruise duration (TBL): the cruise duration (h) of label.
The battery capacity unit in society is all mAh at present.For us the at present battery of used 3600mAh,
If bluetooth equipment is persistently consumed with the electric current of 10mA, which can supply the time used in bluetooth equipment are as follows:
3600mAh/10mA=360h, i.e. 360 hours.
According to theory recited above, in addition actual test, so that it may obtain bluetooth equipment power consumption and given battery
The time that can be worked normally for equipment.
Bluetooth equipment is in the time of deep sleep state in a cycle:
TDS=TC–T1E-TS-T2E
The average current of bluetooth equipment in one duty cycle:
CAvg=(TDS×CDS+TS×CS+T1E×C1E+C2E×T2E)/(TC)
Therefore battery can be for the time of bluetooth equipment normal work:
TBL=BC/CAvg
Here is actual measured value:
BC=3200mAh
The actual capacity of battery has differences with nominal capacity, and the battery of different brands would also vary from, right herein
This in the battery of actual nominal 3600mAh is 3200mAh.
T1E=0.012s
Time required for normal broadcast of practical bluetooth in 4ms, but due to broadcasting for the first time is waken up from deep sleep
Occur after coming, 5ms is needed from deep sleep to normal mode, in addition other some functions can also occupy some times.
C1E=16mA
The transmission power of Bluetooth signal is adjusted to 8dbm, and the maximum transmission power of adjustment TSRL8266.
C2E=20mA
The transmission power of Bluetooth signal is adjusted to 8dbm, and the maximum transmission power of adjustment TSRL8266.
T2E=0.005s
Second of broadcast is to belong to normal broadcast time since after shallow sleep awakening.
TC=10s
In our bluetooth equipment, duty cycle 10s.This time according to different application scene, does not have difference
Demand.
TS=0.1s
Shallow sleep time is 100ms, this value is also the difference with application demand and different.
CS=0.04mA
Hypohyphnotic electric current 40uA or so.
CDS=0.004mA
Deep sleep actual current is in testing 4uA or so.
The time that bluetooth equipment is in deep sleep state in a cycle calculates:
TDS=9.884s
So finally calculating the average consumed cur-rent of my our bluetooth equipments:
CAvg=0.0335536mA
From which further follow that the cruise duration of battery:
TBL=95369 hours=3973 days=10.8
If not introducing external clock, similarly according to calculating process above, analyze under identical condition
The average current consumption of TLSR8266 and the cruise duration of battery:
Computing object above remains unchanged, and only regards deep sleep as shallow sleep.
BC=3200mAh
TC=10s
TS=0.1s
CS=0.04mA
T2E=0.005s
C2E=20mA
TDS=9.884s
The above amount remains unchanged.
CDS=0.04mA
Shallow sleep current is 40uA, so CDSChange.
T1E=0.005s
C1E=20mA
There is the amount of all of the above, so that it may calculate:
CAvg=0.059936
TBL=53390 hours=2224 days=6 years
Comparison introduces external clock and does not introduce external clock:
Above-mentioned comparison demonstrates very much, and the design for introducing external clock significantly reduces bluetooth equipment power consumption.Especially passing
In the application of sensor+low-power consumption bluetooth, play the role of to the utilization of battery positive.
It should be pointed out that positive effect can be generated to the optimization of power supply by introducing external clock design, and there is it
Part.
In application range, equipment must have periodic working method, but also allow to have other working methods.
If quiescent current consumption accounts for entire electricity in the case where not introducing external clock in the entire duty cycle of equipment
This consumption ratio of stream is larger.Specifically, the Design of power saving for introducing external clock is suitable for the microcontroller with sleep timer
Device, but the sleep current of system accounts for the consumption 60-80% of whole system.
First embodiment is method implementation corresponding with present embodiment, and present embodiment can be implemented with first
Mode is worked in coordination implementation.The relevant technical details mentioned in first embodiment are still effective in the present embodiment, in order to
It reduces and repeats, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in the first implementation
In mode.
It should be noted that in the claim and specification of this patent, such as first and second or the like relationship
Term is only used to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying
There are any actual relationship or orders between these entities or operation.Moreover, the terms "include", "comprise" or its
Any other variant is intended to non-exclusive inclusion so that include the process, methods of a series of elements, article or
Equipment not only includes those elements, but also including other elements that are not explicitly listed, or further include for this process,
Method, article or the intrinsic element of equipment.In the absence of more restrictions, being wanted by what sentence " including one " limited
Element, it is not excluded that there is also other identical elements in the process, method, article or apparatus that includes the element.
Although being shown and described to the present invention by referring to some of the preferred embodiment of the invention,
It will be understood by those skilled in the art that can to it, various changes can be made in the form and details, without departing from this hair
Bright spirit and scope.