{"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-2e0aca9ca7ec518b2b96c2c08dd9aac5 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-9f6974165ec6045348eebc993ba64bef 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-bb51843797d91dad443ac1169b4b8d9d 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-57f4e87ca4ddfe8a2e946c2133f02e22\"><\/ol>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-cd0718700fb02e792edfb3681a5ea3d5 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-52dca7971a5917f23d6177d5d6d7c274 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-c0cec363c0b5a6b37433054142a96b5e 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-46d7a9ffeb8dfb8ea7d2d82d6ae4f6b7 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-07a9ebdd6ee3d1bf697d6d9c74844c74 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-cdf3a556c6bf1bf93de2f2d9cdd9b5db 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-9c32a0f3b08d93a61a33b038bb99022f 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-3420f4ffb18f66d666d84f816d72a164 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-e62f5b75a6df029cbf2302ca744b05a2 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-4d773e59e907ce59ee362aed259c5494 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-4924faf88ca6d0dd87d51694a6be2121 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}]}}