STM32F7 4 Power controller (PWR)

Started by tha, October 14, 2022, 06:47:32 AM

Previous topic - Next topic

tha

4.3.3 Low-power mode

Entering low-power mode

Low-power modes ถูกเข้าสู่โดย the MCU ปฏิบัติ the WFI (Wait For Interrupt), หรือ WFE (Wait For Event) instructions, หรือเมื่อ the SLEEPONEXIT bit ใน the Cortex®-M7 System Control register ถูกเซ็ตตอน Return from ISR.

tha

Exiting low-power mode

จาก Sleep and Stop modes the MCU ออกจาก low-power mode ขึ้นอยู่กับวิธีที่ the mode นั้นเคยเข้าสู่:
•   ถ้า the WFI instruction หรือ Return from ISR เคยถูกใช้ในการเข้าสู่ the low-power mode, peripheral interrupt ใดๆที่
     ยอมรับโดย the NVIC สามารถปลุก the device.
•   ถ้า the WFE instruction ถูกใช้ในการเข้าสู่ the low-power mode, the MCU จะออกจาก the low-power mode ทันทีที่ an
     event เกิดขึ้น. The wakeup event สามารถถูกสร้างโดยอย่างใดอย่างหนึ่ง:
     –   NVIC IRQ interrupt:
          - เมื่อ SEVONPEND = 0 ใน the Cortex®-M7 System Control register:
          โดยการเปิดใช้งาน an interrupt ใน the peripheral control register และใน the NVIC. เมื่อ the MCU กลับมาทำงานต่อ
          จาก WFE, the peripheral interrupt pending bit และ the NVIC peripheral IRQ channel pending bit (ใน the
          NVIC interrupt clear pending register) ต้องถูกเคลียร์.
          เฉพาะ NVIC interrupts ที่มี sufficient priority เท่านั้นที่จะปลุกและอินเตอร์รัพท์ the MCU.
          - เมื่อ SEVONPEND = 1 ใน the Cortex®-M7 System Control register:
          โดยการเปิดใช้งาน an interrupt ใน the peripheral control register และเป็นทางเลือกใน the NVIC. เมื่อ the MCU กลับมา
          ทำงานต่อจาก WFE, the peripheral interrupt pending bit และ (เมื่อเปิดใช้งาน) the NVIC peripheral IRQ channel
          pending bit (ใน the NVIC interrupt clear pending register) ต้องถูกเคลียร์.
          ทุก NVIC interrupts จะปลุก the MCU, แม้กระทั่งตัวที่ปิดใช้งาน.
          เฉพาะ NVIC interrupts ที่เปิดใช้งานที่มี priority เพียงพอเท่านั้นที่จะปลุกและอินเตอร์รัพท์ the MCU.
     –   Event
          การกำหนดค่า a EXTI line ใน event mode. เมื่อ the CPU กลับมาทำงานต่อจาก WFE, ไม่มีความจำเป็นที่จะเคลียร์
          the EXTI peripheral interrupt pending bit หรือ the NVIC IRQ channel pending bit เนื่องจาก the pending bits ที่
          ตรงกันกับ the event line ไม่ได้ถูกเซ็ต. อาจมีความจำเป็นที่จะเคลียร์ the interrupt flag ใน the peripheral.

จาก Standby mode the MCU ออกจาก low-power mode ผ่านทาง an external reset (NRST pin), an IWDG reset, a rising edge บนหนึ่งใน the enabled WKUPx pins หรือ a RTC event (ดู Figure 284: RTC block diagram).

tha

4.3.4 Sleep mode

I/O states in Sleep mode

ใน Sleep mode, ทุก I/O pins จะคงสถานะเดียวกับใน Run mode.

Entering Sleep mode

The Sleep mode ถูกเข้าสู่โดยการปฏิบัติ the WFI (Wait For Interrupt) หรือ WFE (Wait for Event) instructions. สองทางเลือกมีให้ใช้งานในการเลือก the Sleep mode entry mechanism, ขึ้นอยู่กับ the SLEEPONEXIT bit ใน the Cortex®-M7 System Control register:
•   Sleep-now: ถ้า the SLEEPONEXIT bit ถูกเคลียร์, the MCU เข้าสู่ Sleep mode ทันทีที่ WFI or WFE instruction ถูกปฏิบัติ.
•   Sleep-on-exit: ถ้า the SLEEPONEXIT bit ถูกเซ็ต, the MCU เข้าสู่ Sleep mode ทันทีที่มันออกจาก the lowest priority ISR.

ดูที่ Table 15 and Table 16 สำหรับรายละเอียดเกี่ยวกับวิธีการเข้าสู่ Sleep mode.


tha

Exiting Sleep mode

ถ้า the WFI instruction ถูกใช้ในการเข้าสู่ Sleep mode, peripheral interrupt ใดๆที่ยอมรับโดย the nested vectored interrupt controller (NVIC) จะสามารถปลูก the device จาก Sleep mode.

ถ้า the WFE instruction ถูกใช้ในการเข้าสู่ Sleep mode, the MCU จะออกจาก Sleep mode, ทันทีที่ an event เกิดขึ้น. The wakeup event สามารถถูกสร้างโดยอย่างใดอย่างหนึ่ง:
•   เปิดใช้งาน an interrupt ใน the peripheral control register แต่ไม่ใน the NVIC, และเปิดใช้งาน the SEVONPEND bit ใน
     the Cortex®-M7 System Control register. เมื่อ the MCU กลับมาทำงานต่อจาก WFE, the peripheral interrupt pending
     bit และ the peripheral NVIC IRQ channel pending bit (ใน the NVIC interrupt clear pending register) ต้องถูกเคลียร์.
•   หรือการกำหนดค่า an external or internal EXTI line ใน event mode. เมื่อ the CPU กลับมาทำงานต่อจาก WFE, มันไม่มีความ
     จำเป็นที่จะต้องเคลียร์ the peripheral interrupt pending bit หรือ the NVIC IRQ channel pending bit เนื่องจาก the
     pending bit ที่ตรงกันกับ the event line ไม่ได้ถูกเซ็ต.

โหมดนี้เสนอ the lowest wakeup time เนื่องจากไม่มีเวลาถูกเสียไปใน interrupt entry/exit.

ดูที่ Table 15 and Table 16 สำหรับรายละเอียดเกี่ยวกับวิธีการออกจาก Sleep mode.



tha

4.3.5 Stop mode

The Stop mode ตั้งอยู่บน the Cortex®-M7 deepsleep mode ที่รวมกันกับ peripheral clock gating. The voltage regulator สามารถถูกกำหนดค่าใน normal หรือ low-power mode อย่างใดอย่างหนึ่ง. ใน Stop mode, ทุก clocks ใน the 1.2 V domain จะถูกหยุด, the PLLs, the HSI and the HSE RC oscillators จะถูกปิดใช้งาน. Internal SRAM and register contents จะถูกรักษาไว้.

In Stop mode, the power consumption สามารถถูกลดลงได้อีกโดยใช้การตั้งค่าเพิ่มเติมใน the PWR_CR1 register. อย่างไรก็ตามจะทำให้ an additional startup delay เมื่อ waking up จาก Stop mode (ดู Table 17).



tha

I/O states in Stop mode

ใน stop mode, ทุก I/O pins จะคงสถานะเดียวกับใน the run mode

Entering Stop mode

The Stop mode ถูกเข้าสู่สอดคล้องกับ Entering low-power mode, เมื่อ the SLEEPDEEP bit ใน Cortex®-M7 System Control register ถูกเซ็ต.

ดูที่ Table 18 สำหรับรายละเอียดเกี่ยวกับวิธีการเข้าสู่ the Stop mode.

เมื่อ the microcontroller เข้าสู่ใน Stop mode, the voltage scale 3 จะถูกเลือกโดยอัตโนมัติ. เพื่อลด power consumption ให้มากขึ้นใน Stop mode, the internal voltage regulator สามารถถูกใส่ลงใน low-power หรือ low voltage mode. นี้ถูกกำหนดค่าโดย the LPDS, MRUDS, LPUDS and UDEN bits ของ the PWR power control register (PWR_CR1).

ถ้า Flash memory programming กำลังดำเนินการอยู่, the Stop mode entry จะถูกหน่วงเวลาจนกระทั่ง the memory access ถูกทำให้สำเร็จลง.

ถ้า an access ไปยัง the APB domain กำลังดำเนินการอยู่, The Stop mode entry จะถูกหน่วงเวลาจนกระทั่ง the APB access ถูกทำให้สำเร็จลง.

ถ้า the Over-drive mode ถูกเปิดใช้งานแล้วก่อนการเข้าสู่ Stop mode, มันจะถูกปิดใช้งานโดยอัตโนมัติในระหว่างเมื่อ the Stop mode ถูกทำให้ทำงาน.

ใน Stop mode, คุณลักษณะต่อไปนี้สามารถถูกเลือกโดยการโปรแกรม individual control bits:
•   Independent watchdog (IWDG): the IWDG ถูกสตาร์ทโดยการเขียนไปยัง Key register ของมันหรือโดย hardware option.
     ทันทีที่สตาร์ทมันไม่สามารถถูกหยุดยกเว้นโดย a Reset. ดู Section 27.3 ใน Section 27: Independent watchdog (IWDG).
•   Real-time clock (RTC): นี้ถูกกำหนดค่าโดย the RTCEN bit ใน the RCC backup domain control register (RCC_BDCR)
•   Internal RC oscillator (LSI RC): นี้ถูกกำหนดค่าโดย the LSION bit ใน the RCC clock control & status register
     (RCC_CSR).
•   External 32.768 kHz oscillator (LSE OSC): นี้ถูกกำหนดค่าโดย the LSEON bit ใน the RCC backup domain control
     register (RCC_BDCR).

The ADC หรือ DAC ยังสามารถกินพลังงานในระหว่าง the Stop mode, เว้นแต่พวกมันถูกปิดใช้งานก่อนการเข้าสู่มัน. เพื่อปิดใช้งานพวกมัน, the ADON bit ใน the ADC_CR2 register และ the ENx bit ใน the DAC_CR register ทั้งคู่ต้องถูกเขียนเป็น 0.

Note: ก่อนการเข้าสู่ Stop mode, ขอแนะนำให้เปิดใช้งาน the clock security system (CSS) feature เพื่อป้องกัน external
          oscillator (HSE) failure จากการส่งผลกระทบ the internal MCU behavior.

tha

Exiting Stop mode

ดูที่ Table 18 สำหรับรายละเอียดเกี่ยวกับวิธีการออกจาก the Stop mode.

เมื่อออกจาก Stop mode โดยกาปล่อยออก an interrupt หรือ a wakeup event, the HSI RC oscillator จะถูกเลือกเป็น system clock.

ถ้า the Under-drive mode ถูกเปิดใช้งานแล้ว, มันจะถูกปิดใช้งานโดยอัตโนมัติหลังจากออกจาก Stop mode.

เมื่อ the voltage regulator ทำงานใน low-power mode, an additional startup delay ถูกทำให้เกิดเมื่อ waking up จาก Stop mode. โดยการให้ the internal regulator ON ในระหว่าง Stop mode, the consumption จะสูงขึ้นแม้ว่า the startup time ถูกลดลง.

เมื่อ the voltage regulator ทำงานใน Under-drive mode, an additional startup delay ถูกทำให้เกิดเมื่อ waking up จาก Stop mode.



tha

4.3.6 Standby mode

The Standby mode ช่วยให้บรรลุ the lowest power consumption. มันตั้งอยู่บน the Cortex®-M7 deepsleep mode, พร้อมด้วย the voltage regulator ถูกปิดใช้งาน. The 1.2 V domain จึงถูกปิด. The PLLs, the HSI oscillator and the HSE oscillator ถูกปิดด้วย. SRAM และ register contents จะสูญหายยกเว้นสำหรับ registers in the backup domain (RTC registers, RTC backup register and backup SRAM), และ Standby circuitry (ดู Figure 5).