How To Program A STM32 Timer Using Registers

preview_player
Показать описание
A tutorial on how to program a timer of a STM32 microcontroller. The tutorial covers the registers required to set up the timer, the necessary theory and includes a code example of programming the timer using the stm32l432kc microcontroller without any hardware abstraction layers (bare metal).

Source code for this tutorial is available at:

Timestamps:
00:00 - Intro
00:16 - Required Registers and Theory
03:06 - Timer Blinky Example
04:48 - Blinky Demo
05:00 - Outro
Рекомендации по теме
Комментарии
Автор

At 3:08 you say you start enabling the timer by setting bit one of the clock enable register. (1u << 0) sets bit zero not bit one. Isnt it?

jamesmasonic
Автор

Love the Tutorial man, very simple, clearly explained and easy to follow, I have a suggestion and a request. the suggestion being, you should include a link to the downloadable source code for whose who are following your tutorials at a pace, and secondly can you please do a video on STM32 serial up the great

magicmarker
Автор

This is great could you please make a video using interrupts for timer output compare and input compare?

rftech
Автор

bro where you install that dark theme for keil

muhammadirvin
Автор

Probably I understand why everyone "experts" talking about bullshit with timers like PWM, IRQ and other blah blah blah. My question is simply: I need meassure freq of external signal, so for good precision I need driving one timer to gating by second timer for safetly stop counting and safetly preserve counting value even extended up to 32bit. Also don't forgot about AN4776 and check figure10 where explained how the clk is desynchronize when crystal oscillator doesn't feetted to this exercise. So really you must understand when using oscilloscope for meassure 1sec interval don't impress me much.

wegi