AnsweredAssumed Answered

STM32F446RE CAN 1Mbps

Question asked by park.hj.001 on Aug 25, 2016
Latest reply on Aug 29, 2016 by park.hj.001
Hi Guys,

I tested CAN1(GPIOA_11 and 12) on Nucleo-F446RE with std lib 1.7 and successfully run Tx/Rx on 500Kbps and 250kbps. but, it is strange that 1Mbps is not working.
Please review my setting below and let me know if there is something wrong.
 

 if(bRate == CAN_1Mbps) //not working
  {
  CAN_InitStructure.CAN_SJW = CAN_SJW_1tq;
  CAN_InitStructure.CAN_BS1 = CAN_BS1_1tq;
  CAN_InitStructure.CAN_BS2 = CAN_BS2_3tq;
  CAN_InitStructure.CAN_Prescaler = 9;
  }else if(bRate == CAN_500Kbps ){ //working
  CAN_InitStructure.CAN_SJW = CAN_SJW_1tq;
  CAN_InitStructure.CAN_BS1 = CAN_BS1_2tq;
  CAN_InitStructure.CAN_BS2 = CAN_BS2_3tq;
  CAN_InitStructure.CAN_Prescaler = 15;
  }else if(bRate == CAN_250Kbps ) { //working
   CAN_InitStructure.CAN_SJW = CAN_SJW_1tq;
   CAN_InitStructure.CAN_BS1 = CAN_BS1_2tq;
   CAN_InitStructure.CAN_BS2 = CAN_BS2_3tq;
   CAN_InitStructure.CAN_Prescaler = 30;
  }

here is my clock configuration..

*=============================================================================
  *                         Supported STM32F446xx devices
  *-----------------------------------------------------------------------------
  *        System Clock source                    | PLL (HSE)
  *-----------------------------------------------------------------------------
  *        SYSCLK(Hz)                             | 180000000
  *-----------------------------------------------------------------------------
  *        HCLK(Hz)                               | 180000000
  *-----------------------------------------------------------------------------
  *        AHB Prescaler                          | 1
  *-----------------------------------------------------------------------------
  *        APB1 Prescaler                         | 4
  *-----------------------------------------------------------------------------
  *        APB2 Prescaler                         | 2
  *-----------------------------------------------------------------------------
  *        HSE Frequency(Hz)                      | 8000000
  *-----------------------------------------------------------------------------
  *        PLL_M                                  | 8
  *-----------------------------------------------------------------------------
  *        PLL_N                                  | 360
  *-----------------------------------------------------------------------------
  *        PLL_P                                  | 2
  *-----------------------------------------------------------------------------
  *        PLL_Q                                  | 7
  *-----------------------------------------------------------------------------
thanks..

Outcomes