AnsweredAssumed Answered

GP Timer EXTCLK mode on BF70x

Question asked by Ujinosuke on Jul 13, 2014
Latest reply on Feb 17, 2017 by oldfoxsoftware

Hi,

 

I have a question about GP Timer EXTCLK ( clock source: SCLK) on BF70x.

 

I want to start free run timer counter on BF70x Ezkit, but the timer never count up SCLK clock.

 

My source code is below.

 

void start_timer() {

 

    *pREG_TIMER0_TMR0_CFG =

                     ENUM_TIMER_TMR_CFG_CLKSEL_SCLK |

                     ENUM_TIMER_TMR_CFG_IRQMODE0 |

                     ENUM_TIMER_TMR_CFG_EXTCLK_MODE;

 

    *pREG_TIMER0_TMR0_PER = 0x1000;

 

    *pREG_TIMER0_DATA_IMSK &= ~(0x1);

 

    *pREG_TIMER0_RUN_SET = 0x1;

}

 

After start_timer0() is executed, TIMER0_TMR0_CNT register value is fixed as 0, and never count up, and no interrupts.

 

Please teach me my program's fail points.

 

FYI:

Free run counter is correctly working on PWM_OUT mode, instead of EXTCLK mode. I can get free run counter using PWM_OUT mode, but I wondered why EXTCLK cannot use.

Outcomes