Waking from STOP with CAN activity on HC908GZ60

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Waking from STOP with CAN activity on HC908GZ60

1,318件の閲覧回数
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 返信

671件の閲覧回数
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 件の賞賛
返信