Toggle multiple pins (LEDs) using one IT timer STM32

Thread Starter

ARZ

Joined Apr 29, 2020
3
Hi. I'm very new to STM32 so please pardon me if it sound dumb...
I want to toggle multiple pins with different delays using only one interrupt timer (like TIM10)
somthing like this:
LED 1 (PB0) : Toggle every 1 s
LED 2 (PB7) : Toggle every 500 ms
LED 3 (PB14) : Toggle every 200 ms
CLK Freq. is 16 MHz
STM32F746ZGTx

I suspect using switch in the Callback function but I'm not really sure...
 

MrChips

Joined Oct 2, 2009
21,091
Welcome to AAC!

Are you using an ST development board? Which one?
CLK freq is 16MHz. Is this the crystal frequency of the internal HSI RC frequency?
What is the actual SYSCLK? This can run as high as 200MHz.
What software platform are you using?
Show us the code you have written so far.
 

Thread Starter

ARZ

Joined Apr 29, 2020
3
I said it! its an Nucleo STM32F746ZG
I meant SYSCLK is 16 MHz (its default parameters in CubeMX, did change nothing)
I wrote this for the interrupt but idk if it works since i don't have the board atm
in the rest of code I just added a TIM_Base_Start_IT command after TIM10_init...
TIM10 active Prescaler 15999 Period 99
02.1.JPG
if there's a better way to code please do tell...
 
Last edited:

MrChips

Joined Oct 2, 2009
21,091
I said it! its an Nucleo STM32F746ZG
I meant SYSCLK is 16 MHz (its default parameters in CubeMX, did change nothing)
No, you did not.
STM32F746ZG is the chip number.
Nucleo is a board.

SYSCLK at 16MHz is so slow when the STM32 could be running at 180MHz.
Check again.
 
Top