Hi there, I have problems setting up the two CAN ports on the MCBSTM32C demo board. I got them to work in loopback mode but in normal mode the INAK bit doesn't set itself to 0.
In the manual it says that the hardware has to monitor 11 consecutive recessive bits to initialise. How to you sent the bits to the port if none of the CAN ports are working? Do I have to set up CAN1 in loopback mode, send 11 bits to CAN2, switch CAN1 to normal mode and then use CAN2 to send 11 bits to CAN1?
The other possibility might be that I didn't set up the CAN ports correctly. Has anybody got an example how to set up the clocks and all the other registers to make CAN1 and CAN2 work?
Thanks, Karsten
I can think of two reasons why clearing of the bit is not happening:
1. These 11 bits are not received for some reason 2. Something is wrong with the hardware set up
So, enough with the thinking: get measuring! Get out your oscilloscope and check what's on your RX pin. Is your CAN transceiver even enabled? What's the actual state of the RX line (from transceiver to CPU)?
Is there any other CAN device on that CAN bus in this case? Is the bus properly terminated, i.e. does it have recessive state while no device is transmitting?
Problem solved. The set up of the Rx pin was causing the problem. It is working if the Rx pin is configured as a floating input. I had it configured as an input with pull down.
Nothing special is required for the synchronisation. It just looks for an idle bus before switching from initialisation mode to normal mode.