AnsweredAssumed Answered

Timing problem with ADC_DelayMicroSecond(uint32_t microSecond)

Question asked by dvorak.peter on Sep 22, 2016
Latest reply on Sep 22, 2016 by dvorak.peter
This HAL code seems to run 12x slower then expected.

/**
  * @brief  Delay micro seconds 
  * @param  microSecond : delay
  * @retval None
  */
static void ADC_DelayMicroSecond(uint32_t microSecond)
{
  /* Compute number of CPU cycles to wait for */
  __IO uint32_t waitLoopIndex = (microSecond * (SystemCoreClock / 1000000U));


  while(waitLoopIndex != 0U)
  {
    waitLoopIndex--;
  } 
}


Peter

Outcomes