Configuring can_onchip example for 500kbps

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by manishd on Fri Oct 07 09:53:10 MST 2011
I would like to configure the can_onchip example for a CAN bitrate of 500kbps instead of the 125kbps default. Can this be accomplished simply by changing the values in the ClkInitTable?

// 500kbps
uint32_t ClkInitTable[2] = {
  0x00000005UL, // CANCLKDIV 5
  0x00002301UL  // CAN_BTR 0x2301

//instead of 125kbps
uint32_t ClkInitTable[2] = {
  0x00000000UL, // CANCLKDIV 5
  0x00001C57UL  // CAN_BTR 0x2301

Calculating the bit time quanta seems a little :(