On Wed, 15 Jan 2014, Frank Duignan wrote:
# More likely the interrupt is tail-chaining (re-entering immediately) and this
is happening so quickly that the port has no time to react. What mode is the
timer set to? I.e
# Interrupt on what, does it auto clear etc.
The entirety of the timer set up is here:
static void timer2_setup ( void ) {
/* Set timer start value. */
TIM_CNT(TIM2) = 1;
/* Set timer prescaler. 72MHz/1440 => 50000 counts per second. */
TIM_PSC(TIM2) = 20000; // 120M/2000 = 60k/second
/* End timer value. If this is reached an interrupt is generated. */
TIM_ARR(TIM2) = 600;
/* Update interrupt enable. */
TIM_DIER(TIM2) |= TIM_DIER_UIE;
//timer_set_repetition_counter ( TIM2, 100 );
/* Start timer. */
TIM_CR1(TIM2) |= TIM_CR1_CEN;
return;
}
Notice that with these values plugged in it should be occuring a few times
a second .. hardly fast, so it shouldn't be invoking too quickly. But that
is a concern.. one of the many registrer settings is left default and
incorrect, and causinf some mischief :)
Theres a lot of mode options, I'm not really clear what I need to
set/unset beyond the above which stand out.
--
If everyone would put barbecue sauce on their food, there would be no war.------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
libopencm3-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel