sos
Member level 2
lpc simulator
target: lpc 2148
simulator : keil
i have written code for delay using timer
first i execute it in simulator and their i find delay for it appx 1 min.
And accidently i download code in my target just to verify is my code is correct?
i found it correct in target??
why their is so mismatch in sumulator and target??
anyone found this before??
here is code:
void mydelay1sec(void) //1 sec
{
T0PR=0X000F4240 ; //value in prescale for 1M(dec)
T0MCR=0X00000003; //so that TC resets after match
T0TCR=0X00000002; //reset timer
T0TC=0;
T0PC=0;
T0MR0=0X0000001E;//1E; // MR0 value for 30(dec) 0X0000001E
T0TCR=0X00000001; //start timer
while(T0TC!=T0MR0); //wait here
}
target: lpc 2148
simulator : keil
i have written code for delay using timer
first i execute it in simulator and their i find delay for it appx 1 min.
And accidently i download code in my target just to verify is my code is correct?
i found it correct in target??
why their is so mismatch in sumulator and target??
anyone found this before??
here is code:
void mydelay1sec(void) //1 sec
{
T0PR=0X000F4240 ; //value in prescale for 1M(dec)
T0MCR=0X00000003; //so that TC resets after match
T0TCR=0X00000002; //reset timer
T0TC=0;
T0PC=0;
T0MR0=0X0000001E;//1E; // MR0 value for 30(dec) 0X0000001E
T0TCR=0X00000001; //start timer
while(T0TC!=T0MR0); //wait here
}