Tagged: interrupt

Library 26- Rotary encoder on STM32F4 34

Library 26- Rotary encoder on STM32F4

A rotary encoder, also called a shaft encoder is an electro-mechanical device than converts the angular position or motion of a shaft to an analog or digital. There are 2 types of rotary encoders: Incremental – output indicates just rotation clockwise or counterclockwise Absolute – output indicates current position for encoder For that purpose I made a one simple library. This library works for incremental rotary encoders. It uses an interrupt to handle rotations. On the rotary encoders inside are...

Library 19- Use internal RTC on STM32F4 97

Library 19- Use internal RTC on STM32F4

It’s been some time when I post last library. Next one is internal RTC library. STM32F4xx devices have Real Time Clock (RTC) inside, with support of internal calibrated 32768 Hz oscillator or external (more accurate) 32768 Hz oscillator. RTC peripheral has also backup register support, which means that when you reset MCU, registers are not reset or if power is off and you have battery connected on Vbat pin, clock is still working. RTC can also wakeup MCU from all...

STM32F4 NVIC or Nested Vector Interrupt Controller 37

STM32F4 NVIC or Nested Vector Interrupt Controller

Interrupts are important in microcontrollers. WIth them you are able to stop executing main program and jump to some predefined area if there is something important. I already used interrupts in my USART library. There is an interrupt called each time data arrive to MCU. Defferent peripheral can trigger interrupt, like data come to USART, ADC finished conversion, timer overflow, and more more. NVIC NVIC or Nested Vector Interrupt Controller is used to dinamically tell which interrupt is more important and...