cancel
Showing results for 
Search instead for 
Did you mean: 

Why TIM1_DMAR Register is always default as 1?

helixwmonkey
Associate II
Posted on April 12, 2014 at 13:26

I am using STM32F103 and its Referrence Manual(RM0008) said that TIM1_DMAR's default value is 0. 

BUT when I connected the hardware and debugging with JLink, I found that TIM1_DMAR is always 1. And I never set it.

AND if I reset TIM1_DMAR to 0 at a breakpoint, then Timer1

completely stops running

. What's wrong with it?
5 REPLIES 5
Posted on April 12, 2014 at 13:51

What's wrong with it?

Hard to say, remove the debugger from the equation and output via the serial port.

printf(''%04X\n'', TIM1->DMAR);
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
helixwmonkey
Associate II
Posted on April 12, 2014 at 15:15

Haha, I understand you~

It must be printed as 0, am I right? :D

Posted on April 12, 2014 at 15:40

If it is zero it would tend to discount your previous observations.

I don't have an F103 to hand to evaluate.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
zzdz2
Associate II
Posted on April 13, 2014 at 20:15

If I understand correctly TIM1_DMAR is not a real register, it just redirects to real TIM registers according to TIM1_DCR.

So by default it would be mapped to CR1.

helixwmonkey
Associate II
Posted on April 14, 2014 at 11:40

Thanks so much. I got it.

I think that STM32F103's Referrence Manual is too brief.. I read it more than twice and still didn't know how to use it...