Create blocking delay in seconds

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Eshwar
Offline
Last seen:9 months 1 week ago
加入:2020-04-28 12:20
Create blocking delay in seconds

Hello,

I want to create a blocking delay in seconds during a function. I could have used an app_easy_timer but it doesn't solve my purpose. I have tried the code snippet from the timer0 delay example but the watchdog gets triggered after a few seconds. If the watchdog is disabled, still the program crashes when any type of software looped or timer delay is used. My requirement is restricted to blocking delay only. Any help is appreciated in this

Thanks

Keywords:
PM_Dialog
Offline
Last seen:1 day 6 hours ago
Staff
加入:2018-02-08 11:03
Hi Eshwar,

Hi Eshwar,

Thanks for your question. How many seconds should be the delay? If it is bigger than the WDOG expiration, that the WDOD mechanism will hit. According to DA14531 datasheet, the Watchdog Timer (8-bit timer with a sign bit) is used to detect an unexpected execution sequence caused by a software run-away and can generate a full system reset (WDOG reset) or a Non-Maskable Interrupt (NMI).

Thanks, PM_Dialog

Eshwar
Offline
Last seen:9 months 1 week ago
加入:2020-04-28 12:20
Hi,

Hi, Thanks for the reply. I wish to create 5 sec blocking delay, please suggest a way to do this

PM_Dialog
Offline
Last seen:1 day 6 hours ago
Staff
加入:2018-02-08 11:03
Hi Eshwar,

Hi Eshwar,

There is not any specific function for creating a 5 dec delay. You could use a for-loop in order to create a delay. However, please keep in mind that the CPU will be running and this prevents the system to sleep.

Thanks, PM_Dialog