STM32 MCUs products

cancel
Showing results for 
Search instead for 
Did you mean: 

Forum Posts

Timer callback issue?

Hi,I have timer with period 1 sec (80 MHz clock):  htim2.Init.Prescaler = 80-1; htim2.Init.CounterMode = TIM_COUNTERMODE_UP; htim2.Init.Period = 1000000-1;  Global var (volatile uint32_t) increased every time counter wraps around void HAL_TIM_PeriodE...

Lex by Associate III
  • 95 Views
  • 3 replies
  • 1 kudos

Resolved! TIM1 in Encoder Mode but TIM1->CNT does not change

Hi, I'm interested in using Timer 1 on my STM32F439ZI to decode the quadrature signal from an encoder but TIM1->CNT doesn't appear to change. I'm not sure what is missing, the TIM1 config looks like: static void MX_TIM1_Init(void) { /* USER CODE BE...

debug_0-1711431610771.png
debug by Associate III
  • 232 Views
  • 1 replies
  • 1 kudos

Timer runtime config issue

Hi guys,I have a simple timer config, which I want to change based on some conditions. I set GPIO high and when OPM timer INT happens, GPIO is set low. Default timer setup 50ms, which is changed to 500ms  in the while() loop.Problem: the first pulse ...

Lex by Associate III
  • 137 Views
  • 7 replies
  • 0 kudos

Chaining two timers on the STM32G4

I need to chain two timers together to get one 48-bit timer that counts microseconds, I'm thinking of using TIM2 as the master and TIM3 as the slave. I have the feeling some of the answers are contained in this table in the Reference Manual but I can...

c_shearer_cooper_0-1711461609158.png c_shearer_cooper_1-1711461683863.png c_shearer_cooper_2-1711461691949.png

Timer reset using RCC

The problem: if TIM2 is used prior to my code, then it gets stuck at a certain point, even though all the registers are properly set.* Here is the configuration of TIM2 registers when it works fine:(gdb) x/21 $TIM2_BASE0x40000000: 0x00000001 0x000000...

0xfab by Associate II
  • 233 Views
  • 4 replies
  • 0 kudos

Multiple channels used for TIM1

Hello,My final goal is to output two pulses from two separate pins, but not at the same time. My intention is to use TIM1 for my STM32F401RE board, as this is the only timer that allows me to set the repetition counter for the 'One Pulse Mode'. This ...

Kalle by Associate
  • 67 Views
  • 1 replies
  • 0 kudos

Resolved! PWM problems

Hello! Recently I got into STM programming for my internship and I cannot figure out register level programming yet, I have this piece of code ```RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_APB1ENR_TIM2EN;GPIOA->MODER |=GPIO_MODER_MODE5_1 | GPIO_MODER_...

Petrarka by Associate II
  • 305 Views
  • 5 replies
  • 0 kudos