STM32F7 4 Power controller (PWR)

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

Previous topic - Next topic

tha

4.2.3 Programmable voltage detector (PVD)

ผู้ใช้สามารถใช้ the PVD เพื่อมอนิเตอร์ the VDD power supply โดยการเปรียบเทียบมันกับขอบเขตที่เลือกโดย the PLS[2:0] bits ใน the PWR power control register (PWR_CR1).

The PVD ถูกเปิดใช้งานโดยการเซ็ต the PVDE bit.

A PVDO flag มีให้ใช้งาน, ใน the PWR power control/status register (PWR_CSR1), เพื่อแสดงให้เห็นหาก VDD สูงกว่าหรือต่ำกว่า the PVD threshold. event นี้ถูกต่อภายในเข้ากับ the EXTI line16 และสามารถสร้าง an interrupt ถ้าถูกเปิดใช้งานผ่านทาง the EXTI registers. The PVD output interrupt สามารถถูกสร้างเมื่อ VDD ดร็อปลงต่ำกว่า the PVD threshold และ/หรือเมื่อ VDD พุ่งขึ้นเหนือ the PVD threshold ขึ้นอยู่กับ EXTI line16 rising/falling edge configuration. ดังตัวอย่าง the service routine สามารถดำเนินการ emergency shutdown tasks


tha

4.3 Low-power modes

โดยค่าเริ่มต้น, the microcontroller จะอยู่ใน Run mode หลังจาก a system หรือ a power-on reset. ใน Run mode the CPU ถูกให้สัญญานนาฬิกาโดย HCLK และ the program code ถูกปฏิบัติ. หลาย low-power modes มีให้ใช้งานเพื่อ save power เมื่อ the CPU ไม่จำเป็นต้องรัน, ตัวอย่างเช่นเมื่อรอสำหรับ an external event. มันขึ้นอยู่กับผู้ใช้ที่จะเลือก the mode ที่ให้การประนีประนอมที่ดีที่สุดระหว่าง low-power consumption, short startup time และ available wakeup sources.

The devices มีคุณลักษณะe three low-power modes:
•   Sleep mode (Cortex®-M7 core ถูกหยุด, peripherals kept running)
•   Stop mode (ทุก clocks ถูกหยุด)
•   Standby mode (1.2 V domain powered off)

นอกจากนี้, the power consumption ใน Run mode สามารถถูกลดได้โดยวิธีใดวิธีหนึ่งต่อไปนี้:
•   ทำให้ช้าลง the system clocks
•   ปิด the clocks ที่ไปยัง the APBx and AHBx peripherals เมื่อพวกมันไม่ถูกใช้.

tha

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 จาก ISR.

การเข้าสู่ Low-power mode ผ่านทาง WFI or WFE จะถูกปฏิบัติเฉพาะถ้าไม่มี interrupt กำลังค้างอยู่หรือไม่มี event กำลังค้างอยู่.


tha

Exiting low-power mod

The MCU ออกจาก Sleep and Stop modes low-power mode ขึ้นอยู่กับวิธีที่ the low-power 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.

The MCU ออกจาก Standby 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).

หลังจาก waking up จาก Standby mode, program execution สตาร์ทใหม่ในวิธีเดียวกันกับหังจาก a Reset (สุ่ม boot pin , โหลด option bytes, reset vector ถูกเฟทช์, etc.). เฉพาะ NVIC interrupts ที่เปิดใช้งานที่มี priority เพียงพอเท่านั้น ที่จะปลุกและอินเตอร์รัพท์ the MCU.




tha




1. Legend: Y = Yes (เปิดใช้งาน). O = ทางเลือก (ปิดใช้งานโดยค่าเริ่มต้น สามารถเปิดใช้งานโดย software). - = ไม่มีให้ใช้งาน.
    Wakeup เน้นด้วยสีเทา.

2. บาง peripherals ที่มีความสามารถ wakeup from Stop สามารถร้องขอ HSI ให้ถูกเปิดใช้งาน. ในกรณีนี้e, HSI จะถูกปลุกโดย the
    peripheral, และจะป้อนเฉพาะ the peripheral ซึ่งร้องขอมัน. HSI จะถูดปิดโดยอัตโนมัติเมื่อ the peripheral ไม่ต้องการมันอีกต่อไป.


tha

4.3.1 Debug mode

โดยค่าเริ่มต้น, the debug connection จะหายไปเมื่อ the devices เข้าสู่ใน Stop or Standby mode ในขณะที่ the debug features ถูกใช้. นี้เนื่องจากความจริงที่ว่า the Cortex®-M7 core ไม่ได้ถูกให้สัญญานนาฬิกาอีกต่อไป.

อย่างไรก็ตาม, โดยการเซ็ตบาง configuration bits ใน the DBGMCU_CR register, the software สามารถถูกดีบักถึงแม้เมื่อใช้ the low-power modes อย่างกว้างขวาง. สำหรับรายละเอียดที่มากขึ้น, ดูที่ Section 40.16.1: Debug support for low-power modes.

tha

4.3.2 Run mode

Slowing down system clocks

ใน Run mode ความเร็วของ the system clocks (SYSCLK, HCLK, PCLK1, PCLK2) สามารถถูกลดลงได้โดยการโปรแกรม the prescaler registers. prescalers เหล่านี้ยังสามารถถูกใช้เพื่อทำให้ peripherals ช้าลงก่อนการเข้าสู่ Sleep mode.

สำหรับรายละเอียดที่มากขึ้น, ดูที่ Section 5.3.3: RCC clock configuration register (RCC_CFGR).

tha

Peripheral clock gating

ใน Run mode, the HCLKx and PCLKx สำหรับ individual peripherals and memories สามารถถูกหยุดได้ตลอดเวลาเพื่อลด power consumption.

เพื่อลด power consumption ให้มากขึ้นใน Sleep mode the peripheral clocks สามารถถูกปิดใช้งานก่อนการปฏิบัติ the WFI or WFE instructions.

Peripheral clock gating ถูกควบคุมโดย the AHB1 peripheral clock enable register (RCC_AHB1ENR), AHB2 peripheral clock enable register (RCC_AHB2ENR), AHB3 peripheral clock enable register (RCC_AHB3ENR) (see Section 5.3.10: RCC AHB1 peripheral clock register (RCC_AHB1ENR), Section 5.3.11: RCC AHB2 peripheral clock enable register (RCC_AHB2ENR), and Section 5.3.12: RCC AHB3 peripheral clock enable register (RCC_AHB3ENR).

การปิดใช้งาน the peripherals clocks ใน Sleep mode สามารถถูกดำเนินการได้อย่างอัตโนมัติโดยการรีเซ็ตบิตที่ตรงกันใน RCC_AHBxLPENR and RCC_APBxLPENR registers.