Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to configure STM32 timer for LED flashing

Status
Not open for further replies.

jab99407

Member
Hi.. I want to blink an led using a timer interrupt.

I open Device Configuration Tool
Next, I go to PD12 pin and select TIM4_CH1 option.
Now I go TIM4 timer mode and configuration

Clock Source: Internal Clock

What timer configuration are required to flash LED for 1 seconds or What timer configuration are required to generate 1ms timer interrupt ?
 

Attachments

  • STM32 Timer.jpg
    STM32 Timer.jpg
    184.8 KB · Views: 542
Why are you using a 32 bit processor to flash an LED? You seem to have the starting objective, flash an LED, on a Formula 1 microprocessor.

I suggest you start somewhere simpler.

Mike.
 
Why are you using a 32 bit processor to flash an LED? You seem to have the starting objective, flash an LED, on a Formula 1 microprocessor.

I suggest you start somewhere simpler.

Mike.
I don't think there is anything simpler than LED. I wrote LED blinking code using software delay. Now just want to generate timer interrupt for 1ms I would toggle LED when I would count 1000 interrupt for 1 seconds. That's why I want to configure to generate 1ms. I don't understand which option should be select for 1ms in timer mode
 
Starting on such a powerful processor is not necessary unless your intention is to learn that particular processor, however learning a simpler one first would be advised. If your intention is to learn to program then I suggest starting with something like an Arduino Nano.

Mike.
 
Starting on such a powerful processor is not necessary unless your intention is to learn that particular processor, however learning a simpler one first would be advised. If your intention is to learn to program then I suggest starting with something like an Arduino Nano.

Mike.
I have knowledge of PIC microcontroller and I want to learn ARM processor.
 
I have knowledge of PIC microcontroller and I want to learn ARM processor.
I assumed one of two reasons - either this is part of a bigger project or you're learning to use ARM.
It's never helpful for someone to raise objections to your project or question your aims without knowing why you're doing it. The only way to stop people doing that is to say clearly when raising the question that you are doing this while learning to use this processor. Then you may get some helpful responses.

I'm afraid I can't help you either, I just don't like to see someone possibly discouraged by having their query trampled on without helping.
 
I'm afraid I can't help you either, I just don't like to see someone possibly discouraged by having their query trampled on without helping.
I assume you're referring to me as I'm the only person to respond, except for your negativity. I stated my view and added a "unless" which turned out to be the case. Well done on bringing this to a useless end.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top