Waking from STOP with CAN activity on HC908GZ60

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Waking from STOP with CAN activity on HC908GZ60

997 Views
jlj
Contributor I
I am attempting to wake a 908GZ from STOp mode using CAN activity.
 
I can succesfully enter STOP mode and wakeup using the timebase module, but I've had no luck in waking on CAN.
 
The CAN is working fine (I'm receiving messages  while the CPU is running), but doesn't wake the CPU when in STOP mode.
 
In order to run 1Mb/sec CAN I'm clocking it with a PLL clock from CGMOUT. Does CAN have to run from the crystal clock to do wakeup? I have the oscillator enabled during STOP (so that I can use the timebase wakeup), but the PLL doesn't run in STOP.
 
Any advise gratefully received.....
 
 
Labels (1)
0 Kudos
Reply
1 Reply

350 Views
jlj
Contributor I
Ok, I worked it out.
 
CAN must be put into sleep mode before issuing the STOP, and the CAN wake interrupt enabled in order to wake from a STOP.
 
Putting CAN into sleep also had the bonus of shaving off a bit more power consumption during STOP.
 
To enter STOP mode:
CMCR0 |= SLPRQ;   //Request CAN sleep modewhile (!(CMCR0 & SLPAK)) {} //Wait for CAN to enter sleep modeCRIER |= WUPIE;  //Enable CAN wakeup interrupt_asm("stop\n");  //STOP
0 Kudos
Reply