2020-10-07 02:40 AM
Hello
I have used Nucleo-L031K6 dev kit.
How can I generate timer interrupt for 100 sec/500 sec delay?
2020-10-07 07:00 AM
If the period is too long for a single timer, you can cascade two timers in a master/slave fashion. Alternatives are more frequent interrupts and a software counter in the interrupt handler or using the RTC.
hth
KnarfB
2020-10-07 11:39 AM
+1
RTC Alarm
2020-10-07 01:34 PM
Clock your used timer with slow clock and use prescalers, example clk 8MHz prescaler 65534 use 16bit counter to time 100s
but i dont cleanly understand your question. You need delay or repeated interrupt or wake from low power...
2020-10-07 07:42 PM
Thanks KnarfB and clive1 for your update.
Can please give some sample code or hint like how can I calculate or configuration?
2020-10-07 07:45 PM
Thanks MM for your update.
Actually I want to generate timer interrupt. Ex : Require timer interrupt means after 5 min generate interrupt and device enter in to the sleep mode [low power mode].
How can I configure counter parameter setting for timer interrupt?
Can you please give some example how can I configure?
2020-10-07 07:49 PM
STM32Cube_FW_L0_V1.11.2\Projects\NUCLEO-L031K6\Examples\RTC\RTC_Alarm
'
RTC usually count in seconds,
Read the RTC chapter, it has TWO alarms. pick your time(s) into the future
2020-10-07 08:01 PM
Thanks clive1 for your input.
Is it possible using TIM1/TIM2 [general purpose timer]?
2020-10-07 08:52 PM
(65536 * 65536) / 32,000,000 = 134.217728 seconds, maximal
Depends on what speed you're clocking at, you could interrupt at seconds, and count those elapsing
100 seconds, 100 * 32,000,000 / 64000 = 50000
Prescaler = 64000-1
Period = 50000 - 1
2020-10-07 09:53 PM