<?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: mm9z1_638 Sleep Error with current Threshold (d2d Error) in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mm9z1-638-Sleep-Error-with-current-Threshold-d2d-Error/m-p/908692#M16487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@WolfgangBihlmayr&lt;/P&gt;&lt;P&gt;yes I saw without debugger. Also i tried sleep mode now. And I read mcu's datasheet that say&amp;nbsp;"Having any analog die IRQ allowed when entering Low-power mode is not recommended".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i am trying with this sleep code but error is exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void Sleep()&lt;BR /&gt;{&lt;BR /&gt; &lt;BR /&gt; DDRA_DDRA7 = 1;&lt;BR /&gt; PTA_PTA7 = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InitSleepTimer();&lt;BR /&gt; InitSleepCurrent();&lt;BR /&gt; TsenseDisable();&lt;BR /&gt; B_ACQ_CTL = ACQIntDisableMask;&lt;BR /&gt; CAN_STDBY(STANDBYMODE); &lt;BR /&gt; &lt;BR /&gt; PCREnterSleepMode();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //sleep here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B_WD_CTL = WD_256ms; */ &lt;BR /&gt; B_WD_CTL = WD_OFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B_ACQ_CTL = ACQIntEnableMask;&lt;BR /&gt; TsenseEnableExtSensor();&lt;BR /&gt; TsenseEnableIntSensor();&lt;BR /&gt; CAN_STDBY(NORMALMODE); &lt;BR /&gt; DDRA_DDRA7 = 1;&lt;BR /&gt; PTA_PTA7 = 1;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Sep 2019 13:02:45 GMT</pubDate>
    <dc:creator>draven</dc:creator>
    <dc:date>2019-09-25T13:02:45Z</dc:date>
    <item>
      <title>mm9z1_638 Sleep Error with current Threshold (d2d Error)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mm9z1-638-Sleep-Error-with-current-Threshold-d2d-Error/m-p/908690#M16485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am devolopment on mm9z1_638. I use ADC to get current,voltages and temperatures.&lt;/P&gt;&lt;P&gt;I sleep the uC for every 1 minute. There is two condition for wake up.&lt;/P&gt;&lt;P&gt;One is depends on timer and another is current threshold. But every time&amp;nbsp;isrD2DErr interrupt handled and code is stuck in there.&lt;/P&gt;&lt;P&gt;If I not open current threshold, error is not happen.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a reset uC software run until error occur.&lt;/P&gt;&lt;P&gt;D2DSTAT0 register is : 10010001.&lt;/P&gt;&lt;P&gt;Error context is:&lt;/P&gt;&lt;P&gt;Time Out Error Flag — This read-only flag indicates the initiator has detected a timeout error. This flag is cleared when the ERRIF bit is cleared by writing a 1 to the ERRIF bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also when I test with debugging I saw program stuch at&amp;nbsp;PGAAutoZero(); function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My sleep code sequence is :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void Sleep()&lt;BR /&gt;{&lt;BR /&gt; DDRA_DDRA7 = 1;&lt;BR /&gt; PTA_PTA7 = 0;&lt;BR /&gt; InitSleepTimer();&lt;BR /&gt; ADCDisable();&lt;BR /&gt; TsenseDisable();&lt;BR /&gt; B_GPIO_VSENSE = 0;&lt;BR /&gt; ADCLpEnable();&lt;BR /&gt; InitSleepCurrent();&lt;BR /&gt; CAN_STDBY(STANDBYMODE); &lt;BR /&gt; PTA_PTA1 = 0;&lt;BR /&gt; PCREnterStopMode();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //sleep here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B_WD_CTL = WD_OFF;&lt;BR /&gt; MeasurementStart();&amp;nbsp;&amp;nbsp;&amp;nbsp;// function is init V,I and T channels and ADCInit&lt;BR /&gt; CAN_STDBY(NORMALMODE); &lt;BR /&gt; DDRA_DDRA7 = 1;&lt;BR /&gt; PTA_PTA7 = 1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void InitSleepTimer()&lt;BR /&gt;{&lt;BR /&gt; &lt;BR /&gt; B_GPIO_CTL = B_GPIO_CTL_DIR3M_MASK | B_GPIO_CTL_DIR3_MASK;&lt;BR /&gt; // route Timer OC3 to PTB3&lt;/P&gt;&lt;P&gt;B_GPIO_OUT3_TCOMP3 = 1;&lt;/P&gt;&lt;P&gt;// set Timer Ch3 to OC&lt;/P&gt;&lt;P&gt;B_TIOS_IOS3 = 1;&lt;/P&gt;&lt;P&gt;B_TSCR1_TEN = 1;&lt;/P&gt;&lt;P&gt;B_TCTL1 = 0x80; // clear on OC&lt;/P&gt;&lt;P&gt;B_CFORC_FOC3 = 1; // force OC&lt;/P&gt;&lt;P&gt;B_TSCR1_TEN = 0; // disable timer because it will start start of sleep mode&lt;BR /&gt; &lt;BR /&gt; // setup a rising edge in 10s&lt;/P&gt;&lt;P&gt;B_TCTL1 = 0xC0; // set on OC&lt;/P&gt;&lt;P&gt;//B_TC3 = B_TC3 + 60000; // reload 60s&lt;BR /&gt; B_TC3 = B_TC3 + 5000;&lt;BR /&gt; B_TFLG1_C3F = 1;&lt;/P&gt;&lt;P&gt;B_PCR_WUE_WUPTB3 = 1; //enable wakeup on ptb3 (rising edge)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void InitSleepCurrent()&lt;BR /&gt;{&lt;BR /&gt; B_ACQ_CTH = 100; &lt;BR /&gt; B_PCR_WUEH_WUCTH = 1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error interrupt is :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;interrupt VectorNumber_Vd2di_err void isrD2DErr(void) {&lt;/P&gt;&lt;P&gt;while(1) {&lt;BR /&gt; if(D2DSTAT0_ERRIF) {&lt;BR /&gt; D2DSTAT0_ERRIF = 1; // clear flag&lt;BR /&gt; }else{&lt;BR /&gt; PCRReset(); // issue an analog die reset &lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE_DRV638_RETURN PGAAutoZero(void) {&lt;BR /&gt; &lt;BR /&gt; if(!B_ACQ_CTL_CMEN) // current measurement ACQ must be active &lt;BR /&gt; return ERR_CONFIG;&lt;/P&gt;&lt;P&gt;B_COMP_CTL = PGAAutoZeroEnableMask; // PGA Input Zero and start PGA Offset compensation sequence&lt;BR /&gt; while(!B_COMP_SR_PGAOF) DO_NOTHING; // wait until PGA AutoZero sequence finished&lt;BR /&gt; B_COMP_CTL = PGAAutoZeroDisableMask; // disable PGA Input Zero and PGA Offset compensation sequence&lt;BR /&gt; B_COMP_SR = B_COMP_SR_PGAOF_MASK ; // clear flag (after disable)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; return OK;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code stuch at&amp;nbsp;&lt;SPAN&gt;while(!B_COMP_SR_PGAOF) DO_NOTHING;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please someone can help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2019 06:28:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mm9z1-638-Sleep-Error-with-current-Threshold-d2d-Error/m-p/908690#M16485</guid>
      <dc:creator>draven</dc:creator>
      <dc:date>2019-09-25T06:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: mm9z1_638 Sleep Error with current Threshold (d2d Error)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mm9z1-638-Sleep-Error-with-current-Threshold-d2d-Error/m-p/908691#M16486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The error is most likely related to the VDDH / VDDD2D being 0V, whilst the uC tries to access the D2D interface (read/write to registers on the analog die). This would generate such a D2Derror.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the debugger connected the uC will not enter STOP mode (limitation of the MM9Z1_638 device). Do you see the same issue without the debugger connected?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2019 12:55:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mm9z1-638-Sleep-Error-with-current-Threshold-d2d-Error/m-p/908691#M16486</guid>
      <dc:creator>Q_man</dc:creator>
      <dc:date>2019-09-25T12:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: mm9z1_638 Sleep Error with current Threshold (d2d Error)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mm9z1-638-Sleep-Error-with-current-Threshold-d2d-Error/m-p/908692#M16487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@WolfgangBihlmayr&lt;/P&gt;&lt;P&gt;yes I saw without debugger. Also i tried sleep mode now. And I read mcu's datasheet that say&amp;nbsp;"Having any analog die IRQ allowed when entering Low-power mode is not recommended".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i am trying with this sleep code but error is exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void Sleep()&lt;BR /&gt;{&lt;BR /&gt; &lt;BR /&gt; DDRA_DDRA7 = 1;&lt;BR /&gt; PTA_PTA7 = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InitSleepTimer();&lt;BR /&gt; InitSleepCurrent();&lt;BR /&gt; TsenseDisable();&lt;BR /&gt; B_ACQ_CTL = ACQIntDisableMask;&lt;BR /&gt; CAN_STDBY(STANDBYMODE); &lt;BR /&gt; &lt;BR /&gt; PCREnterSleepMode();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //sleep here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B_WD_CTL = WD_256ms; */ &lt;BR /&gt; B_WD_CTL = WD_OFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B_ACQ_CTL = ACQIntEnableMask;&lt;BR /&gt; TsenseEnableExtSensor();&lt;BR /&gt; TsenseEnableIntSensor();&lt;BR /&gt; CAN_STDBY(NORMALMODE); &lt;BR /&gt; DDRA_DDRA7 = 1;&lt;BR /&gt; PTA_PTA7 = 1;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2019 13:02:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mm9z1-638-Sleep-Error-with-current-Threshold-d2d-Error/m-p/908692#M16487</guid>
      <dc:creator>draven</dc:creator>
      <dc:date>2019-09-25T13:02:45Z</dc:date>
    </item>
  </channel>
</rss>

