Waking from STOP with CAN activity on HC908GZ60

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Waking from STOP with CAN activity on HC908GZ60

1,285 次查看
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.....
 
 
标签 (1)
0 项奖励
回复
1 回复

638 次查看
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 项奖励
回复