cancel
Showing results for 
Search instead for 
Did you mean: 

how can i run the TIMx only as a timer?

tsyejay
Associate II
Posted on January 28, 2008 at 04:48

how can i run the TIMx only as a timer?

2 REPLIES 2
tsyejay
Associate II
Posted on May 17, 2011 at 09:49

Any message is welcome, and I want to make friends with all over the world.

tsyejay
Associate II
Posted on May 17, 2011 at 09:49

Hi, everybody!

I have written a TimerTest program of the STR912FW44, in which I use all of the four TIMx as seperate four timers, the first should interrupt in every 1mS, the second 10mS, the third 100ms and the last should interrupt in every 500mS. The osc frequency of CPU is 25MHz, and the system frequency(fMSTR) is 96MHz, Each timer uses the fMSTR divided by the prescaler as its CLK. the prescaler of TIM01 is 12000, and which of TIM23 is 48000, the private prescaler(the low byte of TIM_CR2)of TIM0 is 0, TIM1's is 9, TIM2's is 4 and the last one is 39. I have made the EN bit to '1' and select the extenal clock, that is, the TIM_CR1 of TIM0 is 0x8001( in SCU registers the fMSTR as Timer clock source is selected), and written the correct ISR for TIM0-TIM3. After I compiled all my source code,I start to debug it in KEIL simulater. I set four breakpoint at entry point of every ISR and press 'GO',after running several hundrand minisecond of CPU time,NO interrupt occur! and ALL the TIMx_CNTR still remain their reset values of 0xFFFC. what's wrong? how can i do for my purpose of only use these TIMs as timer?

See the attachment files for the source code.

Thank you!

[ This message was edited by: tsyejay on 28-01-2008 09:15 ]