different run time durations for LPC1313

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by orhan.dirik on Tue Nov 13 01:55:50 MST 2012
We are using LPC1313FBD48 as the control MCU in our new medical design. For some safety reason we would like to measure the runtime duration of deterministic code piece. In the attached archive, at main.c a loop runs for 150000 times and a timer is used for measuring this duration.
The problem is we get different timer counts when changing the code BEFORE the timer starts. For example, when we use SysInit() function in main.c the timer counts 318753 each time we run the code. However, when we comment out the function and uncomment the part above it, the timer counts 312503. Please note that, the code piece above SysInit is the same as SysInit function itself. All in all, timer counts differ due to previous codes that do not even start the timer.
Can can we get rid of this problem?

Original Attachment has been moved to: lpc1313.rar