AnsweredAssumed Answered

MPC5606 Wake-Up with CAN Sampler

Question asked by cafer dogan on Jul 28, 2017

My device have MPC5606 PowerPC microcontroller.

I achieved, the device to sleep .

But it didnt wake-up from CAN sampler. It look like wake-up  but not wake-up fully.

i have sleep current 700uA, i try to wake-up and it goes to 14mA. But it must be 100mA and CAN communication must run.

 

My Wake-Up Configurations:

//WKPU init
WKUP.WIPUER.R = 0x1FFFFFFF; //enable weak pull up resistors on all WKUP pins
WKUP.WIFER.R = 0x00000000; //glitch filter disabled
WKUP.WIFEER.R = 0x00000010; //enable falling edge event on WKPU[4] - CAN0RX pin
WKUP.IRER.R = 0x00000000; //interrupts disabled
WKUP.WRER.R = 0x00000010; //wake up enable on WKPU[4] - CAN0RX pin

// CAN sampler init
//Initialization of CAN Sampler with IRC = 16MHz
//8 samples/bit if CAN = 100Kbps: prescaler = 16MHz/8/100K = 20 = 0x14
CANSP.CR.B.BRP = 0x14 - 1;
CANSP.CR.B.CAN_RX_SEL = 0x0; //CAN0RX is selected
CANSP.CR.B.MODE = 0x1; //Sample & store the 1st frame

//Start CAN Sampler
CANSP.CR.B.CAN_SMPLR_EN = 0x1; //CAN sampler enabled

 

 

 

My Sleep-Init Codes:

 

ME.MER.R = 0x0000248D; //Enable RUN3, STANDBY, STOP, DRUN, other modes
ME.DRUN.R = 0x001F0010; //DRUN cfg: 16MHIRCON=1, syclk=16 MHz FIRC
ME.RUN[3].R = 0x001F0010; //RUN3 cfg: 16MHIRCON=1, syclk=16 MHz FIRC
ME.STOP0.R = 0x0005000F; //56xxB STOP: FIRCON=0, MVRON=0, flash LP, no sysclk
ME.STANDBY0.R = 0x0085000F; //56xxB STANDBY cfg: FIRCON = 0
ME.RUNPC[7].R = 0x00000088; //Run Peri. Cfg 7 settings: run in DRUN, RUN3 modes
ME.LPPC[7].R = 0x00000400; //LP Peri. Cfg. 7 settings: run in STOP
ME.PCTL[68].R = 0x3F; //MPC56xxB/S SIU: select ME.RUNPC[7], ME.LPPC[7]
ME.PCTL[69].R = 0x3F; //MPC56xxB/S WKPU: select ME.RUNPC[7], ME.LPPC[7]
ME.PCTL[91].R = 0x3F; //MPC56xxB/S RTC/API: select ME.RUNPC[7], ME.LPPC[7]

while (ME.GS.B.S_MTRANS) {} //Ensure any STANDBY to DRUN mode transition completed
ME.MCTL.R = 0x70005AF0; //Enter RUN3 Mode & Key
ME.MCTL.R = 0x7000A50F; //Enter RUN3 Mode & Inverted Key
while (ME.GS.B.S_MTRANS) {} //Wait for RUN3 mode transition to complete
//Note: could wait here using timer and/or I_TC IRQ
while(ME.GS.B.S_CURRENTMODE != 7) {} //Verify RUN3 (0x7) is the current mode

/* Enter STOP mode */
ME.MCTL.R = 0xD0005AF0; //Enter STOP Mode & Key
ME.MCTL.R = 0xD000A50F; //Enter STOP Mode & Inverted Key
while (ME.GS.B.S_MTRANS){}; //Wait for mode transition to complete

 

 

My Wake-Up Codes:

 

while(!CANSP.CR.B.RX_COMPLETE){}; //Wait until frame stored in sample registers
CANSP.CR.B.CAN_SMPLR_EN = 0x0; //CAN sampler disabled

Init_All_Hardware();

Init_All_Clocks();

 

 

 

Are there any fault at my codes?

Outcomes