How to disable CAN module of the MPC5604B

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

How to disable CAN module of the MPC5604B

470 次查看
tanmingming
Contributor II

 Hello! I met a problem.When I run the following code, the program will always stuck in an infinite loop.

FLEXCAN(flexcanModule).MCR.R |= FLEXCAN_CANMCR_MDIS;

while((FLEXCAN(flexcanModule).MCR.R & FLEXCAN_CANMCR_LPMACK)==0)
{
//wdtIntFeed() ;
//The program is parked here
}

I think maybe there is something that make CAN can't be disable.As described in the datasheet below.

This low power mode is entered when the MDIS bit in the MCR is asserted. If the module is disabled
during Freeze Mode, it shuts down the clocks to the CPI and MBM submodules, sets the LPM_ACK bit
and negates the FRZ_ACK bit. If the module is disabled during transmission or reception, FlexCAN does
the following:
• Waits to be in either Idle or Bus Off state, or else waits for the third bit of Intermission and then
checks it to be recessive
• Waits for all internal activities like arbitration, matching, move-in and move-out to finish
• Ignores its Rx input pin and drives its Tx pin as recessive
• Shuts down the clocks to the CPI and MBM submodules
• Sets the NOT_RDY and LPM_ACK bits in MCR

So,what can I do to disable the CAN completely?thanks.

标签 (1)
0 项奖励
0 回复数