Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

mismatch of time between simulator(keil) and target(arm lpc)

Status
Not open for further replies.

sos

Member level 2
Joined
Apr 4, 2008
Messages
43
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,513
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
}
 

Re: mismatch of time between simulator(keil) and target(arm

Delay is a thing which you cannot rely on the simulators. Simulators just assume that there is a controller and simulate the controller. But since they donot have the real crystal oscillator the timing difference will always be there. So we never depend on simulator output. it is just for checking the output properties, if we are getting the output or not.

One problemn what is can guess is that, you are not setting the value of crystal oscillator when you select the device target. So check if you are selecting the same crystal oscillator as you have in the target board. This reduces the error but might not be accurate. but you get the nearest value.
Check that out.
 

    sos

    Points: 2
    Helpful Answer Positive Rating
Re: mismatch of time between simulator(keil) and target(arm

i have seen u in some arm posts......
i got your point.
i will check and tell you the result
 

Re: mismatch of time between simulator(keil) and target(arm

@chivram
i had checked everything and their is some problem their in simulator as my teammates also faced it but they resorted to practical testing and while checking on simulator they commented delay loop .
also i dont want to fight with that problem and want to do just my job.
i test delay on CRO and than use that in program
sorry its not the right way but thats all i can do at this time

also u better check
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top