Posted on July 04, 2012 at 18:16
#include ''ll_can.h''
#include ''rcc.h''
#include ''gpio.h''
#include ''nvic.h''
#include ''usb.h''
int can_init(int mode)
{
rcc_clk_enable(RCC_GPIOB); //enable GPIO port B
rcc_clk_enable(RCC_AFIO); //enab...
Posted on July 10, 2012 at 18:54I have managed to get the controller to switch back to normal mode, by playing with the baud rates. I am now working on transmitting data in loopback mode and I have a few more questions :) >In loopback mode do I need...
Posted on July 06, 2012 at 11:59Thanks, I'll check it against what I have already. I thought of another possible reason the hardware is not changing the INAK bit - it might be because there are interrupt conflicts between the USB and CAN bus. Does t...
Posted on July 05, 2012 at 16:33I'm using the Maple IDE which has its own versions of many of the libraries, but they haven't got a CAN library yet and a lot of the CAN stuff is unfinished (e.g. functions which are prototyped but with no actual bodi...
Posted on July 05, 2012 at 15:56
So now I can actually initialise the bus, but I can't get out of init mode! When I clear INRQ in CAN_MCR the INAK bit in CAN_MSR does not clear. From looking around on the internet this appears to be the result o...
Posted on July 04, 2012 at 19:56yup, that's the ''set up of baud rate..'' comment at the end :) After the clocks have been enabled I enable the NVIC interrupts, then set FIFO0 and 1 empty interrupt bits, TX MB empty interrupt bit, wake up interrupt ...