Tagged: tim2

Tutorial: Control WS2812B leds with STM32 0

Tutorial: Control WS2812B leds with STM32

In this tutorial I will explain how to drive WS2812B with STM32 using TIM PWM and DMA peripherals in the most efficient way by using minimum amount of RAM, required to process all leds. There is a good explanation, already available on the web. If you have no experience with WS2812B leds, I strongly recommend you to read the blog post. It is very well written, but it has one major issue. It uses 24 words of RAM for each LED,...

Square wave 10kHz 28

Library 36- DAC Signal generator for STM32F4

For FFT project purpose, I needed simple, really simple signal generator. I don’t have separate device at home, so I made one with STM32F4. DAC Signal library uses timer for output generation and DMA for transferring data from memory to DAC peripheral. So this library does not use processor for controlling. Everything is behind the scenes. You can use 4 different signal waves: Square Sawtooth Triangle Sinus They are simple, predefined signals. You can adjust signal frequency for specific wave. I...

PWM graph 62

Library 33- PWM for STM32F4

I had enough of each time configuring PWM for some reason, so I decided to make a library for it. This library allows you to use PWM signal on all possible timers on all possible pins for timer. I made it for controling servos, but it can be used for anything else. PWM works in FAST PWM mode. You just set your PWM frequency, timer you will use, channel on timer and you are ready to go. If you need...

PWM graph 136

STM32F4 PWM tutorial with TIMERs

In this tutorial, I will show you, how to implement PWM outputs on STM32F4xx devices. This is for a lot of people pretty hard work, but believe me, it’s quite quick and easy. I will go step by step on how to make a PWM output on specific timer. Update: I made a library for PWM, available here. STM32F4 timers They have up to 14 timers inside. Table below shows their description. You have to know, that let’s say F401 doesn’t...