<?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>S12 / MagniV MicrocontrollersのトピックRe: Wakeup problem in MM9Z1638</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Wakeup-problem-in-MM9Z1638/m-p/1406513#M18449</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196262"&gt;@mbed_cool&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This is currently under a discussion here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-modes-in-MM9Z1638/td-p/1405922" target="_blank"&gt;https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-modes-in-MM9Z1638/td-p/1405922&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jan 2022 09:06:21 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2022-01-28T09:06:21Z</dc:date>
    <item>
      <title>Wakeup problem in MM9Z1638</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Wakeup-problem-in-MM9Z1638/m-p/1405930#M18440</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My wish is to work low power modes with CAN protocol(I am working with CAN transmission on MM9Z1_638 ), in this process i am setting MSCAN is in Sleep Mode and MCU in stop mode and according to the datasheet to wake the MCU from stop mode using PTB4 (&amp;nbsp;For Wake-up&amp;nbsp; i am setting of the NWUE bit in the GPIO_IN4 register and with the Wake-up Enable Bit (WUPTB4) and the port configuration bit (PTWU) set)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;But i am unable wakeup the MCU with PTB4 interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help me to sort of this problem and I am attaching my code here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;#include "drv638.h" // driver for MM9Z1-638&lt;BR /&gt;#include "nvm.h" // nvm driver&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt; // sprintf&lt;BR /&gt;#include "main.h"&lt;BR /&gt;#include "soc.h"&lt;BR /&gt;#include "rd9z1_638_12vc.h"&lt;BR /&gt;#include "ntc.h"&lt;BR /&gt;#include "service.h"&lt;BR /&gt;#include "usercan.h"&lt;BR /&gt;#include "msCANdrv.h"&lt;/P&gt;&lt;P&gt;// For CAN bit Timing see AN1798.pdf&lt;/P&gt;&lt;P&gt;extern u8 wak_int;&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;// This demo software is provided "AS-IS".&lt;BR /&gt;// For documentation please see the folder \docu\documentation.html&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;//---------------------------------------------------------------------&lt;BR /&gt;/*! \brief Structure for Clock configuration for CAN demo&lt;/P&gt;&lt;P&gt;- use external oscillator (16.000MHz) as reference clock (divide by 16)&lt;BR /&gt;- target VCO clock: 50.000MHz&lt;BR /&gt;- target core clock: 50.000MHz&lt;BR /&gt;- target bus clock : 25.000MHz&lt;BR /&gt;- target D2D clock : 25.000MHz&lt;BR /&gt;*/&lt;BR /&gt;TYPE_CPMU_CONF const ClockConf = {&lt;BR /&gt;ClockSrc_EXT,&lt;BR /&gt;VCO_RANGE,&lt;BR /&gt;SYNR(CLOCK_VCO, CLOCK_REF),&lt;BR /&gt;REFCLK_FREQ_1_2_MHZ_RANGE, // Ref is IRC = 1.000MHz&lt;BR /&gt;// REFDIV(4), // Refdivider div = 4 (4MHz quarz)&lt;BR /&gt;REFDIV(16), // Refdivider div = 16 (16MHz quarz)&lt;BR /&gt;POSTDIV(CLOCK_VCO, CLOCK_BUS),&lt;BR /&gt;PLL_FREQ_MOD_0_PERCENT,&lt;BR /&gt;PCRPRE(CLOCK_D2D), // PCR prescaler&lt;BR /&gt;D2DDIV(CLOCK_BUS, CLOCK_D2D)&lt;BR /&gt;};&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;//! \brief TSENSE list of channels to convert...&lt;BR /&gt;TYPE_TSENSE_LIST const tList[] = {&lt;BR /&gt;// ch , avg&lt;BR /&gt;CH_TSENSE_ITS , 1, 6, //!&amp;lt; measure internal chip temperature&lt;BR /&gt;TSENSE_EXT , 1, 6 //!&amp;lt; measure external temperature sensor (NTC)&lt;BR /&gt;};&lt;BR /&gt;const u8 tListEntries = sizeof(tList)/sizeof(TYPE_TSENSE_LIST); //!&amp;lt; number of entries in the list above&lt;BR /&gt;static u16 tValues[sizeof(tList)/sizeof(TYPE_TSENSE_LIST)]; //!&amp;lt; RAM buffer for the TSENSE module&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;//! \brief VSENSE list of channels to convert...&lt;BR /&gt;TYPE_VSENSE_LIST const vList[] = {&lt;BR /&gt;// ch , avg , latency&lt;BR /&gt;CH_VSENSE2 , 100, 12,&lt;BR /&gt;};&lt;BR /&gt;const u8 vListEntries = sizeof(vList)/sizeof(TYPE_VSENSE_LIST); //!&amp;lt; number of entries in the list above&lt;BR /&gt;static u16 vValues[sizeof(vList)/sizeof(TYPE_VSENSE_LIST)]; //!&amp;lt; RAM buffer for the VSENSE module&lt;/P&gt;&lt;P&gt;// --------------------------------------------------------------------&lt;BR /&gt;//! \brief CSENSE list of channels to convert...&lt;BR /&gt;TYPE_CSENSE_LIST const cList[] = {&lt;BR /&gt;// ch , avg , latency&lt;BR /&gt;CH_CSENSE , 100 , 0&lt;BR /&gt;};&lt;BR /&gt;const u8 cListEntries = sizeof(cList)/sizeof(TYPE_CSENSE_LIST); //!&amp;lt; number of entries in the list above&lt;BR /&gt;static s32 cValues[sizeof(cList)/sizeof(TYPE_CSENSE_LIST)]; //!&amp;lt; RAM buffer for the TSENSE module&lt;BR /&gt;/*&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;// PTA0 is connected to MC33901 STB pin&lt;BR /&gt;#define STANDBYMODE (1)&lt;BR /&gt;#define NORMALMODE (0)&lt;BR /&gt;#define CAN_STDBY(v) {DDRA_DDRA0 = 1; PTA_PTA0 = (v);}&lt;BR /&gt;*/&lt;/P&gt;&lt;P&gt;// --------------------------------------------------------------------&lt;BR /&gt;// PTA6 is connected to MC33901 STB pin&lt;BR /&gt;#define STANDBYMODE (1)&lt;BR /&gt;#define NORMALMODE (0)&lt;BR /&gt;#define CAN_STDBY(v) {DDRA_DDRA6 = 1; PTA_PTA6 = (v);}&lt;/P&gt;&lt;P&gt;// ---------------------------------------------------------------------&lt;BR /&gt;// private prototypes&lt;BR /&gt;void GPIOInit(void);&lt;BR /&gt;void LTCInit(void);&lt;BR /&gt;void asciitohexa(char* input, char* output); // Change by baji&lt;/P&gt;&lt;P&gt;// ---------------------------------------------------------------------&lt;BR /&gt;// ---------------------------------------------------------------------&lt;BR /&gt;// ---------------------------------------------------------------------&lt;BR /&gt;void main(void) {&lt;BR /&gt;u16 TSensor[tListEntries];&lt;BR /&gt;u16 VSensor[vListEntries];&lt;BR /&gt;s32 CSensor[cListEntries];&lt;BR /&gt;&lt;BR /&gt;TYPE_CAN_IBS_Data CAN_IBS_Data;&lt;BR /&gt;TYPE_CAN_IBS_Data_Ext CAN_IBS_Data_Ext;&lt;BR /&gt;&lt;BR /&gt;u8 rec_data[9]={0},trans_arr[8],rec_flag;&lt;BR /&gt;&lt;BR /&gt;TYPE_CAN_IBS_CONTROL CAN_IBS_Control;&lt;BR /&gt;MSCAN_TYPE_ERROR_CODE err_status; //To store the return value of the driver APIs.&lt;BR /&gt;MSCAN_TYPE_STATUS mbStat;&lt;BR /&gt;u8 CAN_status[3]; //CAN_status to store channel status,byte 0 store CANCTL0, byte 1 store CANCTL1, byte 2 store CANRFLG&lt;BR /&gt;&lt;BR /&gt;u8 u8ModeTimer;&lt;BR /&gt;u32 u32Temp;&lt;BR /&gt;static TYPE_BATTERY Battery;&lt;BR /&gt;s16 s16Vdrop;&lt;BR /&gt;u8 u8WakeUpReason;&lt;BR /&gt;u8 u8ChipTemp;&lt;BR /&gt;u16 u16Result;&lt;BR /&gt;Bool WriteSystemCalibrationValues = FALSE; // do not change !!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SYS_Init();&lt;BR /&gt;CPMUInit(&amp;amp;ClockConf);&lt;BR /&gt;D2DInit((TYPE_D2DCLKDIV) ClockConf.D2dDiv);&lt;BR /&gt;XirqEnable(); // enable XIRQ -&amp;gt; isrD2DErr() "write-once"&lt;BR /&gt;if (B_PCR_CTL_OPM &amp;amp; 2) { // Check if Wake Up from Sleep mode (see page RM3.0 110 Intermediate Mode)&lt;BR /&gt;u32Temp = B_ACQ_AHC;&lt;BR /&gt;B_PCR_CTL = OPM_SET_NORMAL; // set normal mode&lt;BR /&gt;while (!(B_PCR_SRH_WLPMF )) DO_NOTHING; // Wait for Clock Domain Change \! /todo where is this described?&lt;BR /&gt;}else{&lt;BR /&gt;if(!B_PCR_SR_HWRF) {&lt;BR /&gt;PCRReset(); // generate a HWR reset to ensure analog die is in defined state! E.g. debugging might cause strange effects in case bits are set from before //&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;B_WD_CTL = WD_OFF;&lt;BR /&gt;u8WakeUpReason = 0;&lt;BR /&gt;&lt;BR /&gt;// evaluate wakeup reason&lt;BR /&gt;if(B_PCR_SR_WULINF) { // wakeup caused by LIN&lt;BR /&gt;u8WakeUpReason = 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(B_PCR_SR_WUAHTHF) {&lt;BR /&gt;u8WakeUpReason = 2;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(B_PCR_SR_WUCALF) {&lt;BR /&gt;u8WakeUpReason = 3;&lt;BR /&gt;}&lt;BR /&gt;if(B_PCR_SR_WUCTHF) { // current threshold&lt;BR /&gt;u8WakeUpReason = 4;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(B_PCR_SR_WULTCF) {&lt;BR /&gt;u8WakeUpReason = 5;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;B_PCR_SRH = 0xFF; // clear all flags&lt;BR /&gt;&lt;BR /&gt;PCRInit(ClockConf.PCRprescaler);&lt;BR /&gt;SYSStartupTrimming();&lt;/P&gt;&lt;P&gt;//! \brief Set a breakpoint to this line and change the variable WriteSystemCalibrationValues to TRUE in the debugger to write values \ref CalibWrite&lt;BR /&gt;if(WriteSystemCalibrationValues) { // hook to manually write system calibration values to eeprom during sw development&lt;BR /&gt;CalibWriteManual();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(CalibRead()==FALSE) { // reads system calibration data from EEPROM (if avaliable). needs to be before ADCInit()&lt;BR /&gt;CalibDefault(); // otherwise use default values&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;VsenseInit(&amp;amp;(vList[0]), &amp;amp;vListEntries, &amp;amp;(vValues[0]));&lt;BR /&gt;CsenseInit(&amp;amp;(cList[0]), &amp;amp;cListEntries, &amp;amp;(cValues[0]));&lt;BR /&gt;TsenseInit(&amp;amp;(tList[0]), &amp;amp;tListEntries, &amp;amp;(tValues[0]));&lt;BR /&gt;ADCInit();&lt;/P&gt;&lt;P&gt;GPIOInit();&lt;BR /&gt;LTCInit();&lt;BR /&gt;&lt;BR /&gt;CAN_STDBY(NORMALMODE);&lt;BR /&gt;// IBS control frame&lt;BR /&gt;CAN_IBS_Control.u8Len = 2;&lt;BR /&gt;&lt;BR /&gt;err_status = Init_CAN(CAN0, FAST); //Initialization msCAN channel 0, FAST means the reset won't wait until current transmit completed&lt;BR /&gt;do{&lt;BR /&gt;err_status = Check_CAN_Status(CAN0, CAN_status);&lt;BR /&gt;}while ((CAN_status[0] &amp;amp; SYNCH) == 0); //Wait for msCAN channel 0 synchronized to CAN Bus&lt;BR /&gt;err_status = Config_CAN_MB(CAN0, CANBUF1, TXDF, CAN_MO1); //configure the msCAN channel 0, buffer 1 to be TXDF mode (transmit dataframe) -&amp;gt; message object 1,see details in "MSCANID.h"&lt;BR /&gt;err_status = Config_CAN_MB(CAN0, CANBUF2, TXDF, CAN_MO2); //configure the msCAN channel 0, buffer 2 to be TXDF mode (transmit dataframe) -&amp;gt; message object 2&lt;BR /&gt;err_status = Config_CAN_MB(CAN0, CANBUF3, RXDF, CAN_MO3); //configure the msCAN channel 0, buffer 3 to be RXDF mode (receive dataframe) -&amp;gt; message object 3&lt;BR /&gt;&lt;BR /&gt;Battery.tMode = BM_PARKING; // used to get an initial OCV based SoC&lt;BR /&gt;SoCInit();&lt;BR /&gt;RTIInit();&lt;BR /&gt;RTIEnable();&lt;BR /&gt;IrqEnable();&lt;BR /&gt;u8ModeTimer = 50; // timed mode change from parking -&amp;gt; driving (5*100ms)&lt;/P&gt;&lt;P&gt;for EVER {&lt;BR /&gt;&lt;BR /&gt;switch(Battery.tMode) {&lt;BR /&gt;case BM_PARKING:&lt;BR /&gt;case BM_DRIVING:&lt;BR /&gt;// ----- measurements, voltage, current and temp ------&lt;BR /&gt;if(TsenseGetValue(CH_TSENSE_ITS, &amp;amp;TSensor[0])) { // request data&lt;BR /&gt;u8ChipTemp = (u8)(TSensor[0]/TSENSE_ITS_INVRES+K2C+40); // scale to deg C with offset 40&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(TsenseGetValue(TSENSE_EXT, &amp;amp;TSensor[1])) {&lt;BR /&gt;Battery.u16TempK = NTCRaw2Kelvin(NTCconvert, TSensor[1]);&lt;BR /&gt;}&lt;BR /&gt;if(CsenseGetValue(CH_CSENSE, &amp;amp;CSensor[0])) {&lt;BR /&gt;Battery.s32mAFilt = CSensor[0];&lt;BR /&gt;}&lt;BR /&gt;if(VsenseGetValue(CH_VSENSE2, &amp;amp;VSensor[0])) { // if 0 channel is converted then&lt;BR /&gt;&lt;BR /&gt;#if (ISENSE_GND_REF==ISENSEL)&lt;BR /&gt;// ISENSEL is GND reference&lt;BR /&gt;s16Vdrop = (s16)(Battery.s32mAFilt/G_SHUNT); // calculated shunt drop voltage&lt;BR /&gt;Battery.u16mV = (VSensor[0]&amp;gt;&amp;gt;1) - s16Vdrop; // scale to mV and correct shunt drop voltage&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;#if (ISENSE_GND_REF==ISENSEH)&lt;BR /&gt;// ISENSEH is GND reference&lt;BR /&gt;Battery.u16mV = VSensor[0]&amp;gt;&amp;gt;1; // scale to mV and no correction&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;BR /&gt;if(RTIEvery100ms()) {&lt;BR /&gt;SoCUpdate(&amp;amp;Battery);&lt;BR /&gt;TsenseHandler(); // temperature needs to be done polling (V,I interrupt driven)&lt;BR /&gt;if(u8ModeTimer&amp;gt;0) { // timed mode change from parking -&amp;gt; driving (5*100ms)&lt;BR /&gt;u8ModeTimer--;&lt;BR /&gt;}else{&lt;BR /&gt;Battery.tMode = BM_DRIVING;&lt;BR /&gt;}&lt;BR /&gt;CAN_IBS_Data.FrameLen = 8;&lt;BR /&gt;CAN_IBS_Data.BatVolt = u16Swap(Battery.u16mV); // scale to mV&lt;BR /&gt;CAN_IBS_Data.BatCurr = u32Swap(Battery.s32mAFilt);&lt;BR /&gt;CAN_IBS_Data.BatTemp = (u8)(Battery.u16TempK+K2C+40);&lt;BR /&gt;CAN_IBS_Data.BatMode = Battery.tMode;&lt;BR /&gt;err_status = Load_CAN_MB(CAN0, CANBUF1, CAN_IBS_Data.byte);&lt;BR /&gt;err_status = Transmit_CAN_MB(CAN0, CANBUF1);&lt;BR /&gt;}&lt;BR /&gt;if(RTIEvery1000ms()) {&lt;BR /&gt;CAN_IBS_Data_Ext.FrameLen = 6;&lt;BR /&gt;CAN_IBS_Data_Ext.ChipTemp = u8ChipTemp;&lt;BR /&gt;CAN_IBS_Data_Ext.SOC = Battery.u8SoC;&lt;BR /&gt;CAN_IBS_Data_Ext.Coulomb = u32Swap(Battery.u32CoulombCnt);&lt;BR /&gt;err_status = Load_CAN_MB(CAN0, CANBUF2, CAN_IBS_Data_Ext.byte);&lt;BR /&gt;err_status = Transmit_CAN_MB(CAN0, CANBUF2);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;case BM_CALIBRATION:&lt;/P&gt;&lt;P&gt;ServiceApp();&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// read message object .....&lt;BR /&gt;(void) Check_CAN_MB_Status(CAN0, CANBUF3, &amp;amp;mbStat);&lt;BR /&gt;if((mbStat.Status == NEWDATA) || (mbStat.Status == OVERRUN)) { //Wait for the Receive ISR to finish and change the buffer status, NEWDATA indicates that the buffer has receive a new data&lt;BR /&gt;&lt;BR /&gt;if(wak_int == 10){&lt;BR /&gt;wak_int=1;&lt;BR /&gt;}&lt;BR /&gt;err_status = Read_CAN_MB_Data(CAN0, CANBUF3, CAN_IBS_Control.byte);//Copy the received data in msCAN channel 0 buffer 2 to data_rec;&lt;BR /&gt;CAN_IBS_Control.u16Var = u16Swap(CAN_IBS_Control.u16Var);&lt;BR /&gt;//Clear buffer_status[0]&lt;BR /&gt;//err_status = Read_CAN_MB_Data(CAN0, CANBUF3, rec_data);&lt;BR /&gt;err_status = Load_CAN_MB(CAN0, CANBUF1, CAN_IBS_Control.byte);&lt;BR /&gt;err_status = Transmit_CAN_MB(CAN0, CANBUF1);&lt;BR /&gt;mbStat.Status = NODATA;&lt;BR /&gt;&lt;BR /&gt;if(CAN_IBS_Control.u16Var&amp;amp;0x8000) { // Goto Sleep Request&lt;BR /&gt;// goto sleep&lt;BR /&gt;err_status = Sleep_CAN(CAN0, CMPTX); // request CAN channel 0 go to sleep with completing transmission scheduled&lt;BR /&gt;do {&lt;BR /&gt;err_status = Check_CAN_Status(CAN0,CAN_status); // read the channel 0 status&lt;BR /&gt;}while (!(CAN_status[1]&amp;amp;SLPAK)); // wait till SLPAK bit set&lt;/P&gt;&lt;P&gt;B_PCR_WUEH_WUPTB4 = 1; // enable PTB4 wakeup&lt;BR /&gt;ADCDisable();&lt;BR /&gt;TsenseDisable();&lt;BR /&gt;B_GPIO_VSENSE = 0;&lt;BR /&gt;&lt;BR /&gt;CAN_STDBY(STANDBYMODE);&lt;BR /&gt;PTA_PTA1 = 0;&lt;BR /&gt;PCREnterStopMode();&lt;/P&gt;&lt;P&gt;// .....zzzzzzzzzzz (stop mode)&lt;BR /&gt;// after wakeup the code continues to run here....&lt;BR /&gt;// but first the D2D Interrupt service routine will be run&lt;BR /&gt;B_WD_CTL = WD_OFF;&lt;BR /&gt;B_PCR_CTL = OPM_SET_NORMAL; /* set normal mode*/ // bb&lt;BR /&gt;VsenseInit(&amp;amp;(vList[0]), &amp;amp;vListEntries, &amp;amp;(vValues[0]));&lt;BR /&gt;CsenseInit(&amp;amp;(cList[0]), &amp;amp;cListEntries, &amp;amp;(cValues[0]));&lt;BR /&gt;TsenseInit(&amp;amp;(tList[0]), &amp;amp;tListEntries, &amp;amp;(tValues[0]));&lt;BR /&gt;ADCInit();&lt;BR /&gt;CAN_STDBY(NORMALMODE);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if(CAN_IBS_Control.u16Var&amp;amp;0x1000) { // Goto Calib mode&lt;BR /&gt;Battery.tMode = BM_CALIBRATION;&lt;/P&gt;&lt;P&gt;CAN_IBS_Data.BatMode = Battery.tMode;&lt;BR /&gt;err_status = Load_CAN_MB(CAN0, CANBUF1, CAN_IBS_Data.byte);&lt;BR /&gt;err_status = Transmit_CAN_MB(CAN0, CANBUF1);&lt;BR /&gt;&lt;BR /&gt;err_status = Config_CAN_MB (CAN0, 8, RXDF, 8);&lt;BR /&gt;err_status = Config_CAN_MB (CAN0, 9, TXDF, 9);&lt;BR /&gt;}&lt;BR /&gt;if(CAN_IBS_Control.u16Var&amp;amp;0x2000) { // Goto normal mode&lt;BR /&gt;Battery.tMode = BM_DRIVING;&lt;BR /&gt;VsenseInit(&amp;amp;(vList[0]), &amp;amp;vListEntries, &amp;amp;(vValues[0]));&lt;BR /&gt;CsenseInit(&amp;amp;(cList[0]), &amp;amp;cListEntries, &amp;amp;(cValues[0]));&lt;BR /&gt;TsenseInit(&amp;amp;(tList[0]), &amp;amp;tListEntries, &amp;amp;(tValues[0]));&lt;BR /&gt;ADCInit();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;} // for EVER&lt;BR /&gt;}&lt;BR /&gt;// ---------------------------------------------------------------------&lt;BR /&gt;/*! \brief Init GPIO&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Configuration used for the RD9Z1_638_12VLA_CAN_Demo:&amp;lt;/b&amp;gt;&lt;BR /&gt;&lt;BR /&gt;| Pin | Enabled | Direction | Routing | used for |&lt;BR /&gt;|:----------:|:--------:|:---------:|:-------:|------------------------------------|&lt;BR /&gt;| PTB0 | - | - | | analog input |&lt;BR /&gt;| PTB1 | disabled | n.a. | | not used |&lt;BR /&gt;| PTB2 | disabled | n.a. | | not used |&lt;BR /&gt;| PTB3 | disabled | n.a. | | not used |&lt;BR /&gt;| PTB4 | enabled | input | PTWU | CAN PHY wake up input |&lt;BR /&gt;| PTB5/GNDSW | - | - | - | GND switch for TSENSE_EXT |&lt;/P&gt;&lt;P&gt;*/&lt;BR /&gt;void GPIOInit(void) {&lt;/P&gt;&lt;P&gt;B_GPIO_CTL = GPIO_CTL_PTB1_DISABLE | GPIO_CTL_PTB1_INPUT;&lt;BR /&gt;B_GPIO_CTL = GPIO_CTL_PTB2_DISABLE | GPIO_CTL_PTB2_INPUT;&lt;BR /&gt;B_GPIO_CTL = GPIO_CTL_PTB3_DISABLE | GPIO_CTL_PTB3_INPUT;&lt;BR /&gt;&lt;BR /&gt;B_GPIO_PUC_PDE4 = 1; // enable pull down (missing on KT9Z1638EVM)&lt;BR /&gt;B_GPIO_CTL = GPIO_CTL_PTB4_ENABLE; // PTB4 is used for CAN Wakeup&lt;BR /&gt;B_GPIO_IN4 = IN4_PTWU|IN4_NWUE; // enable WU in low power mode, negative edge&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// ---------------------------------------------------------------------&lt;BR /&gt;/*! \brief&lt;BR /&gt;*&lt;BR /&gt;*/&lt;BR /&gt;void LTCInit(void) {&lt;BR /&gt;&lt;BR /&gt;B_LTC_CTL = B_LTC_CTL_LTCEM_MASK | B_LTC_CTL_LTCE_MASK; // LTC enable, no interrupt&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;interrupt VectorNumber_Vcan0wkup void isrCANWakeup(void) {&lt;/P&gt;&lt;P&gt;CAN_Wakeup(CAN0);&lt;BR /&gt;}&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;interrupt VectorNumber_Vcan0err void isrCANErr(void) {&lt;/P&gt;&lt;P&gt;CAN_ERR(CAN0);&lt;BR /&gt;}&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;interrupt VectorNumber_Vcan0tx void isrCANTx(void) {&lt;/P&gt;&lt;P&gt;CAN_Transmit(CAN0);&lt;BR /&gt;}&lt;BR /&gt;// --------------------------------------------------------------------&lt;BR /&gt;interrupt VectorNumber_Vcan0rx void isrCANRx(void) {&lt;/P&gt;&lt;P&gt;CAN_Receive(CAN0);&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 09:59:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Wakeup-problem-in-MM9Z1638/m-p/1405930#M18440</guid>
      <dc:creator>mbed_cool</dc:creator>
      <dc:date>2022-01-27T09:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Wakeup problem in MM9Z1638</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Wakeup-problem-in-MM9Z1638/m-p/1406513#M18449</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196262"&gt;@mbed_cool&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This is currently under a discussion here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-modes-in-MM9Z1638/td-p/1405922" target="_blank"&gt;https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-modes-in-MM9Z1638/td-p/1405922&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 09:06:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Wakeup-problem-in-MM9Z1638/m-p/1406513#M18449</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2022-01-28T09:06:21Z</dc:date>
    </item>
  </channel>
</rss>

