// If MSCAN peripheral is not in Initialization Mode, enables the Inizialization Mode Request
if(!(CANCTL1&CANCTL1_INITAK_MASK))
{
CANCTL0 = CANCTL0_INITRQ_MASK;
while(!(CANCTL1&CANCTL1_INITAK_MASK))
;
}
// Enables MSCAN peripheral and chooses Oscillator Clock, Loop Disabled and Normal Operation
CANCTL1 = 0x80;
// Restarts MSCAN peripheral and waits for Initialization Mode exit
CANCTL0 = 0x00;
while(CANCTL1&CANCTL1_INITAK_MASK)
;
// Waits for MSCAN synchronization with the CAN bus
while(!(CANCTL0&CANCTL0_SYNCH_MASK))
;
}
这是我的初始化程序,两个节点一样。我想获得125K的波特率,不知道这样设置行吗?作者: Kelvin 时间: 2007-10-22 20:06