cancel
Showing results for 
Search instead for 
Did you mean: 

Extremely slow timer

ferraridamiano
Associate II

0693W000005BwGTQA0.jpg0693W000005BwHMQA0.jpgHi, I'm new in stm32 world. I recently bougth a stm32L4R5ZI nucleo board and started a project using timer/counter. I tried to do a very simple project that generate a PWM of 1 Hz with d%=50%. So I setup the timer clock to 30 MHz. And in the parameter settings I setup: PWM generation on CHx, prescaler to 29999, counter period of 999 and pulse at 499. What I get is an LED that blinks at a very low frequency, at about 1/7 Hz. instead of 1 Hz.

My program just do this (I just enabled the timer in the main).

I tried to change timer, and use timer as a counter but I always get similar results. I have no idea of what can it be.

Thanks in advance!

10 REPLIES 10

oh. The MCO has a prescaler so you can divide it by (up to) 16 - and maybe you have a multimeter with a frequency counter? Besides that, I'm not sure what I would do if I didn't have access to an oscilloscope.....