This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simulation versus Target

Thanks to:- Erik Malund, Per Westermark for there previous help on I2C data line low, im still working on that and many other problems currently.

I have a quick query if anyone may know. If i simply toggle a port pin either side of a for loop that does nothing e.g

P2_P12 ^= 1 ;
for(i=0;i<4000;i++) ;
P2_P12 ^= 1 ;
for(i=0;i<4000;i++) ;

and repeatedly call this routine to get the time taken to proccess these events, i have a question.

In simulation mode the pin toggles every 200uS. According to the stop watch used in the staus bar.

In target mode the pin toggles every 100uS. According to the scope im using.

Forgetting the actual times etc why does simulation mode report the loop takes 2 x as long ? Shouldnt the stop watch timer in simulation mode be correct(ish) ?

Parents Reply Children
No data