STM32F7 4 Power controller (PWR)

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

Previous topic - Next topic

tha

Backup SRAM

The backup domain ประกอบด้วย 4 Kbytes of backup SRAM ที่ที่อยู่ใน 32-bit, 16-bit or 8-bit mode. สิ่งที่อยู่ภายในของมันถูกรักษาแม้ใน Standby or VBAT mode เมื่อ the low-power backup regulator ถูกเปิดใช้งาน. มันสามารถถูกพิจารณาได้ว่าเป็น an internal EEPROM เมื่อ VBAT ปรากฎอยู่เสมอ.

เมื่อ the backup domain ถูกจ่ายไฟโดย VDD (analog switch ต่อกับ VDD), the backup SRAM ถูกให้กำลังจาก VDD ซึ่งแทนที่ the VBAT power supply เพื่อประหยัดแบตเตอรี่.

เมื่อ the backup domain ถูกจ่ายไฟโดย VBAT (analog switch ต่อกับ VBAT เนื่องจาก VDD ไม่ปรากฎ), the backup SRAM ถูกให้กำลังจาก a dedicated low-power regulator. regulator นี้สามารถ ON หรือ OFF ขึ้นอยู่กับว่า the application ต้องการ the backup SRAM function ใน Standby and VBAT modes หรือไม่. The power-down ของ regulator นี้ถูกควบคุมโดยบิตที่อุทิศให้, the BRE control bit ของ the PWR_CSR1 register (ดู Section 4.4.2: PWR power control/status register (PWR_CSR1)).

The backup SRAM จะไม่ถูกลบเป็นก้อนโดย an tamper event. มันถูกป้องกันการอ่านเพื่อป้องกัน confidential data, อย่างเช่น cryptographic private key, จากการกำลังถูกเข้าถึง. The backup SRAM สามารถถูกลบเฉพาะผ่านทาง the Flash interface เมื่อ a protection level เปลี่ยนจาก level 1 เป็น level 0 ถูกร้องขอ. ดูที่ the description of Read protection (RDP) option byte.


tha

4.1.4 Voltage regulator

An embedded linear voltage regulator จ่ายไฟให้ทุก the digital circuitries ยกเว้นสำหรับ the backup domain และ the Standby circuitry. The regulator output voltage จะอยู่ประมาณ 1.2 V.

voltage regulator นี้ต้องการ two external capacitors ที่จะถูกต่อเข้ากับ two dedicated pins, VCAP_1 and VCAP_2 มีให้ใช้งานในทุก packages. Specific pins ต้องถูกต่อกับอย่างใดอย่างหนึ่ง VSS หรือ VDD เพื่อทำให้ทำงานหรือทำให้หยุดทำงาน the voltage regulator. pins เหล่านี้ขึ้นอยู่กับ the package.

เมื่อทำให้ทำงานโดย software, the voltage regulator จะถูกเปิดใช้งานเสมอหลังจาก Reset. มันทำงานใน three different modes ขึ้นอยู่กับ the application modes (Run, Stop, or Standby mode).

tha

•   ใน Run mode, the main regulator จะจ่ายพลังงานเต็มที่ให้กับ the 1.2 V domain (core, memories and digital
     peripherals). ในโหมดนี้, the regulator output voltage (ประมาณ 1.2 V) สามารถถูกปรับขนาดได้โดย software เป็นค่าแรงดัน
     ไฟฟ้าที่แตกต่างกัน (scale 1, scale 2, and scale 3 สามารถถูกกำหนดค่าผ่านทาง VOS[1:0] bits ของ the PWR_CR1
     register). The scale สามารถถูกแก้ไขเฉพาะเมื่อ the PLL ถูก OFF และ the HSI หรือ HSE clock source ถูกเลือกเป็น system
     clock source. ค่าใหม่ที่โปรแกรมจะทำงานเฉพาะเมื่อ the PLL ถูก ON. เมื่อ the PLL ถูก OFF, the voltage scale 3 จะถูกเลือก
     โดยอัตโนมัติ.

     The voltage scaling ช่วยให้ปรับให้ดีขึ้น the power consumption เมื่อ the device ถูกให้สัญญานนาฬิกาต่ำกว่า the
     maximum system frequency. หลังจากออกจาก Stop mode, the voltage scale 3 จะถูกเลือกโดยอัตโนมัติ.(ดู Section
     4.4.1: PWR power control register (PWR_CR1).

     2 operating modes มีให้ใช้งาน:
     –   Normal mode: The CPU and core logic ทำงานที่ maximum frequency ที่ a given voltage scaling (scale
          1, scale 2 or scale 3)
     –   Over-drive mode: โหมดนี้ช่วยให้ the CPU and the core logic ทำงานที่ความถี่ที่สูงกว่า the normal mode
          สำหรับ the voltage scaling scale 1 and scale 2.


tha

•   ใน Stop mode: the main regulator หรือ low-power regulator จ่ายไฟ a low-power voltage ให้กับ the 1.2V domain,
     ดังนั้นเก็บรักษาสิ่งที่บรรจุอยู่ภายในของ registers และ internal SRAM.

     The voltage regulator สามารถถูกใส่ใน main regulator mode (MR) หรือใน low-power mode (LPR) อย่างใดอย่างหนึ่ง. ทั้ง
     สองโหมดสามารถถูกกำหนดค่าโดย software ดังต่อไปนี้:
     –   Normal mode: the 1.2 V domain จะถูกเก็บรักษาไว้ใน nominal leakage mode. มันเป็น the default mode เมื่อ the
          main regulator (MR) หรือ the low-power regulator (LPR) ถูกเปิดใช้งาน.
     –   Under-drive mode: the 1.2 V domain จะถูกเก็บรักษาไว้ใน reduced leakage mode. โหมดนี้มีให้ใช้งานเฉพาะกับ the
          main regulator หรือ the low-power regulator mode (ดู Table 12).

•   ใน Standby mode: the regulator ถูกปิด. The content of the registers และ SRAM จะสูญหายยกเว้นสำหรับ the Standby
     circuitry และ the backup domain.

Note: Over-drive และ under-drive mode ไม่มีให้ใช้งานเมื่อ the regulator ถูกข้ามผ่าน.
           สำหรัยรายละเอียดที่มากขึ้น, ดูที่ the voltage regulator section ใน the datasheets.



tha

Entering Over-drive mode

ขอแนะนำให้เข้าสู่ Over-drive mode เมื่อ the application ไม่ได้กำลังรัน critical tasks และเมื่อ the system clock source คือ HSI หรือ HSE อย่างใดอย่างหนึ่ง. เพื่อปรับ the configuration time ให้ดีขึ้น, เปิดใช้งาน the Over-drive mode ในระหว่าง the PLL lock phase.

เพื่อเข้าสู่ Over-drive mode, ทำตามขั้นตอนข้างล่าง:
1.   เลือก HSI หรือ HSE เป็น system clock.
2.   กำหนดค่า RCC_PLLCFGR register และเซ็ต PLLON bit ของ RCC_CR register.
3.   เซ็ต ODEN bit of PWR_CR1 register เพื่อเปิดใช้งาน the Over-drive mode และรอสำหรับ the ODRDY flag ที่จะถูกเซ็ตใน
      the PWR_CSR1 register.
4.   เซ็ต the ODSW bit ใน the PWR_CR1 register เพื่อสลับ the voltage regulator จาก Normal mode ไปยัง Over-drive
      mode. The System จะถูกทำให้หยุดในระหว่าง the switch แต่ the PLL clock system จะยังคงกำลังรันในระหว่าง locking
      phase.
5.   รอสำหรับ the ODSWRDY flag ใน the PWR_CSR1 ที่จะถูกเซ็ต.
6.   เลือก the required Flash latency รวมทั้ง AHB and APB prescalers.
7.   รอสำหรับ PLL lock.
8.   สลับ the system clock ไปยัง the PLL.
9.   เปิดใช้งาน the peripherals ที่ไม่ถูกสร้างโดย the System PLL (I2S clock, LCD-TFT clock, SAI1 clock, USB_48MHz
      clock....).

Note: The PLLI2S and PLLSAI สามารถถูกกำหนดค่าที่เวลาเดียวกันกับ the system PLL.

          ในระหว่าง the Over-drive switch activation, ไม่ควรที่ peripheral clocks ถูกเปิดใช้งาน. The peripheral clocks ต้องถูก
          เปิดใช้งานทันทีที่ the Over-drive mode ถูกทำให้ทำงาน.

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

tha

Exiting from Over-drive mode

ขอแนะนำให้ออกจาก Over-drive mode เมื่อ the application ไม่ได้กำลังรัน critical tasks และเมื่อ the system clock source คือ HSI หรือ HSE อย่างใดอย่างหนึ่ง. มีสองลำดับที่ยอมให้ออกจาก over-drive mode:
•   โดยการรีเซ็ต the ODEN and ODSW bits bit พร้อมกันใน the PWR_CR1 register (ลำดับที่ 1)
•   โดยการรีเซ็ต the ODSW bit ก่อนเพื่อสลับ the voltage regulator ไปเป็น Normal mode และจากนั้นรีเซ็ต the ODEN bit เพื่อ
     ปิดใช้งาน the Over-drive mode (ลำดับที่ 2).

ตัวอย่างของลำดับที่ 1:
1.   เลือก HSI หรือ HSE เป็น system clock source.
2.   ปิดใช้งาน the peripheral clocks ที่ไม่ถูกสร้างโดย the System PLL (I2S clock, LCD-TFT clock, SAI1 clock,
      USB_48MHz clock,....)
3.   รีเซ็ต the ODEN and ODSW bits bit พร้อมกันใน the PWR_CR1 register เพื่สลับ the voltage regulator กลับไปเป็น
      Normal mode และปิดใช้งาน the Over-drive mode.
4.  รอสำหรับ the ODWRDY flag of PWR_CSR1 ที่จะถูกรีเซ็ต.

ตัวอย่างของลำดับที่ 2:
1.   เลือก HSI หรือ HSE เป็น system clock source.
2.   ปิดใช้งาน the peripheral clocks ที่ไม่ถูกสร้างโดย the System PLL (I2S clock, LCD-TFT clock, SAI1 clock,
      USB_48MHz clock,....)
3.   รีเซ็ต the ODSW bits bit ใน the PWR_CR1 register เพื่สลับ the voltage regulator กลับไปเป็น Normal mode. The
      system clock จะถูกทำให้หยุดในระหว่าง voltage switching.
4.   รอสำหรับ the ODWRDY flag of PWR_CSR1 ที่จะถูกรีเซ็ต.
5.   รีเซ็ต the ODEN bit ใน the PWR_CR1 register เพื่อปิดใช้งาน the Over-drive mode.

Note: ในระหว่าง step 3, the ODEN bit ยังคงเซ็ตและ the Over-drive mode ยังคงถูกเปิดใช้งานแต่จะไม่ทำงาน (ODSW bit ถูก
          รีเซ็ต). ถ้า the ODEN bit ถูกรีเซ็ตแทน, the Over-drive mode จะถูกปิดใช้งานและ the voltage regulator จะถูกสลับกลับ
          ไปยัง the initial voltage.

tha

4.2 Power supply supervisor

4.2.1 Power-on reset (POR)/power-down reset (PDR)

The device มี an integrated POR/PDR circuitry ที่ช่วยให้ proper operation เริ่มต้นจาก 1.8 V.

The device ยังคงอยู่ใน Reset mode เมื่อ VDD/VDDA อยู่ต่ำกว่าขอบเขตที่ระบุ, VPOR/PDR, โดยปราศจากความจำเป็นสำหรับ an external reset circuit. สำหรับรายละเอียดเกี่ยวกับ the power on/power-down reset threshold, ดูที่ the electrical characteristics ของ the datasheet.



tha

4.2.2 Brownout reset (BOR)

ในระหว่าง power on, the Brownout reset (BOR) จะเก็บ the device ภายใต้ reset จนกระทั่ง the supply voltage มาถึง the specified VBOR threshold.

VBOR ถูกกำหนดค่าผ่านทาง device option bytes. โดยค่าเริ่มต้น, BOR จะปิด. 3 programmable VBOR threshold levels สามารถถูกเลือก:
•   BOR Level 3 (VBOR3). Brownout threshold level 3.
•   BOR Level 2 (VBOR2). Brownout threshold level 2.
•   BOR Level 1 (VBOR1). Brownout threshold level 1.

Note: สำหรับรายละเอียดเต็มเกี่ยวกับ BOR characteristics, ดูที่ the "Electrical characteristics" section ใน the device
          datasheet.


เมื่อ the supply voltage (VDD) ดร็อปลงต่ำกว่า the selected VBOR threshold, a device reset จะถูกสร้าง.

The BOR สามารถถูกปิดใช้งานโดยการโปรแกรม the device option bytes. ในกรณีนี้, the power-on and power-down ดังนั้นจะถูกมอนิเตอร์โดย the POR/ PDR (ดู Section 4.2.1: Poweron reset (POR)/power-down reset (PDR)).

The BOR threshold hysteresis จะอยู่ประมาณ 100 mV (ระหว่าง the rising และ the falling edge ของ the supply voltage)