Hello,
We are trying to wakeup the LPC1765 controller using CAN activity. We have followed application note to wakeup on CAN http://www.strong-ic.com/upload/1336635046_461.pdf
We are using MCU expresso IDE for our development. As per our observation the device wakes up upon gpio interrupt but does not wakeup on CAN if any CAN packet is sent using PCAN analyzer on the bus. We are able to receive data on CAN RX pin verified using oscilloscope. Still the controller does not wakeup ? Can you please help us if we are missing anything? As per datasheet, the device should wakeup on CAN activity.
Below is the sample code that we are using to wakeup on CAN. We are using both CAN 1 and CAN2.
Code running in main.c :-
/* Enable the receive interrupt*/
Chip_CAN_EnableInt(LPC_CAN, CAN_IER_RIE | CAN_IER_WUIE);
LPC_CAN1->MOD |= (1 << 4); //SM bit is set
LPC_CAN2->MOD |= (1 << 4); //SM bit is set
Chip_PMU_DeepSleepState(LPC_PMU);
ISR routine :-
void CANActivity_IRQHandler(void)
{
ToggleGSMLed();
LPC_SYSCTL->CANSLEEPCLR = ( 1 << 1 ) | (1 << 2);
LPC_CAN1->MOD &= -(1 << 4);
LPC_CAN2->MOD &= -(1 << 4);
LPC_SYSCTL->CANWAKEFLAGS = ( 1 << 1 ) | (1 << 2);
//printf("CAN wakeup\r\n");
return;
}
Can you please find a solution and let us know the actual issue of wakeup? Waiting for your reply.
Thanks,
Sanja Sameer