AnsweredAssumed Answered

SysTick timing problem

Question asked by adel.ahmed on Jun 1, 2013
Latest reply on Jun 1, 2013 by Clive One
the problem is when i make     Delay(1000);  it must delay 1second
but it make delay about 3second not 1second . it was 3time slower than the real time




volatile uint32_t msTicks;   

void SysTick_Handler(void) {
  msTicks++;
}



void Delay (uint32_t dlyTicks) {                                              
  uint32_t curTicks;
  curTicks = msTicks;
  while ((msTicks - curTicks) < dlyTicks);
}

SystemCoreClockUpdate();                      /* Get Core Clock Frequency   */
  if (SysTick_Config(SystemCoreClock / 1000)) { /* SysTick 1 msec interrupts  */
 while (1);                                  /* Capture error              */
  }

Outcomes