2008-07-08 07:43 PM
Problem in CAN - ST10F276 - 2 parallel msgs
2008-07-03 12:41 AM
when I connect 2 masters to 1 slave (CANbus network), sometimes the slave miss a msg.
I think the CAN1IR shows the highest priority and miss the lower one. Does CAN1IR acts like a FIFO? what happen if when my interrput handles a msg, and in the mean while another msg arrives?2008-07-07 07:39 PM
Hello,
have you implement the CAN interrupt driver as described in AN2628?2008-07-08 07:43 PM
Hi Mirco.
recently I changed the Interrupt driver into: : while ( CAN1IP1 || CAN1IP2 || CAN1IR ) { . . // Check status interrupt . . if(CAN1IR & 0x8000) . . { . . . . ... . . } . . else . . { . . . . // Start over, maybe in while handling the interrupt another msg arrived? . . . . for (wMsgObjInt = 0; wMsgObjInt < 16 ; wMsgObjInt++) . . . . { . . . . . . if ((1 (shr) wMsgObjInt) & CAN1IP1) . . . . . . . . break; . . . . } . . . . if (wMsgObjInt == 16) . . . . { . . . . . . for (wMsgObjInt = 0; wMsgObjInt < 16 ; wMsgObjInt++) . . . . . . { . . . . . . . . if ((1 (shr) wMsgObjInt) & CAN1IP2) . . . . . . . . . . break; . . . . . . } . . . . . . wMsgObjInt += 16; . . . . } . . . . if (wMsgObjInt == 32) . . . . { . . . . . . //??? no Msg . . . . } . . . . else . . . . { . . . . . . wMsgObjInt++; . . . . . . // Msg arrived #wMsgObjInt . . . . . . // Do Interrput actions (remote/new data) . . . . . . .... . . . . . . // Clear the Msg . . . . . . CAN1IF1CM = 0x0008; . . . . . . CAN1IF1CR = wMsgObjInt; . . . . . . while (CAN1IF1CR & 0x8000); . . . . } . . } } will it do the job? thanks in advanced. ran