2024-11-17 06:02 AM - edited 2024-11-19 02:37 AM
I haven't been able to wait 500ms without affecting the timers for 7 days.
In this block, doesn't PB14 become "0" after 500ms?
Even if I use comment lines, it doesn't work.
Note: volatile uint32_t Counter = 0;
The "Counter" variable is incremented every 1ms with Timer16.
** STM32F030C6T6 I'm using.
** Own PCB board..
*** Note: Card of a working system.. There is no card design error.
if(htim->Instance==TIM16)
{
Counter++;
if(HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13)==0)
{
if(HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_2)==0)
{
if(PA10_On==0)
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12,GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14,GPIO_PIN_SET);
Counter=0;
PA10_On=1;
// Tick_PA10_On= HAL_GetTick();
// PA10_On=1;
}
else
{
if(Counter>500) // if((HAL_GetTick()-Tick_PA10_On)>=500)
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14,GPIO_PIN_RESET);
Counter=501;
}
}
}
else
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12,GPIO_PIN_SET);
}
}
else
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12,GPIO_PIN_RESET);
}
}
Solved! Go to Solution.
2024-11-19 02:38 AM
I think the problem is that the Hal_delay function is not working. But I still haven't found the solution.
2024-11-19 02:46 AM
@XooM wrote:I think the problem is that the Hal_delay function is not working. But I still haven't found the solution.
If you tell me your board, MCU and STM32CubeMX version I can check. Hal_delay works perfectly fine in my projects. I cannot replicate your situation if I don't know the details.
2024-11-19 02:49 AM
STM32F030C6T6 i'm using.
I am not using ST board.
A custom designed PCB..
Removed from a working machine..
I can't write code because I got stuck while reprogramming.
2024-11-19 03:00 AM
@XooM wrote:I can't write code because I got stuck while reprogramming.
You cannot FLASH the MCU? What programmer are you using? And at what bitrate?
@XooM wrote:
The program is starting to go crazy.
Can you clarify?
2024-11-19 03:04 AM
Hayır, programlayabilirim. Şimdi sıkışıp kaldım çünkü kızgınım.
ST-LINK V2 orijinal.
2024-11-19 03:10 AM
Does your board contain an LED?
Have you tried to make a blinky?
Can you send your ioc file?
2024-11-19 03:13 AM
2024-11-19 03:28 AM - edited 2024-11-19 03:28 AM
PA10 is SET but not RESET. It remains stuck in the SET position.
2024-11-19 03:39 AM
Please give pins functional names. It makes it easier to use it in code using the generated defines in main.h:
#define YOURPINNAME_Pin GPIO_PIN_14
#define YOURPINNAME_GPIO_Port GPIOB
I noticed pin PINB12 and PINC13 referenced in your start post are missing in the configuration. Please configure all iopins
2024-11-19 03:41 AM - edited 2024-11-19 03:41 AM
I'll take care of them, so why isn't Hal_delay working?
My problem is exactly that the hal_delay function isn't working.
I didn't care about the names because I was writing a test program.