PWM basics on the STM32 general purpose timers

The STM32 Family processors include general purpose timers that have a nice PWM function that can handle four channels of independently controlled duty cycles. In this article I will look at how to set these up for basic use suitable for the majority of applications that need PWM signals. (more…)

Continue ReadingPWM basics on the STM32 general purpose timers

clock pulses with variable phase on STM32

The CCRx registers can be set to directly produce regular clock pulses on one or more of the output pins. Square waves are especially simple and up to four channels can have variable phase relationships. (more…)

Continue Readingclock pulses with variable phase on STM32

TIM3 Output Compare on the STM32 Family

TIM3 is a general purpose timer found on all the STM32 family processors. Among other features, it has four capture compare channels that can be used to generate regular interrupts. In this article I will show you how to set up simple interrupt events based on these features. (more…)

Continue ReadingTIM3 Output Compare on the STM32 Family

TIM3 ARR Gives Regular Interrupts on the STM32F4

The simplest way to produce regular interrupts from a timer like TIM3 on the STM32 family of processors is to set up the Auto Reload Register (ARR) to generate an update event. This article shows you how to correctly set up the clock source, prescaler and ARR to get regular events over a wide range of frequencies. (more…)

Continue ReadingTIM3 ARR Gives Regular Interrupts on the STM32F4

Basic systick configuration on the STM32

The ARM cortex M4 and M3 processors all come with a systick timer that is part of the core. The other variants, such as the M0 may not have one.  This timer is very useful for producing the main system event clock. Here I will show you how to set it up on the STM32F4xx processors to generate an interrupt every millisecond. (more…)

Continue ReadingBasic systick configuration on the STM32

ARM Cortex Guide updated with Cortex M4

Joseph Yiu has updated The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors to includes details about the M4, including the floating point operations available. With more than 12 years experience with ARM processors, FPGAs and System on a chip technologies, Yiu guides you through all aspects of these exciting…

Continue ReadingARM Cortex Guide updated with Cortex M4

Build a mini ST-LINK/V2 programmer/debugger for the STM32

I enjoy working with the STM32 processors. They are easy to use, powerful and cheap and there are lots of options for developing code. One minor annoyance is the question of a programmer. ST-LINK/V2 One of the most commonly available and widely supported commercial programmers is the ST-LINK/V2. This is…

Continue ReadingBuild a mini ST-LINK/V2 programmer/debugger for the STM32

An STM32F4 Project Template for Crossworks

When developing for the STM32F4, setting up a new project can be a pain. Without some kind of wizard or configuration tool, there are always loads of obscure settings that have to me made each time. The easiest way around this is to make a simple template for the STM32F4 that has all the basic features set up already and then copy or clone it every time you start a new project. (more…)

Continue ReadingAn STM32F4 Project Template for Crossworks

An Improved Bit Banding Approach

The commonly published approach to using the bit banding feature of the Cortex Mx family of processors is to use macros – see Bit Banding in the STM32. This post describes an alternate implementation that uses a dedicated RAM section for bit banding.
(more…)

Continue ReadingAn Improved Bit Banding Approach