Exploring Low Power Modes on the CH32V003 Microcontroller
0:00 Introduction: The video demonstrates how to use the low power modes (sleep and standby) of the CH32V003 microcontroller for battery-operated or power-saving applications.
0:53 Microcontroller Choice: The 8-pin J4M6 microcontroller is selected for its balance of features and low power consumption, comparable to the ATtiny85 but with more peripherals.
1:39 Low Power Modes Overview:
Sleep Mode: CPU clock stopped, peripheral clocks active, faster wakeup, higher power consumption.
Standby Mode: More functionalities disabled, significantly lower power consumption, ideal for battery-operated projects.
2:35 Code Development: A new project is created for the J4M6 chip, which lacks an external clock source.
2:48 Clock Configuration: The default 48MHz High-Speed External (HSE) clock is disabled in favor of the 8MHz High-Speed Internal (HSI) clock to save power.
4:32 Sleep Mode Implementation: The code is structured to enter sleep mode and wake up via a button press (interrupt on pin PA2). An LED (pin PC1) is toggled to indicate wake/sleep status.
5:42 GPIO Configuration: All GPIO pins are set to internal pull-up (IPU) mode to prevent floating states and reduce unnecessary current consumption.
8:56 Interrupt Setup: An external interrupt (EXTI) is configured for pin PA2 to trigger on a falling edge (button press), waking the device from sleep mode.
15:01 Initial Power Measurement: In sleep mode with the 8MHz HSI clock, the device consumes around 600 microamps, consistent with the datasheet.
18:58 Standby Mode and LSI: The video introduces the Low-Speed Internal (LSI) oscillator (around 128kHz) which can further reduce standby current to about 10.5 microamps (with LSI on) or 9 microamps (with LSI off).
20:56 Standby Mode Implementation: Another interrupt (EXTI line 9) is configured for the auto wake-up (AWU) feature, triggered by the LSI timer.
23:58 Auto Wake-Up Configuration: The LSI is enabled, and a prescaler is set to achieve a pulse approximately every 480 milliseconds. The AWU window value is set to 25, resulting in a wake-up period of around 12 seconds (though variations are expected due to LSI frequency tolerance).
29:46 Standby Power Measurement: With the LSI enabled, the device consumes around 11 microamps in standby mode. Disabling the LSI reduces this to about 9.6 microamps.
33:15 Battery Life Estimation: With a CR2032 coin cell battery (approximately 225mAh), the device in standby mode could theoretically last over 20,000 hours (more than 2 years) at 9.6 microamps.
34:36 Conclusion: The video demonstrates the significant power savings achievable with the CH32V003's low power modes, making it suitable for various battery-powered applications like thermometers, light switches, or motion sensors.