{"id":1328,"date":"2024-06-24T17:35:30","date_gmt":"2024-06-24T17:35:30","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=1328"},"modified":"2024-06-24T17:59:28","modified_gmt":"2024-06-24T17:59:28","slug":"sleeps-modes-available-in-microchip","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=1328","title":{"rendered":"Sleeps modes available in Microchip"},"content":{"rendered":"\n<p class=\"has-text-color has-link-color wp-elements-1 wp-block-paragraph\" style=\"color:#5c5c5c\">Sleeps modes or power saving modes present in Atmel are identical to the sleeps modes available in our laptop. Sleeps mode enable the application to shut down unused modules in the \u00b5C, thereby saving power. The AVR provides various sleep modes, allowing the user to tailor the power consumption to the application\u2019s requirement. All the sleep modes are available in the<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n                             #include&lt;avr\/sleep.h&gt;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"477\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sleep-modes-1024x477.jpg\" alt=\"\" class=\"wp-image-1331\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sleep-modes-1024x477.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sleep-modes-300x140.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sleep-modes-768x358.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/sleep-modes.jpg 1367w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-2 wp-block-paragraph\" style=\"color:#5c5c5c\">To enter any of the six sleep modes, the SE bit in the MCUCR must be written to logical 1 and a sleep instruction must be executed. If an enabled interrupt occurs while the MCU in sleep mode, the MCU wakes up. The MCU is than halted for four clock cycles in addition to the start up time; it executes the interrupt routine and resumes execution from the instruction following sleep. The contents of register file and SRAM are unaltered, when the device wakes up from sleep. If a Reset occurs during sleep mode, the MCU wakes up and executes from the Reset vector.<\/p>\n\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-3 wp-block-paragraph\" style=\"color:#202020\">1. <strong>Idle mode:-<\/strong><\/p>\n\n\n\n<ol style=\"color:#1c1c1c\" class=\"has-text-color has-link-color wp-block-list wp-elements-4\"><\/ol>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-5 wp-block-paragraph\" style=\"color:#5c5c5c\">The sleep instruction makes the MCU enter Idle mode, stopping the CPU but allowing SPI, USART, Analog Comparator, ADC, Two-wire serial Interface, Timers\/Counter, Watchdog and the interrupt system to continue operating. Idle modes enables the MCU to wake up from external triggered interrupts as one as internal one like the Timer Overflow and USART Transmit complete interrupts.<\/p>\n\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-6 wp-block-paragraph\" style=\"color:#1b1b1b\">        2. <strong>ADC noise reduction mode:-<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-7 wp-block-paragraph\" style=\"color:#5c5c5c\">The sleep instruction makes the MCU enter ADC noise reduction mode, stopping the MCU but allowing the ADC, the External Interrupts, TWI, Timers\/Counter2 and watchdog timer to continue operating. This improves the noise environment for ADC, enabling higher resolution measurement. If the ADC is enabled a conversion starts automatically when this mode is entered.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n#include&lt;avr\/sleep.h&gt;\nMCUCR|=(1&lt;&lt;SE);  \/\/Sleep enable\nMCUCR|=(1&lt;&lt;SM0); \/\/ ADC noise reduction \n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-8 wp-block-paragraph\" style=\"color:#262626\">3. <strong>Power-down mode:-<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-9 wp-block-paragraph\" style=\"color:#5c5c5c\">In this mode, the External Oscillator is stopped, while the External interrupts, Two-wire serial interface address watch and the watchdog continue operating (if enable). This sleep mode basically halts all generated clocks, allowing power-down mode. There is a delay from the wake-up condition occurs until the wake-up becomes effective. This allowing the clock to restart and becomes stable after having been stopped.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n#include&lt;avr\/sleep.h&gt;\nMCUCR|=(1&lt;&lt;SE);  \/\/Sleep enable\nMCUCR|=(1&lt;&lt;SM1); \/\/ Power down mode \n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-10 wp-block-paragraph\" style=\"color:#292929\">4. <strong>Power-save mode:-<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-11 wp-block-paragraph\" style=\"color:#5c5c5c\">This mode is identical to power down mode, with one exception. If Timers\/Counter2 is clocked asynchronously i.e. the AS2 bit in the ASSR is set. Timers\/Counter2 will run during sleep. The device can wake-up from either Timer\/Counter2, if the corresponding Timers\/Counter2 interrupt enable bit are in TIMSK and the Global Interrupt Enable bit in SREG is set.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n#include&lt;avr\/sleep.h&gt;\nMCUCR|=(1&lt;&lt;SE);           \/\/Sleep enable\nMCUCR|=(1&lt;&lt;SM0)|(1&lt;&lt;SM1); \/\/ Power save mode \n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-12 wp-block-paragraph\" style=\"color:#3c3c3c\">5. <strong>Standby Mode:-<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-13 wp-block-paragraph\" style=\"color:#5c5c5c\">This mode is identical to power-down with the exception that the oscillator is keep running, from standby mode; the device wakes up in six clock cycles.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n#include&lt;avr\/sleep.h&gt;\nMCUCR|=(1&lt;&lt;SE);           \/\/Sleep enable\nMCUCR|=(1&lt;&lt;SM1)|(1&lt;&lt;SM2); \/\/Standby sleep mode \n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-14 wp-block-paragraph\" style=\"color:#1e1e1e\">6. <strong>Extended Standby Mode:-<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-15 wp-block-paragraph\" style=\"color:#5c5c5c\">The Extended sleep mode is identical to power save mode with the exception that the oscillator is keep running. From Extended standby mode, the device wakes up in six clock cycles.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n#include&lt;avr\/sleep.h&gt;\nMCUCR|=(1&lt;&lt;SE);                   \/\/Sleep enable\nMCUCR|=(1&lt;&lt;SM0)(1&lt;&lt;SM1)|(1&lt;&lt;SM2); \/\/Extended Standby sleep mode \n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Sleeps modes or power saving modes present in Atmel are identical to the sleeps modes available in our laptop. Sleeps mode enable the application to shut down unused modules in the \u00b5C, thereby saving power. The AVR provides various sleep modes, allowing the user to tailor the power consumption to the application\u2019s requirement. All the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1328","post","type-post","status-publish","format-standard","hentry","category-sleep-modes"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1328"}],"version-history":[{"count":16,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1328\/revisions"}],"predecessor-version":[{"id":1354,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1328\/revisions\/1354"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}