cancel
Showing results for 
Search instead for 
Did you mean: 

How to setting the TIM of the stm32F103RC for 1usec

DKim.4
Associate II

I've used stm32F103VC before, so this time I changed my MCU to stm32F103RC. 

I saw in the datasheet that the specifications of the two chips are almost equal.

However, I cannot properly set the timer in stm32F103RC.

Here's how I tested it:

I make a clock pulse by changing the value of pin at TIM_UP_IRQhandler using GPIO PIN.

And I measure this clock pulse with an oscilloscope.

I made 1 usec clock pulse using stm32F103VC.

However, I applied the same settings in the stm32F103RC, and i made 100 usec clocks pulse.

Please let me know how to set the values of Prescaler and Period.

Also, is the clock frequency of TIM1 in APB2 peripheral clock of stm32F103RC a 72MHz?

10 REPLIES 10

Yes, it's perfectly possible and not even difficult to generate 1 μs interrupt with a timer, and perfectly useless. Difficult is to handle the interrupt at that speed, no HAL function calls, and one should watch the generated assembly code closely, maybe even write parts or the whole of it in assembly.

Useless, because one or two (depending on the answers to my questions above) timers can do all this work, and present you the round-trip time, without holding up the CPU even for a single cycle.