v.s.n.kumar
Member level 1
- Joined
- Dec 2, 2013
- Messages
- 38
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 303
Hi,
I have a problem with timers in keil debugging. i.e., i wrote the programm for 1 second and peripheral clock is 12 mhz. the timer runs only for 1second and immediately it stops. and the programm is
#include<LPC21xx.h>
void main()
{
T0TC=0X0;
T0TCR=1<<1;
T0PR=11999999;
T0TCR=(1<<0);
while(!(T0TC==1));
T0TCR=(0<<0);
while(1);
}
i have calculated the prescalar register value for 1 second. while debugging this program in keil, the timer0 is off at 4seconds. but i have calculated for 1second. what is the problem in this code. please can anybody tell me
I have a problem with timers in keil debugging. i.e., i wrote the programm for 1 second and peripheral clock is 12 mhz. the timer runs only for 1second and immediately it stops. and the programm is
#include<LPC21xx.h>
void main()
{
T0TC=0X0;
T0TCR=1<<1;
T0PR=11999999;
T0TCR=(1<<0);
while(!(T0TC==1));
T0TCR=(0<<0);
while(1);
}
i have calculated the prescalar register value for 1 second. while debugging this program in keil, the timer0 is off at 4seconds. but i have calculated for 1second. what is the problem in this code. please can anybody tell me