GetTick() and HAL_Delay(xxx);
When I give the delay time greater than 300 for the code below (500ms or 1000ms), GetTick or HAL_Delay(500); functions do not work.
If I make the time 100ms, 200ms or 300ms, it works.
When I want to control the delay at longer times, the program does not work.
Where should I look for the problem?
I am using STM32F030C6T6.
if(PA10_On==0)
{
Tick_PA10_On = HAL_GetTick();
PA10_On=1;
}
if ( PA10_On==1 &&(HAL_GetTick() - Tick_PA10_On) >= 300)
{
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_14);
PA10_On=0;
}For example, this code below does not work.
HAL_GPIO_WritePin(PA10_GPIO_Port,PA10_Pin,GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_WritePin(PB14_GPIO_Port,PB14_Pin,GPIO_PIN_RESET);
HAL_Delay(500);But this below code works.
HAL_GPIO_WritePin(PA10_GPIO_Port,PA10_Pin,GPIO_PIN_SET);
HAL_Delay(200);
HAL_GPIO_WritePin(PB14_GPIO_Port,PB14_Pin,GPIO_PIN_RESET);
HAL_Delay(200);Waits of 300ms and below work.
