STM32F7 4 Power controller (PWR)

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

Previous topic - Next topic

tha

Entering Standby mode

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

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

ใน Standby 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 backup domain control register (RCC_BDCR)
•   Internal RC oscillator (LSI RC): นี้ถูกกำหนดค่าโดย the LSION bit ใน the Control/status register (RCC_CSR).
•   External 32.768 kHz oscillator (LSE OSC): นี้ถูกกำหนดค่าโดย the LSEON bit ใน the backup domain control register
     (RCC_BDCR).

tha

Exiting Standby mode

The microcontroller ออกจาก Standby mode เมื่อ an external Reset (NRST pin), an IWDG Reset, a rising or falling edge บน WKUP pin, an RTC alarm, a tamper event, หรือ a time stamp event ถูกตรวจพบ. ทุก registers จะถูกรีเซ็ตหลังจาก wakeup จาก Standby ยกเว้นสำหรับ PWR power control/status register (PWR_CSR1).

หลังจาก waking up จาก Standby mode, program execution จะสตาร์ทใหม่ในลักษณะเดียวกันกับหลังจาก a Reset (สุ่ม boot pin , vector reset ถูกเฟทช์, etc.). The SBF status flag ใน the PWR power control/status register (PWR_CSR1) แสดงให้เห็นว่า the MCU เคยอยู่ใน Standby mode.

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



I/O states in Standby mode

ใน Standby mode, ทุก I/O pins จะเป็น high impedance ยกเว้นสำหรับ:
•   Reset pad (ยังคงมีให้ใช้งาน)
•   PC13 ถ้าถูกกำหนดค่าสำหรับ tamper, time stamp, RTC Alarm out, หรือ RTC clock calibration out
•   WKUP pins (PA0/PA2/PC1/PC13/PI8/PI11), ถ้าถูกเปิดใช้งาน

tha

4.3.7 Programming the RTC alternate functions to wake up the device from the Stop and Standby modes

The MCU สามารถถูก woken up จาก a low-power mode โดย an RTC alternate function.

The RTC alternate functions คือ the RTC alarms (Alarm A and Alarm B), RTC wakeup, RTC tamper event detection และ RTC time stamp event detection.

RTC alternate functions เหล่านี้สามารถปลุก the system จาก the Stop and Standby low-power modes.

The system ยังสามารถปลุกจาก low-power modes โดยไม่มีการพึ่งพา an external interrupt (Auto-wakeup mode), โดยการใช้ the RTC alarm หรือ the RTC wakeup events.

The RTC จัดให้มี a programmable time base สำหรับ waking up จาก the Stop or Standby mode เป็นระยะๆ.

เพื่อจุดประสงค์นี้, สองใน the three alternate RTC clock sources สามารถถูกเลือกโดยการโปรแกรม the RTCSEL[1:0] bits ใน the RCC backup domain control register (RCC_BDCR):
•   Low-power 32.768 kHz external crystal oscillator (LSE OSC)
     clock source นี้จัดให้มี a precise time base ที่มี a very low-power consumption (การบริโภคเพิ่มเติมน้อยกว่า 1 μA ภายใต้
     สภาวะปกติ)
•   Low-power internal RC oscillator (LSI RC)
     clock source มีข้อได้เปรียบในการประหยัดต้นทุนของ the 32.768 kHz crystal. internal RC oscillator นี้ถูกออกแบบมาเพื่อใช้
     minimum power.


tha

RTC alternate functions to wake up the device from the Stop mode

•    เพื่อปลุก the device จาก the Stop mode ด้วย an RTC alarm event, จำเป็นต้อง:
     a)   กำหนดค่า the EXTI Line 17 ให้ sensitive กับขอบขาขึ้น (Interrupt or Event modes)
     b)   เปิดใช้งาน the RTC Alarm Interrupt ใน the RTC_CR register
     c)   กำหนดค่า the RTC เพื่อสร้าง the RTC alarm

•    เพื่อปลุก the device จาก the Stop mode ด้วย  an RTC tamper or time stamp event, จำเป็นต้อง:
     a)   กำหนดค่า the EXTI Line 21 ให้ sensitive กับขอบขาขึ้น (Interrupt or Event modes)
     b)   เปิดใช้งาน the RTC time stamp Interrupt ใน the RTC_CR register หรือ the RTC tamper interrupt ใน the
           RTC_TAFCR register
     c)   กำหนดค่า the RTC เพื่อตรวจพบ the tamper หรือ time stamp event

•    เพื่อปลุก the device จาก the Stop mode ด้วย an RTC wakeup  event, จำเป็นต้อง:
     a)   กำหนดค่า the EXTI Line 22 ให้ sensitive กับขอบขาขึ้น (Interrupt or Event modes)
     b)   เปิดใช้งาน the RTC wakeup interrupt ใน the RTC_CR register
     c)   กำหนดค่า the RTC เพื่อสร้าง the RTC Wakeup event

tha

RTC alternate functions to wake up the device from the Standby mode

•    เพื่อปลุก the device จาก the Standby mode ด้วย an RTC alarm event, จำเป็นต้อง:
     a)   เปิดใช้งาน the RTC alarm interrupt .o the RTC_CR register
     b)   กำหนดค่า the RTC เพื่อสร้าง the RTC alarm
     c)   เปิดใช้งาน the RTC internal wakeup event จาก standby โดยการเซ็ต the EIWUP bit ใน the PWR_CSR1 register

•    เพื่อปลุก the device จาก the Standby mode ด้วย an RTC tamper หรือ time stamp event, จำเป็นต้อง:
     a)   เปิดใช้งาน the RTC time stamp interrupt ใน the RTC_CR register หรือ the RTC tamper interrupt ใน the
           RTC_TAFCR register
     b)   กำหนดค่า the RTC เพื่อตรวจพบ the tamper หรือ time stamp event
     c)   เปิดใช้งาน the RTC internal wakeup event จาก standby โดยการเซ็ต the EIWUP bit ใน the PWR_CSR1 register

•    เพื่อปลุก the device จาก the Standby mode ด้วย an RTC wakeup event, จำเป็นต้อง:
     a)   เปิดใช้งาน the RTC wakeup interrupt in the RTC_CR register
     b)   กำหนดค่า the RTC เพื่อสร้าง the RTC wakeup event
     c)   เปิดใช้งาน the RTC internal wakeup event จาก standby โดยการเซ็ต the EIWUP bit ใน the PWR_CSR1 register

tha

Safe RTC alternate function wakeup flag clearing sequence

เพื่อหลีกเลี่ยง bouncing บน the pins ที่ the RTC alternate functions ถูกแม็ปถึง, และออกจาก the Stop and Standby modes อย่างถูกต้อง, ขอแนะนำให้ทำตามลำดับข้างล่างนี้ก่อนการเข้าสู่ the Standby mode:

•    เมื่อใช้ RTC alarm ในการปลุก the device จาก the low-power modes:
     a)   ปิดใช้งาน the RTC alarm interrupt (ALRAIE หรือ ALRBIE bits ใน the RTC_CR register)
     b)   เคลียร์ the RTC alarm (ALRAF/ALRBF) flag
     c)   เปิดใช้งาน the RTC alarm interrupt
     d)   เข้าสู่ใหม่ the low-power mode

•    เมื่อใช้ RTC wakeup ในการปลุก the device จาก the low-power modes:
     a)   ปิดใช้งาน the RTC Wakeup interrupt (WUTIE bit ใน the RTC_CR register)
     b)   เปิดใช้งาน the RTC Wakeup interrupt
     c)   เข้าสู่ใหม่ the low-power mode

•    เมื่อใช้ RTC tamper ในการปลุก the device จาก the low-power modes:
     a)   ปิดใช้งาน the RTC tamper interrupt (TAMPIE bit ใน the RTC_TAFCR register)
     b)   เคลียร์ the Tamper (TAMP1F/TSF) flag
     c)   เปิดใช้งาน the RTC tamper interrupt
     d)   เข้าสู่ใหม่ the low-power mode

•    เมื่อใช้ RTC time stamp ในการปลุก the device จาก the low-power modes:
     a)   ปิดใช้งาน the RTC time stamp interrupt (TSIE bit ใน RTC_CR)
     b)   เคลียร์ the RTC time stamp (TSF) flag
     c)   เปิดใช้งาน the RTC TimeStamp interrupt
     d)   เข้าสู่ใหม่ the low-power mode

tha

4.4 Power control registers

4.4.1 PWR power control register (PWR_CR1)

Address offset: 0x00
Reset value: 0x0000 C000 (reset by wakeup from Standby mode)



Bits 31:20 Reserved, must be kept at reset value.

Bits 19:18 UDEN[1:0]: Under-drive enable in stop mode
     บิตเหล่านี้ถูกเซ็ตโดย software. พวกมันช่วยให้บรรลุ a lower power consumption ใน Stop mode แต่ด้วย a longer wakeup
     time. เมื่อเซ็ต, the digital area จะมี less leakage consumption เมื่อ the device เข้าสู่ Stop mode.
     00: Under-drive disable
     01: Reserved
     10: Reserved
     11:Under-drive enable

Bit 17 ODSWEN: Over-drive switching enabled.
     บิตนี้ถูกเซ็ตโดย software. มันจะถูกเคลียร์โดยอัตโนมัติโดย hardware หลังจากออกจาก Stop mode หรือเมื่อ the ODEN bit ถูก
     รีเซ็ต. เมื่อเซ็ต, มันจะถูกใช้เพื่อสลับไปยัง Over-drive mode. เพื่อเซ็ตหรือรีเซ็ต the ODSWEN bit, the HSI or HSE ต้องถูกเลือก
     เป็น system clock. The ODSWEN bit ต้องถูกเซ็ตเฉพาะเมื่อ the ODRDY flag ถูกเซ็ตเพื่อสลับไปยัง Over-drive mode.
     0: Over-drive switching ถูกปิดใช้งาน
     1: Over-drive switching ถูกเปิดใช้งาน
  Note: บน over-drive switch ใดๆ (ถูกเปิดใช้งานหรือถูกปิดใช้งาน), the system clock จะถูกทำให้หยุดในระหว่าง the internal
            voltage set up.


Bit 16 ODEN: Over-drive enable
     บิตนี้ถูกเซ็ตโดย software. มันจะถูกเคลียร์โดยอัตโนมัติโดย hardware หลังจากออกจาก Stop mode. มันจะถูกใช้เพื่อเปิดใช้งาน the
     Over-drive mode เพื่อให้ได้ความถี่ที่สูงขึ้น.  เพื่อเซ็ตหรือรีเซ็ต the ODEN bit, the HSI or HSE ต้องถูกเลือกเป็น system
     clock. เมื่อ the ODEN bit ถูกเซ็ต, the application ต้องรอสำหรับ the Over-drive ready flag (ODRDY) ถูกเซ็ตก่อนๆการเซ็ต
     the ODSWEN bit.
     0: Over-drive ถูกปิดใช้งาน
     1: Over-drive ถูกเปิดใช้งาน

tha

Bits 15:14 VOS[1:0]: Regulator voltage scaling output selection
     บิตเหล่านี้ควบคุม the main internal voltage regulator output voltage เพื่อให้บรรลุการแลกเปลี่ยนระหว่าง performance และ
     power consumption เมื่อ the device ไม่ได้ทำงานที่ the maximum frequency (ดูที่ the STM32F75xxx and
     STM32F74xxx datasheets สำหรับรายละเอียดที่มากขึ้น).
     บิตเหล่านี้สามารถถูกแก้ไขเฉพาะเมื่อ the PLL ถูก OFF. The new value programmed จะทำงานเฉพาะเมื่อ the PLL ถูก ON. เมื่อ
     the PLL iถูก OFF, the voltage scale 3 จะถูกเลือกโดยอัตโนมัติ.
     00: Reserved (Scale 3 mode ถูกเลือก)
     01: Scale 3 mode
     10: Scale 2 mode
     11: Scale 1 mode (reset value)

Bit 13 ADCDC1:
     0: ไม่มีผลอะไร.
     1: ดูที่ AN4073 สำหรับรายละเอียดเกี่ยวกับวิธีการใช้บิตนี้.
  Note: บิตนี้สามารถถูกเซ็ตเฉพาะเมื่อทำงานที่ supply voltage range 2.7 ถึง 3.6V.