Timer alarm triggers at wrong value

apurva
Posts: 6
Joined: Tue Oct 08, 2019 2:47 pm

Timer alarm triggers at wrong value

Postby apurva » Thu Nov 28, 2019 8:49 pm

Hello! I am using one of the hardware timers and want the alarm to ring after 15mins. I have enabled autoreload and the timer counts up from 0. However, after just 40 seconds, the alarm is triggered and the counter value is reset back to 0. I am not able to figure out why the alarm triggers after 40s when it should only trigger after 900s. I have followed the example code and I have checked multiple times to make sure it is correct. Any help would be appreciated.

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

Re: Timer alarm triggers at wrong value

Postby mikemoy » Fri Nov 29, 2019 2:54 pm

Why haven't you posted your code. How can we help if no one here has a clue what you have done, or what example you are trying to use.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Timer alarm triggers at wrong value

Postby WiFive » Sat Nov 30, 2019 8:06 am

Because you are not forcing a 64-bit value. 900sec (ticks) truncated to 32-bits is 41sec.

Who is online

Users browsing this forum: Bing [Bot] and 94 guests