Re: CAN system's problem with 3 nodes
|
||||
---|---|---|---|---|
版主
|
if ( CANIsRxReady( ) )
{ CANReceiveMessage (&RX_ID1.Slave_ID1,RX_Data_Buf1,&RX_Data_Len1,&RX_Message_Flag) ; : : } Please add the CANIsRxReady( ) for checking the CAN receiver message polling.
發表於: 2005/3/18 13:55
|
|||
|
Re: CAN system's problem with 3 nodes
|
||||
---|---|---|---|---|
初級會員
|
Anymore,neither node1 nor node2 can receive the message with ID 0X220 from node3,and node1 to node3 usually reset much times when start,then they can work for a little long time.why?
發表於: 2005/3/18 13:23
|
|||
|
Re: CAN system's problem with 3 nodes
|
||||
---|---|---|---|---|
初級會員
|
No,node3 does nothing but waits to receive the message,I think busy is unreasonable .
發表於: 2005/3/18 13:16
|
|||
|
Re: CAN system's problem with 3 nodes
|
||||
---|---|---|---|---|
資深會員
|
我猜你的 node3 太忙碌了,以致於來不及去收 buffer上的資料
發表於: 2005/3/18 11:43
|
|||
|
CAN system's problem with 3 nodes
|
||||
---|---|---|---|---|
初級會員
|
I developed a CAN system with 3 nodes(node1,node2,node3),using 18F458 and Philips PCA82C250,the Oscillator is 10M,the bus rate is about 80K,the node2 send out message with ID 0x218,I hope both the node1 and node3 can receive the message in time,however only the node1 does this,the node3 can only receive the message from time to time,the delay is so obvious.I set the 3 nodes’ message mask and filter as follows:
Node1: ……… CANSetOperationMode(CAN_OP_MODE_CONFIG) ; CANSetMask(CAN_MASK_B1, 0x07ff, CAN_CONFIG_STD_MSG ) ; CANSetMask(CAN_MASK_B2, 0x07ff, CAN_CONFIG_STD_MSG ) ; CANSetFilter(CAN_FILTER_B1_F1, 0x0220 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B1_F2, 0x0218 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F1, 0x0210 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F2, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F3, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F4, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetOperationMode(CAN_OP_MODE_NORMAL) ; ……… While(1) { CANReceiveMessage(….); } ………………………. Node2: ……… CANSetOperationMode(CAN_OP_MODE_CONFIG) ; CANSetMask(CAN_MASK_B1, 0x07ff, CAN_CONFIG_STD_MSG ) ; CANSetMask(CAN_MASK_B2, 0x07ff, CAN_CONFIG_STD_MSG ) ; CANSetFilter(CAN_FILTER_B1_F1, 0x0018 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B1_F2, 0x0220 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F1, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F2, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F3, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F4, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetOperationMode(CAN_OP_MODE_NORMAL) ; ……… While(1) { ………….. CANSendMessage( 0x218,TX_Data_Buf1,TX_Data_Len1, CAN_TX_PRIORITY_0 & CAN_TX_STD_FRAME & CAN_TX_RTR_FRAME ) ; ………….. } ………………………. Node3: ……… CANSetOperationMode(CAN_OP_MODE_CONFIG) ; CANSetMask(CAN_MASK_B1, 0x07ff, CAN_CONFIG_STD_MSG ) ; CANSetMask(CAN_MASK_B2, 0x07ff, CAN_CONFIG_STD_MSG ) ; CANSetFilter(CAN_FILTER_B1_F1, 0x0218 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B1_F2, 0x0020 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F1, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F2, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F3, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetFilter(CAN_FILTER_B2_F4, 0x0000 , CAN_CONFIG_STD_MSG) ; CANSetOperationMode(CAN_OP_MODE_NORMAL) ; ……… While(1) { CANReceiveMessage(….); } ………………………. I donnot know where the problem is.
發表於: 2005/3/17 23:52
|
|||
|