<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>8-bit MicrocontrollersのトピックRe: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199772#M16299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hello Mou,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If an 18 hour period is sufficient, declare the variable as &lt;FONT face="Courier New"&gt;unsigned int&lt;/FONT&gt;.&amp;nbsp; If you need more than this,&lt;BR /&gt;use an &lt;FONT face="Courier New"&gt;unsigned long&lt;/FONT&gt; variable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is the code you are using exactly the same as &lt;STRONG&gt;Wiresim&lt;/STRONG&gt; provided, using a flag to indicate that stop mode should be re-entered?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you happened to be re-entering stop mode from within the ISR, there would be a definite problem, as I&amp;nbsp; Indicated earlier.&amp;nbsp; In this case, the ISR code would be called recursively on each wakeup (since there would not be&amp;nbsp;an exit from the previous ISR call), and eventually the stack would overflow.&amp;nbsp; I wonder if this might be your problem.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It is necessary to exit the ISR before re-entering stop mode.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2008-04-08&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:10 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Apr 2008 06:02:08 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2008-04-08T06:02:08Z</dc:date>
    <item>
      <title>Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199762#M16289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The MCU(MC9S08GB60) in Stop3 mode can be exited using the RTI, where the RTIS can provide a sleep for only 1.024 sec by setting the bits RTIS0:RTIS1:RTIS2 to1:1:1.Can anyone suggest me a way to increase this sleep timing?&lt;/DIV&gt;&lt;DIV&gt;Is there any other way to exit stop3 mode without using external interrupts so that we can customize the sleeping interval?&lt;/DIV&gt;&lt;DIV&gt;I am using Maxstream XBee modules with MC13193 and MC9S08GT60.&lt;/DIV&gt;&lt;DIV&gt;Please help me in this regard.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mou&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 21:04:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199762#M16289</guid>
      <dc:creator>mou</dc:creator>
      <dc:date>2008-03-05T21:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199763#M16290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Mou,&lt;BR /&gt;&lt;BR /&gt;I had a similar problem. The way I solved it was to simply wake up every 1.024 sec and incremet a counter inside the interrupt service routine. The counter was then checked against a maximum counter value, 30 for example (representing approx. 30 seconds). If the max counter was not reached then go back to sleep, else stay awake.&lt;BR /&gt;&lt;BR /&gt;However, this may be overkill and there may be a much simpler way to do it, so if anyone else knows I would also be interested. In the meantime, I suggest you try this Mou.&lt;BR /&gt;&lt;BR /&gt;Wiresim.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 22:04:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199763#M16290</guid>
      <dc:creator>wiresim</dc:creator>
      <dc:date>2008-03-05T22:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199764#M16291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Using multiple wake-ups, as Wiresim has suggested, should have a negligible effect on average power consumption.&amp;nbsp; However, when stop mode is re-entered, make sure that the STOP instruction is outside of any ISR code.&amp;nbsp; This is to avoid&amp;nbsp;the problems associated with the presence of nested interrupts.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 01:51:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199764#M16291</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-03-06T01:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199765#M16292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Wiresim,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you please provide me with your piece of sample code for the ISR (RTI) so that I can have an idea about the solution you are suggesting. Can I implement a cyclic sleep process in this way?( its like, the chip will&amp;nbsp;remain active&amp;nbsp;for a certain interval of time, then go to sleep for a certain interval and again wake up and continues in this way.)If yes, please let me know.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks and Regards,&lt;/DIV&gt;&lt;DIV&gt;Mou&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 21:28:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199765#M16292</guid>
      <dc:creator>mou</dc:creator>
      <dc:date>2008-03-06T21:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199766#M16293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Mou,&lt;BR /&gt;&lt;BR /&gt;The ISR I implemented as follows (I think it is the working version!!) :&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;void interrupt RTI_Interrupt_Routine(void){
       
   
    RTI_count++;
   
    if(RTI_count &amp;gt;= MAX_RTI_COUNT){
       
        RTI_count    = 0;                     //Reset counter
        SRTISC       = RTI_OFF_1s;            //Turn off RTI
        Normal_Mode  = 1;                     //Resume normal operation
    }
    else{
       
        Sleep_Mode   = 1;                     //Otherwise, sleep
    }
}  &lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;FONT face="Arial"&gt;Explanation:

RTI_count is the variable to imcrment periodically upon interrupt. MAX_RTI_COUNT is the time in seconds   you want to sleep for.&lt;/FONT&gt;
&lt;FONT face="Arial"&gt;
SRTISC is the RTI control register and RTI_OFF_1s = 0x07. Turn off RTI so it doesn't keep interrupting your program when you don't want it to.

Normal_Mode and Sleep_Mode are flags that are used by the main program to put the device back to sleep or wake it up (other peripherals). You could try putting the command directly into the ISR for sleep or wake up.

The MCU is periodically sleeping and then waking up on RTI. To minimise power consumption during this brief ON time from the check in the ISR turn off anything that may consume power, other peripherals, internal settings etc. Because you are performing a simple check in the ISR, the ON time will be very small compared to the SLEEP time so power consumption should be not much more than in SLEEP operation. You could work out the current and hence power consumption from the electrical characterisitcs in the data sheet and also by knowing the time taken to complete the check and then go back to sleep.

Hope this helps,

Wiresim.&lt;/FONT&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2008 23:23:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199766#M16293</guid>
      <dc:creator>wiresim</dc:creator>
      <dc:date>2008-03-06T23:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199767#M16294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Mou,&lt;BR /&gt;&lt;BR /&gt;I notcied that in the code I gave you, I haven't included a command to clear the interrupt flag in the SRTISC register. If you don't clear the flag, you will re-enter the ISR as soon as you exit from the previous interrupt. To clear the flag, write a 1 to the RTIACK bit in the SRTISC register.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Wiresim.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 08:37:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199767#M16294</guid>
      <dc:creator>wiresim</dc:creator>
      <dc:date>2008-03-10T08:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199768#M16295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Wiresim,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for your concern. I had already cleared the flag in my earlier code. Your code is also working fine.&lt;/DIV&gt;&lt;DIV&gt;Thanking You,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mou&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 16:22:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199768#M16295</guid>
      <dc:creator>mou</dc:creator>
      <dc:date>2008-03-10T16:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199769#M16296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Wiresim,&lt;BR /&gt;&lt;BR /&gt;The code you have provided is not working, when I want the module to sleep for more than 3mins. But, I need to make the module sleep for hours.Infact, the value of the counter in the loop works for a maximum value of about 120-180.If the value is more than what corresponds to 3mins, the module remains in Sleep and never wakes up. Can you please help me out with this and suggest me a way to make the module sleep for hours?&lt;BR /&gt;I need this information very urgently.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;Thanks for your help amd support.&lt;BR /&gt;Waiting for your response,&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Mou&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 19:36:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199769#M16296</guid>
      <dc:creator>mou</dc:creator>
      <dc:date>2008-04-07T19:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199770#M16297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hello Mou,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What is the value of MAX_RTI_COUNT that you use?&amp;nbsp; The global variable RTI_count will need to be of&lt;BR /&gt;sufficient size to accommodate this value.&amp;nbsp; For unsigned int, you should be able to achieve about 18&lt;BR /&gt;hours.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When you compile the code, do you get any warnings associated with the ISR code?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2008-04-08&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:26 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 22:23:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199770#M16297</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-04-07T22:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199771#M16298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi bigmac,&lt;/DIV&gt;&lt;DIV&gt;I am facing problem whenever I set the value of &lt;STRONG&gt;MAX_RTI_COUNT&lt;/STRONG&gt;&amp;gt;130(approx), which gives me around 2mins sleep time.&lt;/DIV&gt;&lt;DIV&gt;But I had declared the global variable &lt;STRONG&gt;RTI_count&lt;/STRONG&gt; as an &lt;STRONG&gt;int&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;DIV&gt;Can you please let me know the approx value of &lt;STRONG&gt;MAX_RTI_COUNT&lt;/STRONG&gt; that can provide me with the maximum sleep time and what should I declare the &lt;STRONG&gt;RTI_count&lt;/STRONG&gt; as?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks and Regards,&lt;/DIV&gt;&lt;DIV&gt;Mou&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 22:44:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199771#M16298</guid>
      <dc:creator>mou</dc:creator>
      <dc:date>2008-04-07T22:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Sleep interval in Stop3 mode-MC9S08GB60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199772#M16299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hello Mou,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If an 18 hour period is sufficient, declare the variable as &lt;FONT face="Courier New"&gt;unsigned int&lt;/FONT&gt;.&amp;nbsp; If you need more than this,&lt;BR /&gt;use an &lt;FONT face="Courier New"&gt;unsigned long&lt;/FONT&gt; variable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is the code you are using exactly the same as &lt;STRONG&gt;Wiresim&lt;/STRONG&gt; provided, using a flag to indicate that stop mode should be re-entered?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you happened to be re-entering stop mode from within the ISR, there would be a definite problem, as I&amp;nbsp; Indicated earlier.&amp;nbsp; In this case, the ISR code would be called recursively on each wakeup (since there would not be&amp;nbsp;an exit from the previous ISR call), and eventually the stack would overflow.&amp;nbsp; I wonder if this might be your problem.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It is necessary to exit the ISR before re-entering stop mode.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2008-04-08&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:10 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2008 06:02:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Regarding-Sleep-interval-in-Stop3-mode-MC9S08GB60/m-p/199772#M16299</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-04-08T06:02:08Z</dc:date>
    </item>
  </channel>
</rss>

