SlideShare a Scribd company logo
Deep Sleep Mode on Microchip PIC18F and PIC24F MCUs  Source: M ICROCHIP
Introduction Purpose To provide an overview of Deep Sleep mode in PIC MCUs Outline Overview deep sleep feature Average current consumption in a typical deep sleep application Various wake-up sources A typical Deep Sleep firmware flow diagram Microchip PIC18F & PIC24F families Content 26 pages
Vocabulary RTCC – Real-Time Clock/Calendar DSWDT – Deep Sleep Watchdog Timer ULPWU – Ultra Low-Power Wake-Up DSBOR – Deep Sleep Brown-Out Reset
What is Deep Sleep? Core, Peripherals and SRAM Powered-Off Lowest Power Mode: Deep Sleep as low as ~20 nA! Deep Sleep with RTCC as low as ~500 nA External Switches Not Required I/Os Remain Powered, Certain Peripherals Still Operable
Battery Power Most of microcontrollers require extra battery or dedicated pins for RTCC RTCC can operate in Deep Sleep, powered by V DD Deep Sleep can run off of battery power for years!
How is This Different Than Sleep? Consumes 90% Less Current! Context Saving Two Deep Sleep registers for context save will retain data  Rest of SRAM data not retained Self-programmed FLASH or EEPROM could also be used Internal Core Voltage Regulator Shut Down Wake-Up Causes a Power-On Reset Execution resumes at the Reset vector  Most SFRs reset to default values Active Sleep Deep  Sleep Current Consumption
When to Use Deep Sleep? Great for applications that are inactive for long periods of time Remote Controls  ·  Input Devices Sensors  ·  Digital Thermometers Ideal for applications that require accurate timekeeping while consuming minimum power Sprinkler Timers Thermostats Watches Digital Clocks
What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz
What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz Powers Down
What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA
What Defines Low Power? Current Operation Time Deep Sleep 20 nA Device Running 1.5 mA @ 4 MHz Powers Down
What Defines Low Power? Current Operation Time Wake-up Time 50 µs Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA
What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA Wake-up Time 50 µs
What Defines Low Power? Current Operation Time Lowest Average Current Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA Device Running 1.5 mA @ 4 MHz Wake-up Time 50 µs
What Can Remain Operating? RTCC Continues To Keep Time RTCC pin can output seconds clock I/O Pins Maintain State Special Deep Sleep Registers Retain Values  (DSGPR0, DSGPR1, RTCC date/time) DSBOR
Waking Up From Deep Sleep INT0 Deep Sleep Watchdog Timer RTCC Alarm Ultra Low-Power Wake-Up MCLR (power off / power on)
Waking Up by INT0 INT0
Waking Up by DSWDT Deep Sleep Watchdog Timer (DSWDT) No external circuit required for internal RC oscillator Use to guard against crystal failures Secondary Oscillator Can Be Used Optionally as Clock Source 16 Different Timeout Settings Available 2.1 ms, 8.3 ms, 33 ms, 132 ms,  528 ms, 2.1s, 8.5s, 34s, 135s, 9m, 36m, 2.4h, 9.6h, 38.5h, 6.4d, 25.7d
Waking Up by RTCC Alarm RTCC Alarm Alarm resolution from seconds up through days, years Can Use the Same Clock Sources as DSWDT Save power: avoid using two different clock sources Optionally Output a Seconds Clock or Alarm Pulse on RTCC Pin During Deep Sleep
RTCC/DSWDT Clock Sources 31 kHz Internal RC Secondary Oscillator
Waking Up by ULPWU Ultra Low-Power Wake-Up
Waking Up by ULPWU Ultra Low-Power Wake-Up Voltage Time ~0.5V threshold reached, device wakes up ULPWU enabled Deep Sleep entered I/O pin output high, capacitor charges Small pull-down current discharges capacitor
Firmware Overview Release State Enter Deep Sleep Reset Vector Enable Secondary Osc Set Deep Sleep registers Read Deep Sleep registers & restore context Y Perform Application Tasks N Woke from Deep Sleep? Wake-Up
Family Roadmap PIC18F46J50/11 PIC24F16KA102 PIC24FJ64GA104 Core Voltage Regulator Yes No Deep Sleep when VREG disabled (LF parts) No Yes No Deep Sleep when VREG disabled Typical Sleep  Current at 25C 1.2 µA at 2.15V 80 nA at 1.8V 3.5 µA at 2.15V Typical Sleep  Wake-Up Time 275 µs 5 µs 25 µs Typical Deep Sleep Current at 25C 24 nA at 2.15V 20 nA at 1.8V 24 nA at 2.15V Typical Deep Sleep Current with RTCC at 25C 500 nA at 2.15V 500 nA at 1.8V 500 nA at 2.15V Typical Deep Sleep  Wake-Up Time 1-2 ms 50 µs 1-2 ms Power Needed to Recharge VDDCORE Capacitor on Wake-Up Yes No Yes Context Saving 2x8-bit DSGPR FLASH 2x16-bit DSGPR FLASH EEPROM 2x16-bit DSGPR FLASH Other Family Features ULPWU Support
Deep Sleep Summary Use for devices that have long periods of inactivity  Deep Sleep is the lowest power mode RTCC can keep time during Deep Sleep Several wake-up sources available Special registers available to save state information
Additional Resource For ordering PIC18 & PIC24 MCUs, please click the part list or Call our sales hotline For more product information go to www.microchip.com/lowpower Visit Element 14 to post your question   www.element-14.com For additional inquires contact our technical service hotline or even use our “Live Technical Chat” online facility Newark Farnell

More Related Content

PPT
CAN (Controller Area Network) Bus Protocol
DOCX
"Black Box for a Car" report
PDF
ARM® Cortex M Boot & CMSIS Part 1-3
PPTX
Mod 10 synchronous counter updated
PPTX
ARM Cortex-M3 Training
PPTX
Rc delay modelling in vlsi
PDF
Introduction to Built In Self Test (BIST).pdf
PPTX
Simulation power analysis low power vlsi
CAN (Controller Area Network) Bus Protocol
"Black Box for a Car" report
ARM® Cortex M Boot & CMSIS Part 1-3
Mod 10 synchronous counter updated
ARM Cortex-M3 Training
Rc delay modelling in vlsi
Introduction to Built In Self Test (BIST).pdf
Simulation power analysis low power vlsi

What's hot (20)

PPTX
Pipelining approach
PPTX
Eye diagram in Communication
PPTX
IMPLEMENTATION OF UPSAMPLING & DOWNSAMPLING
PDF
MIPI DevCon 2016: MIPI D-PHY - Physical Layer Test & Measurement Challenges
PDF
Logic Level Techniques for Power Reduction
PPTX
TMS320C6X Architecture
PPTX
Noise Performance of CW system
PPT
PPTX
Automated Meter Reading System
PDF
L8 understanding-atmega328 p-1
PPTX
Embedded c
PPT
testing
PPTX
ATMEGA 328
PPT
Introduction to VHDL - Part 1
PPTX
System partitioning in VLSI and its considerations
PDF
MIPI DevCon 2021: Latest Developments within MIPI Automotive SerDes Solutions...
PPT
PPTX
Timer 0 concept
PDF
What's New in ANSYS RedHawk 2014
Pipelining approach
Eye diagram in Communication
IMPLEMENTATION OF UPSAMPLING & DOWNSAMPLING
MIPI DevCon 2016: MIPI D-PHY - Physical Layer Test & Measurement Challenges
Logic Level Techniques for Power Reduction
TMS320C6X Architecture
Noise Performance of CW system
Automated Meter Reading System
L8 understanding-atmega328 p-1
Embedded c
testing
ATMEGA 328
Introduction to VHDL - Part 1
System partitioning in VLSI and its considerations
MIPI DevCon 2021: Latest Developments within MIPI Automotive SerDes Solutions...
Timer 0 concept
What's New in ANSYS RedHawk 2014
Ad

Similar to Deep Sleep Mode on Microchip PIC18F and PIC24F MCUs (20)

PPTX
mpmc-unit-iv.pptx best part of the life is this
PPTX
Msp 430 module 3
PPT
Low Power Flexis™ Series of QE Family MCUs
PDF
pic_1.pdf
PPTX
Lecture on PIC-1.pptx
PPT
Microchip NANOWatt Technology
PPT
Introduction to PIC18FX6J Series MCUs
PDF
Cc2530
PPTX
Project ppt
PPTX
Atomatic light controller
PDF
JamesEndl
DOC
P 0329--intelligent energy-saving
PDF
Using Ready-for-PIC and SDR Libraries
PPTX
PIC Microcontrollers
PDF
picuc-151108162917-lva1-app6892 (1).pdf
PPTX
Introduction to PIC.pptx
PDF
EGmicro EG8010 Datasheet
PPT
Cyclone III FPGA Overview Part2
PDF
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
PPTX
ELECTRONIC EYE FOR NIGHT DEVICE SWITCHING USING 555 TIMER
mpmc-unit-iv.pptx best part of the life is this
Msp 430 module 3
Low Power Flexis™ Series of QE Family MCUs
pic_1.pdf
Lecture on PIC-1.pptx
Microchip NANOWatt Technology
Introduction to PIC18FX6J Series MCUs
Cc2530
Project ppt
Atomatic light controller
JamesEndl
P 0329--intelligent energy-saving
Using Ready-for-PIC and SDR Libraries
PIC Microcontrollers
picuc-151108162917-lva1-app6892 (1).pdf
Introduction to PIC.pptx
EGmicro EG8010 Datasheet
Cyclone III FPGA Overview Part2
Microcontroller based Ultrasonic Radar (Microprocessors and Embedded Systems ...
ELECTRONIC EYE FOR NIGHT DEVICE SWITCHING USING 555 TIMER
Ad

More from Premier Farnell (20)

PPT
Being a business assistant with element14 in krakow
PPT
Optical Encoders
PPT
PSA-T Series Spectrum Analyser: PSA1301T/ PSA2701T
PPT
TPS2492/93 – High Voltage Hotswap Controller
PPT
Stellaris® 9000 Family of ARM® Cortex™-M3
PPT
Piccolo F2806x Microcontrollers
PPT
Introduce to AM37x Sitara™ Processors
PPT
ETRX3 ZigBee Module: ETRX3
PPT
DMM4000 Benchtop Digital Multimeters
PPT
Discovering Board for STM8L15x MCUs
PPT
Yaw-rate Gyroscopes
PPT
An Overview Study on MEMS digital output motion sensor: LIS331DLH
PPT
LED Solar Garden Lighting Solution From STMicroelectronics
PPT
Solution on Handheld Signal Generator
PPT
Medium Performance Gyroscopes
PPT
Getting to Know the R8C/2A, 2B Group MCUs
PPT
SEARAY™ Open Pin Field Interconnects
PPT
PWM Controller for Power Supplies
PPT
Handheld Point of Sale Terminal
PPT
Reflective Optical Switch: SFH774X
Being a business assistant with element14 in krakow
Optical Encoders
PSA-T Series Spectrum Analyser: PSA1301T/ PSA2701T
TPS2492/93 – High Voltage Hotswap Controller
Stellaris® 9000 Family of ARM® Cortex™-M3
Piccolo F2806x Microcontrollers
Introduce to AM37x Sitara™ Processors
ETRX3 ZigBee Module: ETRX3
DMM4000 Benchtop Digital Multimeters
Discovering Board for STM8L15x MCUs
Yaw-rate Gyroscopes
An Overview Study on MEMS digital output motion sensor: LIS331DLH
LED Solar Garden Lighting Solution From STMicroelectronics
Solution on Handheld Signal Generator
Medium Performance Gyroscopes
Getting to Know the R8C/2A, 2B Group MCUs
SEARAY™ Open Pin Field Interconnects
PWM Controller for Power Supplies
Handheld Point of Sale Terminal
Reflective Optical Switch: SFH774X

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
A Presentation on Artificial Intelligence
PPTX
Machine Learning_overview_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
cuic standard and advanced reporting.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
sap open course for s4hana steps from ECC to s4
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MIND Revenue Release Quarter 2 2025 Press Release
A Presentation on Artificial Intelligence
Machine Learning_overview_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
Assigned Numbers - 2025 - Bluetooth® Document
cuic standard and advanced reporting.pdf
A comparative analysis of optical character recognition models for extracting...
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
sap open course for s4hana steps from ECC to s4

Deep Sleep Mode on Microchip PIC18F and PIC24F MCUs

  • 1. Deep Sleep Mode on Microchip PIC18F and PIC24F MCUs Source: M ICROCHIP
  • 2. Introduction Purpose To provide an overview of Deep Sleep mode in PIC MCUs Outline Overview deep sleep feature Average current consumption in a typical deep sleep application Various wake-up sources A typical Deep Sleep firmware flow diagram Microchip PIC18F & PIC24F families Content 26 pages
  • 3. Vocabulary RTCC – Real-Time Clock/Calendar DSWDT – Deep Sleep Watchdog Timer ULPWU – Ultra Low-Power Wake-Up DSBOR – Deep Sleep Brown-Out Reset
  • 4. What is Deep Sleep? Core, Peripherals and SRAM Powered-Off Lowest Power Mode: Deep Sleep as low as ~20 nA! Deep Sleep with RTCC as low as ~500 nA External Switches Not Required I/Os Remain Powered, Certain Peripherals Still Operable
  • 5. Battery Power Most of microcontrollers require extra battery or dedicated pins for RTCC RTCC can operate in Deep Sleep, powered by V DD Deep Sleep can run off of battery power for years!
  • 6. How is This Different Than Sleep? Consumes 90% Less Current! Context Saving Two Deep Sleep registers for context save will retain data Rest of SRAM data not retained Self-programmed FLASH or EEPROM could also be used Internal Core Voltage Regulator Shut Down Wake-Up Causes a Power-On Reset Execution resumes at the Reset vector Most SFRs reset to default values Active Sleep Deep Sleep Current Consumption
  • 7. When to Use Deep Sleep? Great for applications that are inactive for long periods of time Remote Controls · Input Devices Sensors · Digital Thermometers Ideal for applications that require accurate timekeeping while consuming minimum power Sprinkler Timers Thermostats Watches Digital Clocks
  • 8. What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz
  • 9. What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz Powers Down
  • 10. What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA
  • 11. What Defines Low Power? Current Operation Time Deep Sleep 20 nA Device Running 1.5 mA @ 4 MHz Powers Down
  • 12. What Defines Low Power? Current Operation Time Wake-up Time 50 µs Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA
  • 13. What Defines Low Power? Current Operation Time Device Running 1.5 mA @ 4 MHz Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA Wake-up Time 50 µs
  • 14. What Defines Low Power? Current Operation Time Lowest Average Current Device Running 1.5 mA @ 4 MHz Powers Down Deep Sleep 20 nA Device Running 1.5 mA @ 4 MHz Wake-up Time 50 µs
  • 15. What Can Remain Operating? RTCC Continues To Keep Time RTCC pin can output seconds clock I/O Pins Maintain State Special Deep Sleep Registers Retain Values (DSGPR0, DSGPR1, RTCC date/time) DSBOR
  • 16. Waking Up From Deep Sleep INT0 Deep Sleep Watchdog Timer RTCC Alarm Ultra Low-Power Wake-Up MCLR (power off / power on)
  • 17. Waking Up by INT0 INT0
  • 18. Waking Up by DSWDT Deep Sleep Watchdog Timer (DSWDT) No external circuit required for internal RC oscillator Use to guard against crystal failures Secondary Oscillator Can Be Used Optionally as Clock Source 16 Different Timeout Settings Available 2.1 ms, 8.3 ms, 33 ms, 132 ms, 528 ms, 2.1s, 8.5s, 34s, 135s, 9m, 36m, 2.4h, 9.6h, 38.5h, 6.4d, 25.7d
  • 19. Waking Up by RTCC Alarm RTCC Alarm Alarm resolution from seconds up through days, years Can Use the Same Clock Sources as DSWDT Save power: avoid using two different clock sources Optionally Output a Seconds Clock or Alarm Pulse on RTCC Pin During Deep Sleep
  • 20. RTCC/DSWDT Clock Sources 31 kHz Internal RC Secondary Oscillator
  • 21. Waking Up by ULPWU Ultra Low-Power Wake-Up
  • 22. Waking Up by ULPWU Ultra Low-Power Wake-Up Voltage Time ~0.5V threshold reached, device wakes up ULPWU enabled Deep Sleep entered I/O pin output high, capacitor charges Small pull-down current discharges capacitor
  • 23. Firmware Overview Release State Enter Deep Sleep Reset Vector Enable Secondary Osc Set Deep Sleep registers Read Deep Sleep registers & restore context Y Perform Application Tasks N Woke from Deep Sleep? Wake-Up
  • 24. Family Roadmap PIC18F46J50/11 PIC24F16KA102 PIC24FJ64GA104 Core Voltage Regulator Yes No Deep Sleep when VREG disabled (LF parts) No Yes No Deep Sleep when VREG disabled Typical Sleep Current at 25C 1.2 µA at 2.15V 80 nA at 1.8V 3.5 µA at 2.15V Typical Sleep Wake-Up Time 275 µs 5 µs 25 µs Typical Deep Sleep Current at 25C 24 nA at 2.15V 20 nA at 1.8V 24 nA at 2.15V Typical Deep Sleep Current with RTCC at 25C 500 nA at 2.15V 500 nA at 1.8V 500 nA at 2.15V Typical Deep Sleep Wake-Up Time 1-2 ms 50 µs 1-2 ms Power Needed to Recharge VDDCORE Capacitor on Wake-Up Yes No Yes Context Saving 2x8-bit DSGPR FLASH 2x16-bit DSGPR FLASH EEPROM 2x16-bit DSGPR FLASH Other Family Features ULPWU Support
  • 25. Deep Sleep Summary Use for devices that have long periods of inactivity Deep Sleep is the lowest power mode RTCC can keep time during Deep Sleep Several wake-up sources available Special registers available to save state information
  • 26. Additional Resource For ordering PIC18 & PIC24 MCUs, please click the part list or Call our sales hotline For more product information go to www.microchip.com/lowpower Visit Element 14 to post your question www.element-14.com For additional inquires contact our technical service hotline or even use our “Live Technical Chat” online facility Newark Farnell

Editor's Notes

  • #2: Welcome to the training module for Deep Sleep Mode on the Microchip PIC18 and PIC24 MCUs.
  • #3: This training module will provide an overview of Deep Sleep mode in PIC MCUs.
  • #4: During this training module, we may use some acronyms that you haven’t heard before—but, they will become familiar to you as we discuss Deep Sleep and its advantages. RTCC stands for Real-Time Clock/Calendar. This one, you probably know—it is a microcontroller peripheral for keeping time and triggering alarms. DSWDT, or Deep Sleep Watchdog Timer, is a new wake-up source for Deep Sleep applications. ULPWU means Ultra Low-Power Wake-Up. That is a time delay wake-up source that does not require an oscillator. DSBOR, or Deep Sleep Brown-Out Reset, is a low-power voltage monitor that prevents the microcontroller from executing if power drops too low for safe operation.
  • #5: On prior PIC ® microcontrollers, sleep mode was provided to allow low-power use by shutting down the processor core. However, SRAM remained powered-on to retain data. To completely stop power consumption, an external switch circuit would be required to cut power to the microcontroller. On new PIC microcontrollers with Deep Sleep capability, both the processor core and SRAM are powered-off to drop power consumption to virtually zero, eliminating the need for an external switch. Certain key peripherals can be configured to remain powered-on, allowing greater flexibility for applications.
  • #6: Microchip parts do not need a separate VBATT pin for powering the RTCC. Instead, power is provided through the normal V DD pin, so adding a second battery for powering the RTCC is not necessary. Fewer pins are used, and power levels are so low that applications will not need to add an external switch to cut power to the microcontroller when only timekeeping functionality needs to remain powered.
  • #7: Deep Sleep reduces current to minimum levels by turning off power to most of the chip’s SRAM, cutting current consumption to 90% less than traditional Sleep mode. While most SRAM does not retain its data when powered-down, there are two general purpose Deep Sleep registers that will remain powered, allowing some context data to be retained easily. If more data needs to be saved, self-programmed FLASH (or EEPROM memory, if available) is an option. On parts with an internal core voltage regulator, the regulator is shut down during Deep Sleep to conserve power. The voltage regulator needs time to stabilize before the part can wake up from Deep Sleep, therefore Deep Sleep can take typically take 1 to 2 milliseconds to exit on these parts. On devices that do not have a core voltage regulator, wake-up times will be faster, typically 50 µ s. Waking up from Deep Sleep causes a Power-On Reset, so execution will resume at the Reset vector, rather than at the instructions that follow the sleep instruction. Special Function Registers will reset to their Power-On Reset default values. However, certain registers (such as TRIS bits) will not affect device behavior until the Deep Sleep “RELEASE” bit is cleared later, by software.
  • #8: Deep Sleep is great for applications that are inactive for long periods of time, such as remote controls, input devices, sensors and thermometers. It is also ideal for applications that need to keep accurate time while consuming minimum power—Deep Sleep supports continuous operation of the Real-Time Clock/Calendar where desired. So what is the big advantage that Deep Sleep provides for these applications? The longer an application can stay in Deep Sleep mode, the lower the average current consumption of your device will be. Normal Sleep mode is recommended for applications that need ultrafast wake up times, complete state retention, or will only be inactive for short periods of time.
  • #9: This graph shows a typical low-power application actively running at 4 MHz, with current consumption of 1.5 mA. Not bad, but still enough power consumption to drain a battery within a month or two.
  • #10: Say that the application no longer needs to be active, the application can execute a SLEEP or PWRSAV instruction with Deep Sleep enabled to power-down and conserve power.
  • #11: While in Deep Sleep, the device is at its lowest power state. With minimal features running, power consumption can be as low as 20 nA. Certain features such as the Real-Time Clock/Calendar, Deep Sleep Watchdog Timer, and Deep Sleep Brown-Out Reset can be configured to remain active, if desired.
  • #12: Maximizing the amount of time spent at Deep Sleep current levels will lower power consumption the most. At Deep Sleep current levels, a battery can provide power for years without being depleted.
  • #13: Eventually, the application wakes up. On devices without an internal core voltage regulator, wake-up times can be as low as 50 µs. Other devices may require 1 to 2 ms for Deep Sleep wake-up, due to core voltage regulator losses.
  • #14: Finally, the application resumes active operation, consuming the most power.
  • #15: The progression through each of these states over time defines the average power consumption of the device. While running, the average current drawn by the application would be the full run current of 1.5 mA. By maximizing time in Deep Sleep mode during periods of inactivity, the application can dramatically lower average current.
  • #16: Let’s take a look at the microcontroller features that can remain powered during Deep Sleep. The Real-Time Clock/Calendar can be configured to keep time during Deep Sleep. It can even continue to output a seconds clock signal during Deep Sleep. Other I/O pins will maintain their state during Deep Sleep and throughout wake-up until the Deep Sleep “RELEASE” bit is cleared. Deep Sleep registers will retain data over Deep Sleep, even though the rest of SRAM is powered-off. If more data is needed, an application can use the table read/write features to save data to FLASH memory. On some devices, EEPROM memory is also an option. The Deep Sleep Brown-Out Reset feature can be enabled to provide an indication of integrity for the special Deep Sleep and RTCC registers in case power levels dropped too low for safe operation. In addition to these features, several different wake-up sources can be enabled to operate through Deep Sleep. Let’s take a look at them.
  • #17: The most common wake-up sources available for Deep Sleep include Interrupt 0, the Deep Sleep Watchdog Timer, a Real-Time Clock/Calendar alarm, and Ultra Low-Power Wake-up. Of course, MCLR Reset can also be used as a wake-up source. However I/O pin states will be lost upon wake-up, instead of waiting for application firmware to clear the Deep Sleep “RELEASE” bit. A power off/power on sequence will also “wake” a device from Deep Sleep, but this will behave exactly like a traditional Power-On Reset. Data stored in special Deep Sleep registers will not be retained over a full power off/on cycle, since V DD voltage is required to maintain these Deep Sleep registers. Like MCLR Reset, power off/power on cycling will not retain I/O pin states.
  • #18: Waking from Interrupt 0 happens when an external interrupt edge is detected on the INT0 pin. INT0 can be configured to be active high or active low. The example circuit shown is for an active high INT0 pin. A push button is used to pull the INT0 pin high briefly while a pull-down resistor normally holds the pin at a low state. To reduce switch bounce sensitivity, a capacitor can be added to low pass filter the signal.
  • #19: The Deep Sleep Watchdog Timer provides another wake-up source for Deep Sleep. It is not the same module as the software Watchdog Timer you might be familiar with during active Run mode. It is a separate module specific to Deep Sleep. The Deep Sleep Watchdog Timer requires a clock source to keep track of how long to stay in Deep Sleep. Two options are available: an internal low-power RC oscillator or an external secondary oscillator. The DSWDT should always be run from the internal RC oscillator if robustness is needed, allowing an application to wake up even if a crystal failure has occurred. Configuration bits specify how long the device should stay in Deep Sleep before timing out and waking the device. 16 different timeout settings are available. If more granularity is needed, a Real-Time Clock/Calendar alarm should be used instead.
  • #20: The Real-Time Clock/Calendar can keep a running clock of the current date and time, plus it has an alarm feature that can be used to wake the microcontroller from Deep Sleep at a specified date/time. Unlike the Deep Sleep Watchdog Timer, granularity is not restricted to 16 options; any date/time can be used. The internal low-power RC oscillator or the secondary oscillator can be used for a clock source, just like the Deep Sleep Watchdog Timer. If both the RTCC and Deep Sleep Watchdog Timer are going to be used, and robustness is not a key concern, the same clock source can be used so that power isn’t wasted keeping two oscillator circuits running. During Deep Sleep, I/O pins are generally held constant in their last configured state. However, the RTCC can be configured to output an alarm pulse or seconds clock output on the RTCC pin, even while the microcontroller is in Deep Sleep. This pulse could be used to continuously blink an indicator on a clock read out, for example.
  • #21: The RTCC and DSWDT need a clock source to operate. When using the 31 kHz Internal RC oscillator as a clock source, no external circuitry is required. For more timing accuracy, an external 32.768 kHz crystal can be connected to the microcontroller’s secondary oscillator pins (as shown in the example circuit). To achieve low-power consumption for Deep Sleep applications, the secondary oscillator has very low drive levels. The downside is increased sensitivity to rapidly changing signals in close proximity. Locate the crystal and capacitors as close to the microcontroller as possible and avoid routing signals, other than V SS and V DD , near the oscillator circuit.
  • #22: The Ultra Low-Power Wake-Up module, available on some Deep Sleep devices, allows your device to go into Deep Sleep for a certain period of time and wake up, without using an oscillator. Because ULPWU is clockless, it consumes less power than wake-up sources that need an oscillator. Instead, ULPWU uses a slowly discharging capacitor voltage to trip a wake-up after a period of time has passed. Let’s look at how this works.
  • #23: Before entering Deep Sleep, firmware will configure RA0 as an output pin and drive it high to V DD . The I/O pin will charge the capacitor to V DD voltage. Once the capacitor is charged, firmware will let the Ultra Low-Power Wake-Up module take control of the RA0 pin and Deep Sleep mode is entered. During Deep Sleep, the Ultra Low-Power Wake-Up module will provide a small pull-down current to the pin, allowing the capacitor to slowly discharge over time. When the voltage of the capacitor finally drops to the I/O pin’s trip point (nominally one-half volt), the device will wake up from Deep Sleep.
  • #24: When the microcontroller first powers on or wakes up from Deep Sleep, it will start executing code from the Reset vector. If the RTCC is using the secondary oscillator to keep track of time, the secondary oscillator should be enabled before clearing the Deep Sleep release bit. This allows the RTCC to continue operating continuously, without losing time. Deep Sleep hardware will keep the RTCC and secondary oscillator running throughout Deep Sleep and wake-up. Applications that aren’t using the real-time clock can skip this step. Next, firmware can check the Deep Sleep wake-up status flag to see if we are powering on for the first time or if we are coming out of Deep Sleep. If coming out of Deep Sleep, firmware can read data from the Deep Sleep registers to determine which wake-up source was triggered and restore application context. Waking up from Deep Sleep causes a Power-On Reset; which, in turn, resets most registers back to their POR default values. However, immediately applying these default settings could be undesirable in a Deep Sleep application, so a special Deep Sleep feature prevents certain register changes from being applied during start-up. Without this feature, I/O pins would all revert to being tri-stated and the secondary oscillator would be disabled immediately on wake-up. The end result would be losing track of time and losing control over external circuitry. At this point, application-specific tasks can be carried out, such as reading new data and outputting resulting data. When the application is finished, it should save its context information (if any) out to the special Deep Sleep registers and/or nonvolatile memory. Instead, application firmware has a chance after wake-up to initialize values other than the power-on defaults. Afterwards, firmware will manually clear the special Deep Sleep RELEASE state bit to allow register values to actively drive the hardware once again. Finally, Deep Sleep is re-entered and the process can begin again when the next wake-up event occurs.
  • #25: Here is a table showing some of the PIC ® microcontrollers featuring Deep Sleep. The biggest difference between the parts listed is the core voltage regulator. The PIC24F16KA102 does not use a core voltage regulator, the entire device runs at full V DD voltage. In contrast, the other devices use a separate core voltage, lowering power use of the processor core logic. Deep Sleep mode on these devices turns off the processor core by disabling the internal core voltage regulator. For PIC18, the LF variants of these devices lack the internal core voltage regulator; consequently, Deep Sleep mode is not available on LF parts. For PIC24, there is a pin to enable or disable the voltage regulator and it must be enabled for Deep Sleep mode. Bare Deep Sleep mode, with no extra features enabled, draws between 20 and 24 nA. When adding the Real-Time Clock/Calendar, power consumption during Deep Sleep is generally increased to 500 nA, due to power spent on the secondary oscillator. This represents industry-leading power consumption for ultra low-power and ensures battery operation for years with the RTCC running. The PIC24F16KA102 can quickly wake up within 50 µ s. Devices that use a core voltage regulator have longer wake-up times of around 1 to 2 ms to allow the core voltage regulator to stabilize before executing code. Devices using an internal core voltage regulator require an external filter capacitor for regulator stability. Because the core voltage is turned off during Deep Sleep, this filter capacitor will end up discharging during Deep Sleep mode. Energy is used each cycle for recharging the capacitor, creating a break-even point where traditional Sleep mode may provide better efficiency for applications with short time periods between wake-up events (below 20 seconds). All devices provide two general purpose Deep Sleep registers for quickly saving context information through Deep Sleep. And, self-programmed FLASH memory is available if additional space is required. The PIC24F16KA102 adds EEPROM memory as an additional option for storing context data. Finally, the PIC18F46J50 and PIC18F46J11 parts support the Ultra Low-Power Wake-Up feature for Deep Sleep. Remember this feature enables the device to go into Deep Sleep for a certain period of time and wake up, without using an oscillator.
  • #26: Using Deep Sleep allows applications that are inactive for long periods of time to dramatically lower average power consumption, and eliminates the need for an external switch to cut microcontroller power. Deep Sleep turns off the processor core, most peripherals, and SRAM to reduce power consumption to virtually zero. However, some features can be configured to remain powered, such as the RTCC to allow for timekeeping. Deep Sleep has several wake-up sources available, including Interrupt 0, the Deep Sleep Watchdog Timer, an RTCC alarm, and Ultra Low-Power Wake-Up. While SRAM is powered-down, a few special Deep Sleep registers remain available for saving context information through Deep Sleep.
  • #27: Thank you for taking the time to view this presentation on “ Deep Sleep Mode on Microchip PIC18 and PIC24 MCUs” . If you would like to learn more or go on to purchase some of these devices, you may either click on the part list link, or simply call our sales hotline. For more technical information you may either visit the MICROCHIP site, or if you would prefer to speak to someone live, please call our hotline number, or even use our ‘live chat’ online facility. You may visit Element 14 e-community to post your questions.