I asked:
> You should tell us the exact hex number that you're writing to CANCTRL
You haven't done that. Instead:
MCF_FlexCAN_CANCTRL |= MCF_FlexCAN_CANCTRL_PRESDIV(5)|
MCF_FlexCAN_CANCTRL_RJW(3)|
MCF_FlexCAN_CANCTRL_PSEG1(4)|
MCF_FlexCAN_CANCTRL_PSEG2(3)|
MCF_FlexCAN_CANCTRL_PROPSEG(5);
I don't know what CLK_SRC you're using because you've commented out that line.
I have no idea what value you're writing into that register as you're OR-ing the above into whatever was previously in that register.
Which from the results you've been getting, wasn't zero to start with.
If you want to set the register to the above values then get rid of the "|=" or show all the code back to the first one that uses "=" to set the entire register.
Also, since you didn't include the macro sources, I have no idea what those macros are doing. They may be taking raw register bit values or they may be taking the "add one" values. I'm not using the same development environment or compiler that you are. I can't read your header files.
You should find a way to READ the register and then print it out in hex somewhere, or simply examine it in the debugger. Then use the Reference Manual to decode it to see if it is what you want.
(Edit) Explaining what I mean about the macros, the ones I'm using date from 2004, and define the PSEG fields this way:
#define MCF_CAN_CANCTRL_PROPSEG(x) (((x)&0x00000007)<<0)
#define MCF_CAN_CANCTRL_LOM (0x00000008)
#define MCF_CAN_CANCTRL_LBUF (0x00000010)
#define MCF_CAN_CANCTRL_TSYNC (0x00000020)
#define MCF_CAN_CANCTRL_BOFFREC (0x00000040)
#define MCF_CAN_CANCTRL_SAMP (0x00000080)
#define MCF_CAN_CANCTRL_LPB (0x00001000)
#define MCF_CAN_CANCTRL_CLKSRC (0x00002000)
#define MCF_CAN_CANCTRL_ERRMSK (0x00004000)
#define MCF_CAN_CANCTRL_BOFFMSK (0x00008000)
#define MCF_CAN_CANCTRL_PSEG2(x) (((x)&0x00000007)<<16)
#define MCF_CAN_CANCTRL_PSEG1(x) (((x)&0x00000007)<<19)
#define MCF_CAN_CANCTRL_RJW(x) (((x)&0x00000003)<<22)
#define MCF_CAN_CANCTRL_PRESDIV(x) (((x)&0x000000FF)<<24)
These macros abstract the raw bitfields. But to set PSEG1 to 4 bits, you still have to write "3" in that macro. A different programmer might have thought to make this easier by defining the macros this way:
#define MCF_CAN_CANCTRL_PROPSEG(x) ((((x)-1)&0x00000007)<<0)
#define MCF_CAN_CANCTRL_PSEG2(x) ((((x)-1)&0x00000007)<<16)
#define MCF_CAN_CANCTRL_PSEG1(x) ((((x)-1)&0x00000007)<<19)
#define MCF_CAN_CANCTRL_RJW(x) ((((x)-1)&0x00000003)<<22)
That would have allowed you to use the numbers "6, 5, 4" to get field values "5, 4, 3" which would result in time quanta of "6, 5, 4" adding up to 16 (with the Sync bit) as you want. But unless there's documentation saying which method the programmer followed, you have to look at the macros to be sure it is correct. Luckily you got that bit right.
Tom