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.
(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:
(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).
Previous article:STM8 AWU registers
Next article:STM8 interrupt mapping
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- Can MSP430FR2633 be connected to an external 7.3728MHz crystal?
- STM32+W25Q64 failed to read and write external flash
- How do you calculate the current gain of this circuit?
- Brief Introduction of Ultra-Wideband (UWB) Development
- Low-Cost Digital Thermometer Using a Single-Chip Microcontroller
- [GD32E503 Review] Simple Oscilloscope Experiment (Continued 2)
- Application of TPS61046 dual output in optical communication
- A generation of "mobile phone overlord" may lay off 10,000 employees. Someone around you must have used its mobile phone!
- High-speed circuit design
- The pin is floating but the voltage is still output?