Not applicable
Jul 17, 2016
11:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 17, 2016
11:29 PM
Hi Sir/Madam,
i am working on xmc4200. inside main() after clock configuration i am initialising the can module, and i am successfully communicate with can based devices. Now as per Requirement
in my project requirement i need to reset the CAN module, and again need to reinitialise the can module and communicate with device.
for reset can module i was done like below
PRCLR1 |= 0x00000010;
PRSET1 |= 0x00000010;
RSTCLR |= 0x01;
by doing the above procedure i can able to reset the can module i.e., all the CAN register are turned into 0xFFFFFFFF (Observed in Keil).
now if i am trying to reinitialize the CAN then it is not able initialize. should i had missed any thing else in resetting the module?
Thanks and regards,
Harshan.
i am working on xmc4200. inside main() after clock configuration i am initialising the can module, and i am successfully communicate with can based devices. Now as per Requirement
in my project requirement i need to reset the CAN module, and again need to reinitialise the can module and communicate with device.
for reset can module i was done like below
PRCLR1 |= 0x00000010;
PRSET1 |= 0x00000010;
RSTCLR |= 0x01;
by doing the above procedure i can able to reset the can module i.e., all the CAN register are turned into 0xFFFFFFFF (Observed in Keil).
now if i am trying to reinitialize the CAN then it is not able initialize. should i had missed any thing else in resetting the module?
Thanks and regards,
Harshan.
Labels
2 Replies
Jul 20, 2016
02:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 20, 2016
02:18 AM
So, I tried to replicate your issue and in my case, I don´t have any problems with re-initialization of the CAN module. After initialization, I added 3 lines of code that you mentioned in your post to reset the CAN module. Immediately after, I called the "XMC_CAN_Enable()" function (I guess you don´t need even to use whole functionality of this function, CAN module is enabled by line "obj->CLC &= ~(uint32_t)CAN_CLC_DISR_Msk;"). Can you please try to re-initialize the CAN module with this function? Or maybe I understood your post wrongly :). Then please, provide me with some additional information.
Not applicable
Jul 24, 2016
09:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 24, 2016
09:26 PM
Hi Drubesa,
Thanks for Reply, The Problem was resolved actually there is one flag which i was not enabled in my code.
Thanks and Regards,
Harshan
Thanks for Reply, The Problem was resolved actually there is one flag which i was not enabled in my code.
Thanks and Regards,
Harshan