Hi all,
Is it possible to get the CPU's machine cicles from a C script? I'm using the C Scripting feature of the uVision3, and I need to syncronise the scripts with the simulation. For example, i need to have a C script that will togle a pn after a specific number of machine cicles.... Is it possible?
Best regards, Marius
Hope this will help you.
Configure a timer in auto reload mode and assign the source of the timer as sysclk/1. You can check the timer value to get a count on sysclk cycles. If your desired value exceeds the size of the timer then you have to handle the situatiuon using the ISR of the timer.
assign the source of the timer as sysclk/1
HOW?
since no derivative has been stated i doubt he is using a derivative where that is possible.
Erik
Erik, if he is using such a derivative, he can make use of my post. Or even if he is using different system clock and timer clock, he can just calculate the ratio between the two clocks and use the same procedure to get the number of sysclks.
Anyway, thanking for reminding me this point.
Hey! Be aware that when you are doing a regression test on a specific code, a MUST is that the test itself should not make any changes in the code. Using additional HW resources is not possible. Otherwise you will have big differences in the tests running on the simulator and on the silicon.
The solution is a simple one, please review my prevision replies.