-
Board : STM32WLE5JB Software : Move-Xduino . Based on stm32duino 2.3.0 Settings : Arduino 2.0.2 ? , optimise : smallest+LTO Hello, I have an issue with the behavior of the timer with STM32WLE. I need to have a timer that start every time a specific GPIO is high. After this i enable a interrupt to an other GPIO and count the numbers of risings eges for 100 ms (timer). But all of this is managed with the chip on stop mode (mode 2 i think). And with my code sometimes the interrupt for the rising edge isn't working or the timer can't stop and the chip never goes in stop mode Here is my code
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @HamadyDIA,
So at best, timer can run in sleep mode, as it is optional, (it is configurable).
Are you talking about rising edge of the trigger (the one calling
I don't see in you code instruction to stop (pause) the timer (except a commented line). Can you clarify ? |
Beta Was this translation helpful? Give feedback.
-
Thanks you for your message (Question can we speak in french ?)
I have the LED attached to the callback of the timer that continue to blink even without signal coming from outside.
I have a PPK2 that mesure the current consumption and it stays at 6mA
With this fork made by move X the chip goes to sleep everytime it end a function. And is wakeup by the RTC. `void CALLBACK_TIM2(){ void INIT_TIMER_2(void) { void FREQUENCE_2(){ void SINGAL_SON(void) { attachInterrupt(digitalPinToInterrupt(FREQUENCE_PIN), FREQUENCE_2, RISING); With these modification the timer IRQ and all IRQ work but the chip stays in run mode. And if i add TIM2->pause() after the while(tim2==false) the timer IRQ don't work. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Ok, I am not aware of moveX fork, but AFAICS, due to while loop in SINGAL_SON()
this prevent chip to go in lowpower mode (sleep ? or stop?) during the 100ms of timer2, because function doesn't end. Also you initial talk about stop mode, but now you are talking about sleep mode. This is 2 different modes in STM32 chips, with different capabilities. Can you clarify ?
Well, my guess would be that timer works for a while until pause() is reached. |
Beta Was this translation helpful? Give feedback.
Ok, I am not aware of moveX fork, but AFAICS, due to while loop in SINGAL_SON()
this prevent chip to go in lowpower mode (sleep ? or stop?) during the 100ms of timer2, because function doesn't end.
And system goes to LowPower when
SINGAL_SON()
ends (after timer 2 elapse and while waiting for new trigger on 1st GPIO)Also you initial talk about stop mode, but now you are talking about sleep mode. This is 2 different modes in STM32 chips, with different capabilities. Can you clarify ?
Well, my guess woul…