STM8 automatic wake-up (AWU)

Publisher:码字探险Latest update time:2020-07-07 Source: eefocusKeywords:STM8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction

AWU is used to provide an internal wake-up time reference when the MCU enters the low-power Active Halt mode. The clock of this time reference is provided by the internal low-speed RC oscillator clock (LSI) or the pre-divided HSE crystal clock. When
the STM8 LSI clock measurement
uses the LSI low-speed internal clock, in order to ensure the best accuracy, its frequency can be measured by TIM3 input capture 1.

STM8_AWU clock block diagram
(Table 18: AWU clock block diagram)

Note: The LS low-speed clock source is selected by programming the CKAWUSEL option bit. See the Clock Controller section for details.

AWU Operations

To use the AWU function of the STM8, perform the following steps in order:
1. Use the MSR bits of the AWU_CSR register and the input capture channel 1 of TIM3 to detect the LS clock frequency;
2. Define the appropriate prescaler value by writing the APR[5:0] bits of the AWU_APR;
3. Select the required auto-wake-up delay by writing the AWUTB[3:0] bits of the AWU_TBR;
4. Set the AWUEN bit of the AWU_CSR;
5. Execute the HALT instruction.
Note: The counter starts counting only when the MCU enters the active stop mode after the HALT instruction (please refer to the Active Stop Mode section of Power Management) and the AWU interrupt is enabled at the same time.
The prescaler counter starts counting only when the APR[5:0] value is different from its reset value 0x3F. If the AWU is not used in
the idle mode
, the value '0000' must be loaded into the AWUTB[3:0] bits of the AWU_TBR to make the STM8 reduce power consumption.

Time base selection

Please refer to the description of AWU_PAR and AWU_TBR.
The time interval of AWU depends on the value of AWUTB[3:0] bits and the value of APR[5:0] bits (APRDIV). 15 non-overlapping time intervals can be defined as follows:

STM8_AWUTB[3:0] selection
(Table 22: AWUTB[3:0] selection)


(Table 23: Example when fLS=128 kHz and target time is 78.5 ms)

 

LSI low speed internal clock frequency detection

After factory calibration, the frequency dispersion of the low speed internal RC (LSI) oscillator is 128 kHz +/- 12.5% ​​over the full temperature range. In order to obtain accurate AWU time intervals or buzzer outputs, the LSI frequency must be accurately measured. The
following steps can be taken:
1. Set the MSR bit of the AWU_CSR to 1 to connect the LSI internal clock to ICAP1 of the TIM3 timer;
2. Measure the LSI clock frequency through the input capture interrupt of the timer;
3. Write an appropriate value to the APR[5:0] bits of the AWU_APR to adjust the AWU timing interval to the desired time interval.
 The AWUTB[3:0] bits can be changed to select different time intervals.
The LSI clock frequency measurement method can also be used to calibrate the buzzer frequency (see 13.2.2).


Keywords:STM8 Reference address:STM8 automatic wake-up (AWU)

Previous article:STM8 AWU registers
Next article:STM8 interrupt mapping

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号