AnsweredAssumed Answered

STM32F103: HIGHER BAUD RATE FOR USART1

Question asked by baris.savas.001 on Apr 13, 2014
Latest reply on Apr 14, 2014 by baris.savas.001
Hi all,
I have problem about setting baud rate of USART1 to 3200000 or 3686400 or 4000000. To be able to setthe higher baudrates, I revised my RCC_Configuration() as:

ErrorStatus           HSEStartUpStatus;

  /* RCC system reset(for debug purpose) */
  RCC_DeInit();


  /* Enable HSE */
  RCC_HSEConfig(RCC_HSE_ON);


  /* Wait till HSE is ready */
  HSEStartUpStatus = RCC_WaitForHSEStartUp();


  if(HSEStartUpStatus == SUCCESS)
  {
         // HCLK = SYSCLK 
       RCC_HCLKConfig(RCC_SYSCLK_Div1); 
  
     RCC_PCLK2Config(RCC_HCLK_Div1);
     RCC_PCLK1Config(RCC_HCLK_Div1);

    FLASH_SetLatency(FLASH_Latency_2);
    FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);


    // PLLCLK = 8MHz * 9 = 72 MHz 
    RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);


    RCC_PLLCmd(ENABLE);

    while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
    {
    }

    // Select PLL as system clock source
    RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);


    // Wait till PLL is used as system clock source 
    while(RCC_GetSYSCLKSource() != 0x08)
    {
    }
    
  }   


      RCC_AHBPeriphClockCmd (     RCC_AHBPeriph_DMA1     ,      ENABLE);
       RCC_APB2PeriphClockCmd(     RCC_APB2Periph_ALL  ,      ENABLE);
       RCC_APB1PeriphClockCmd(     RCC_APB1Periph_ALL     ,     ENABLE);



This code works fine with baudrate=921600. But if I set the baudrate to 3200000 or higher,doesn't work properly.
Pls help me if I have any mistake.
Thanks

Outcomes