Problem with Hardware Timer example on STM32L476RG.

Post Reply
Fabaum
Posts: 21
Joined: Tue Mar 17, 2020 4:10 pm

Problem with Hardware Timer example on STM32L476RG.

Post by Fabaum »

Hello friends,

I am trying unsuccessfully to test the Timebase_callback.ino example found at https://github.com/stm32duino/wiki/wiki ... er-library.
I just changed output D2 to PA5, which is Led1 on the board.
Unfortunately it didn't work, the led just doesn't flash ...
I found the topic viewtopic.php?f=62&t=222&p=1500&hilit=timer#p1500, where someone else had a similar problem, but he managed to solve it.
Does anyone have a suggestion on how to solve this?
by fpiSTM » Fri Mar 27, 2020 5:44 am
Which board you used?
As stas2z said you should use the latest release of the library to avoid issue.
Add the setMode like this
https://github.com/stm32duino/STM32Exam ... 0a3352f716
Go to full post

stas2z
Posts: 30
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 1

Re: Problem with Hardware Timer example on STM32L476RG.

Post by stas2z »

Use examples bundled with core
github examples are for newer unreleased yet core version and some things changed since 1.8 release

User avatar
fpiSTM
Posts: 271
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 5
Location: Le Mans
Contact:

Re: Problem with Hardware Timer example on STM32L476RG.

Post by fpiSTM »

Which board you used?
As stas2z said you should use the latest release of the library to avoid issue.
Add the setMode like this
https://github.com/stm32duino/STM32Exam ... 0a3352f716

Fabaum
Posts: 21
Joined: Tue Mar 17, 2020 4:10 pm

Re: Problem with Hardware Timer example on STM32L476RG.

Post by Fabaum »

Hello friends,

Thanks for the answers.
I'm using the STM32L476RG board.
The sample file I used initially is here: https://github.com/stm32duino/STM32Exam ... llback.ino
Then, I found the site https://www.arduinolibraries.info/libra ... o-examples, and downloaded all the examples.
I found the example Timebase_callback.ino (that works!) And then compared it with the example that was on github.
In the github example, a line of code was missing:

MyTim-> setMode (2, TIMER_OUTPUT_COMPARE);

Just as you indicated, fpiSTM!
Thank you all for your help!

Post Reply

Return to “STM32L4 based boards”