2012-12-17 02:38 AM
Hi,
Can anybody help me to set up(source code C) CAN id interrupt for STM32F10XX CPU. BR Willy2012-12-18 10:42 AM
What do you mean by CAN id interrupt? You can adjust FILTERS to receive or decline frames with IDs you need or you can check ID after receiving frame (without filtering) manually - for example in CAN interrupt handler... If that's what you need I can show you my code
2012-12-19 12:06 AM
I meant that if I set up filters to get a interrupt then I got a speciell frame with my ID.
Have done that with other CPU but I dont knowe howe to set up register for STM32F103XX. Would be nice if I can see your code.2012-12-19 12:22 PM
Actually I don't use CAN Filter id to identify message - only to accept or deny frames I need and then I deal only with CAN Frame ID...
For example I used that code to adjust filter to receive only frames with ID starting with 1: CAN_FilterInitStructure.CAN_FilterNumber = 0; CAN_FilterInitStructure.CAN_FilterMode = CAN_FilterMode_IdMask; CAN_FilterInitStructure.CAN_FilterScale = CAN_FilterScale_32bit; CAN_FilterInitStructure.CAN_FilterIdHigh = 0xFFFF; CAN_FilterInitStructure.CAN_FilterIdLow = 0x0000; CAN_FilterInitStructure.CAN_FilterMaskIdHigh = 0x8000; CAN_FilterInitStructure.CAN_FilterMaskIdLow = 0x0000; CAN_FilterInitStructure.CAN_FilterFIFOAssignment = 0; CAN_FilterInitStructure.CAN_FilterActivation = ENABLE; CAN_FilterInit(&CAN_FilterInitStructure);