博文

目前显示的是标签为“STM32L4”的博文

STM32 pins VCC, VDD, VEE, VSS, VBAT

图片
  This is a fundamental and important concept when starting with STM32 (or any microcontroller ). Here’s a clear breakdown of what these pins mean and how to handle them on an STM32. The Quick Answer (TL;DR) VDD:   Positive supply voltage  for the  digital  internal logic. (e.g., 3.3V) VCC:   Positive supply voltage  for the  analog  peripherals (ADCs, DACs, etc.) and I/O pins. Often connected to the same 3.3V rail as VDD. VSS:   Ground reference  for the digital circuitry (0V). VSSA:   Ground reference  for the analog circuitry. (Must be connected to VSS but with a careful layout). VREF+ / VREF-:   Reference voltage  for the Analog-to-Digital Converter (ADC). Provides a cleaner reference than VCC/VSSA for accurate measurements. VBAT:  Backup power input for the Real-Time Clock (RTC), backup registers, and sometimes the low-power oscillator when main power is off. VEE:   Negative supply voltage . Rar...

Single-Chip Microcontroller Lithium Battery Power Management & Voltage Detection

图片
  For battery-powered embedded systems (e.g., IoT devices, wearables), efficient power management and voltage monitoring are critical. Below is a comprehensive guide to implementing   Li-ion/LiPo battery power and voltage detection   using a single microcontroller (e.g., STM32 , ESP32, PIC ). 1. Power Supply Options for Li-ion/LiPo Batteries Method Pros Cons Direct Connection Simple, no extra components Risk of undervoltage damage LDO Regulator Stable 3.3V/5V output Inefficient (high dropout voltage) Buck-Boost Converter High efficiency (e.g., TPS63020) Complex circuit PMIC ICs Integrated charging/protection Higher cost (e.g., MAX1555) Typical Setup: Li-ion Battery (3.7V) → Buck-Boost Converter → 3.3V MCU └─ Voltage Divider → ADC (for monitoring) 2. Voltage Detection Using MCU ADC Hardware Design Voltage Divider  (for safe ADC input): Li-ion range:  3.0V–4.2V  → Scale to MCU ADC range (e.g., 0–3.3V). Example: Use  R1=100kΩ ,...