Delay, multi milliseconds, on the STM32F0, again..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-12 10:51 AM - last edited on ‎2024-11-12 2:04 PM by Tesla DeLorean
where I wrote it among the codes.. // Here I have to wait 500ms.
Can you help me to prevent the timers from being affected by this wait?
Can you give me the codes that I will add. Because I am very confused..
I tried many things but they all stopped the interrupts..
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance==TIM1)
{
if(input1==0)
{
HAL_GPIO_WritePin(GPIOA, GPIO_Pin_1, GPIO_PIN_SET);
// Here I have to wait 500ms.
HAL_GPIO_WritePin(GPIOA, GPIO_Pin_1, GPIO_PIN_RESET);
}
}
Solved! Go to Solution.
- Labels:
-
STM32F0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-17 11:19 PM
@XooM wrote:I don't have a program in the while loop. My program is in timer1 and timer16. When I do what you said, it gives an error, so I added the file.
I did everything you said but the errors are not decreasing.
Could you please look at my project file? Please I am stuck and cannot proceed.
What error? Added what file? Explain in more detail.
If you're talking about the latest project you've uploaded, did you even look at my main.h file?
extern and #include are needed just like i have in my main.h which you need to add to your main.h
.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-17 11:23 PM
I added this to my previous file. I forgot to add it to the project I created from scratch called test3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-17 11:25 PM - edited ‎2024-11-18 8:21 AM
Bu dosyayı benimkine ekledim ve hala hata veriyor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-17 11:53 PM
when you added the prototypes, you didn't add the semi colon
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-17 11:56 PM
I've attached a project that uses your STM32F030C6 that compiles with no errors.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-18 12:39 AM - edited ‎2024-11-18 1:08 AM
PA10_off does not work after 1sec. PA10 "1" is always
It should be "0" after 1sec but timercallback does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-18 1:09 AM
Can you try it on your own board? It definitely doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-18 1:22 AM - edited ‎2024-11-18 1:25 AM
I have been trying to make a 500 ms delay since the first message I opened in the topic.
Unfortunately, I couldn't take any steps forward. It always blocked the mcu and timers.
TimerCallbackTimerStart(&timerCallback, PA10_Off, 500, TIMER_NO_REPEAT);
I was very hopeful about the function above.
PollingRoutine.c/h I will not use these files, my aim is to stop the pin I want after 500ms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-18 1:40 AM
If the PA10_off function was used after 1 second, it would be something to look for..
My aim was to make a PAx? that was active anywhere in my project passive after a period of 100 200 500ms... but it doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-18 8:12 AM
@XooM wrote:
PA10_off does not work after 1sec. PA10 "1" is always
It should be "0" after 1sec but timercallback does not work.
It's because you keep calling it in a while loop. Each time you call it, it resets the callback timer.
Look at my signature and watch the video
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
