cancel
Showing results for 
Search instead for 
Did you mean: 

timer synchronization - cascade

hjn2
Associate
Posted on September 22, 2010 at 15:07

timer synchronization - cascade

1 REPLY 1
stforum2
Associate II
Posted on May 17, 2011 at 14:08

This code below seems to work.  (You'll have to translate the mnemonics to suite your own tool chain.)

    g_pRCC->APB1ENR |= TIM2EN;

    g_pTIM2->ARR = 0XFFFF;

    g_pTIM2->CR1 = TIM_ARPE;

    g_pTIM2->CR2 = TIM_MMS1;

    g_pTIM2->CR1 |= TIM_CEN;

   

    g_pRCC->APB1ENR |= TIM3EN;

    g_pTIM3->ARR = 0XFFFF;

    g_pTIM3->CR1 = TIM_ARPE;

    g_pTIM3->SMCR = TIM_TS0 | TIM_SMS2 | TIM_SMS1 | TIM_SMS0;

    g_pTIM3->CR1 |= TIM_CEN;