<?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>topic Re: SMAC &amp; low power : bugs? in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133996#M3598</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, kbu:&lt;BR /&gt;&lt;BR /&gt;It may be an obvious question, but did use set all of your unused I/O pins as outputs?&lt;BR /&gt;&lt;BR /&gt;The I/O pins will power-up configured as inputs, and will suck current if not pulled to Vcc or ground. My understanding is that, as an input, the pin's current will be relative to how far its input voltage is from either rail, and they could drift toward the midpoint if ignored.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Oct 2006 07:57:37 GMT</pubDate>
    <dc:creator>rocco</dc:creator>
    <dc:date>2006-10-27T07:57:37Z</dc:date>
    <item>
      <title>SMAC &amp; low power : bugs?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133992#M3594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to use SMAC with low power.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I started from an example appeared on SMAC4.1a release called SimpleNetwork. The example disappeared from release 4.1b and no example was published with low power features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that all run ok until there is a crash of the fw and the Query remote doesn't respond anymore. Do you have any idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void main(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gsTxPacket.u8DataLength = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gsTxPacket.pu8Data = &amp;amp;gau8TxDataBuffer[0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gsRxPacket.u8DataLength = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gsRxPacket.pu8Data = &amp;amp;gau8RxDataBuffer[0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gsRxPacket.u8MaxDataLength = 10;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gsRxPacket.u8Status = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Begin init */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCUInit();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCUPortInit(); //Set up unused ports for low power&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MC13192Init();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MLMESetMC13192ClockRate(0); /* 16 MHz MC13192 CLKo */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UseExternalClock(); /* Now at 8 Mhz CPU bus */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LEDInit();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TPM1SC = 0x0F; /* Timer prescale by 128. (16uS timebase for 8MHz bus clock). */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Set up Real Time Interrupt for STOP3 very low power operation */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SRTISC = 0x17; //Enable RTI timer, internal clock, 1 sec wakeup&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SPMSC1 = 0; //Disable all LVD functions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SPMSC2=SPMSC2&amp;amp;~0x03; /* Enable deep sleep mode stop3 (PDC &amp;amp; PPDC =0) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SOPT_STOPE = 1; //Enable STOP mode(s)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Enable all IRQ sources. */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MC13192_IRQ_IE_BIT = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EnableInterrupts;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MLMESetChannelRequest(Channel_Num); /* Choose your channel here */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MLMESetMC13192TmrPrescale(3); // Set 250 kHz timer rate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MLMEMC13192PAOutputAdjust(MAX_POWER);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/**************************************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* Main Loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;**************************************************************/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gu8AppStatus = LOOK_AROUND; //start by looking for request&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for(;&lt;/SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;switch (gu8AppStatus)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;case LOOK_AROUND:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UseMcuClock();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MLMEHibernateRequest(); //MC13192 now consuming 3 uA&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DEAD_STOP3(); // Enter STOP3, MCU now consuming 1uA&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MLMEWakeRequest();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UseExternalClock();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MLMERXEnableRequest(&amp;amp;gsRxPacket, 750); // 250 = 1mS timeout&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOW_POWER_WHILE(); //Stay until Interrupted for TO or data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;case TX_IDnDATA:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gu8LinkQuality = MLMELinkQuality()/2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gau8TxDataBuffer[0] = Net_ID; //Send our net #&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gau8TxDataBuffer[1] = Remote_ID; //Send board ID #&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gau8TxDataBuffer[2] = gu8LinkQuality; //Send link quality as data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gsTxPacket.u8DataLength = 3;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCPSDataRequest(&amp;amp;gsTxPacket); // transmit data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WinkLED2x(); //Double-wink LED for good packet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gu8AppStatus = LOOK_AROUND; //return to await query mode&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;case NO_DATA:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WinkLED1x(); //Show no packet for us&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gu8AppStatus = LOOK_AROUND;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void MCPSDataIndication(tRxPacket *gsRxPacket)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;switch (gsRxPacket-&amp;gt;u8Status)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;case SUCCESS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Check for Host and ID match.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if ((gsRxPacket-&amp;gt;pu8Data[0] == Net_ID) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(gsRxPacket-&amp;gt;pu8Data[1] == Remote_ID))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gu8AppStatus = TX_IDnDATA; //enable response to host&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gu8AppStatus = NO_DATA;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;case TIMEOUT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gu8AppStatus = NO_DATA;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;case OVERFLOW:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2006 22:53:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133992#M3594</guid>
      <dc:creator>stevasway</dc:creator>
      <dc:date>2006-10-23T22:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC &amp; low power : bugs?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133993#M3595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm not sure why your firmware crashes, but I have a similar program and I can't get the device to go into STOP2.&lt;BR /&gt;I've noticed however that I am never able to update the SPMSC2 register, even if I try to force SPMSC2 = 0x03; (to set the PDC and PPDC bits) the value remains 0x00 (viewed in the Inspect window of Hiwave- also in the location 0x180A)&lt;BR /&gt;&lt;BR /&gt;Can you see in your code if the value of SPMSC2 changes?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 21:37:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133993#M3595</guid>
      <dc:creator>kbu</dc:creator>
      <dc:date>2006-10-25T21:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC &amp; low power : bugs?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133994#M3596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;No problem I'll check in my code if the value of SPMSC2 changes, but if I remember, in this case I can't go in stop mode 2, but only in stop mode 3, because the rti interrupt occours. Did you try with stop3?&lt;BR /&gt;&lt;BR /&gt;I'm not sure but, looking for 802.15.4 Star Network Demo code, I found the settings for low power about SPMSC and IGC, and I saw that there is a interrupt to manage:&lt;BR /&gt;&lt;BR /&gt;file : igc.c&lt;BR /&gt;&lt;BR /&gt;__interrupt void FLL_Lost_Lock_ISR(void)&lt;BR /&gt;{&lt;BR /&gt;// Setup ICG module again to prevent that system hangs forever.&lt;BR /&gt;ICGS1 |= 0x01; // Clear FLL lost lock interrupt&lt;BR /&gt;&lt;BR /&gt;// Ensure MCU clk is stable&lt;BR /&gt;PowerManager_WaitForPowerUp();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Look at SPMSC2 settings in PWRLIB.C and PWR.C, maybe you find something.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2006 19:46:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133994#M3596</guid>
      <dc:creator>stevasway</dc:creator>
      <dc:date>2006-10-26T19:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC &amp; low power : bugs?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133995#M3597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;my SPMSC2 problem was that I hadn't set it correctly at start up and since some bits are write-once they should have been setup earlier.&lt;BR /&gt;&lt;BR /&gt;So far I've only been able to get the micro into Stop3, it just doesn't get into Stop2.&lt;BR /&gt;&lt;BR /&gt;I'm still getting a very high current of 1.2 mA when it goes to stop3. (only have the radio and baluns on board, direct VCC from bench supply)&lt;BR /&gt;the setup before going to sleep :&lt;BR /&gt;- KBI Off&lt;BR /&gt;- LVD off&lt;BR /&gt;- using internal MCU clock (SCM mode down to 60kHz)&lt;BR /&gt;- Radio off&lt;BR /&gt;&lt;BR /&gt;what current consumption are you seeing?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2006 05:18:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133995#M3597</guid>
      <dc:creator>kbu</dc:creator>
      <dc:date>2006-10-27T05:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC &amp; low power : bugs?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133996#M3598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, kbu:&lt;BR /&gt;&lt;BR /&gt;It may be an obvious question, but did use set all of your unused I/O pins as outputs?&lt;BR /&gt;&lt;BR /&gt;The I/O pins will power-up configured as inputs, and will suck current if not pulled to Vcc or ground. My understanding is that, as an input, the pin's current will be relative to how far its input voltage is from either rail, and they could drift toward the midpoint if ignored.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2006 07:57:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133996#M3598</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-10-27T07:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: SMAC &amp; low power : bugs?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133997#M3599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yep all i/o pins set to output. I can measure a slightly higher voltage if I configure them as inputs while sleeping. but only 100uA's or so.&lt;BR /&gt;Right now my board is all the way up at 1mA.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2006 11:36:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SMAC-low-power-bugs/m-p/133997#M3599</guid>
      <dc:creator>kbu</dc:creator>
      <dc:date>2006-10-27T11:36:59Z</dc:date>
    </item>
  </channel>
</rss>

