Page 1 of 1

[SOLVED]Hardwaretimer do not work on Maple Mini

Posted: Sun Jan 19, 2020 4:02 pm
by Ralf9
Hi,

I have test the code in this example:
https://github.com/stm32duino/STM32Exam ... llback.ino
The LED do not blink

Re: Hardwaretimer do not work on Maple Mini

Posted: Sun Jan 19, 2020 4:16 pm
by fpiSTM
You use the master of the library which has this change:
https://github.com/stm32duino/STM32Exam ... 0a3352f716

Use the last release then it should work with the last official release.
Or use the core repository which has the linked change.

Re: Hardwaretimer do not work on Maple Mini

Posted: Sun Jan 19, 2020 7:12 pm
by Ralf9
Thank you, when I insert this

Code: Select all

MyTim->setMode(2, TIMER_OUTPUT_COMPARE);
before

Code: Select all

MyTim->setOverflow(31*1000, MICROSEC_FORMAT);
then it works.


Is this needed

Code: Select all

#if defined(TIM1)
  TIM_TypeDef *Instance = TIM1;
#else
 TIM_TypeDef *Instance = TIM2;
#endif
Or can I on the Maple Mini always use

Code: Select all

TIM_TypeDef *Instance = TIM1;
and setMode with channel 2?