cancel
Showing results for 
Search instead for 
Did you mean: 

TO let timer run!!

g121657971
Associate II
Posted on February 12, 2008 at 03:35

TO let timer run!!

2 REPLIES 2
g121657971
Associate II
Posted on February 03, 2008 at 20:13

Hi guys!

I have try many times for these 3 weeks just to let my timer run.

But I can't. And I have try many times just wanna to get a 10ms output.

Here is my code. Please some one help me, thanks.

int main(void)

{

#ifdef DEBUG

debug ();

#endif

EIC_IRQChannelPriorityConfig( T1TIMI_IRQChannel , 1);

EIC_IRQChannelConfig( T1TIMI_IRQChannel, ENABLE );

GPIO_Config(GPIO1, (0x0001 << 7), GPIO_OUT_PP);

GPIO_ByteWrite(GPIO1,0x0001 << 7,1);

TIM_Init(TIM1);

TIM_PrescalerConfig(TIM1,0x02);

TIM_ITConfig(TIM1,TIM_TO_IT,ENABLE);

EIC_IRQConfig(ENABLE);

TIM_CounterConfig(TIM1,TIM_START);

while (1) ;

/* Infinite loop*/

}

void T1TIMI_IRQHandler(void)

{

GPIO_ByteWrite(GPIO1,0x0001 << 7,1);

TIM_FlagClear(TIM1,TIM_TOF);

}

Please any help me, I have got crazy on this subject.

g121657971
Associate II
Posted on February 12, 2008 at 03:35

I don't know why the TIMER can't run.

It seems like I have set everything about TIMER.

But it still can't work.

Is there anyone can solve my problem?? PLZ