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
I managed to find an answer to my problem; it is much simple than i was expected.
µVision3 includes a number of predefined debug functions that are always available from the debuger's simulation function. Those are: - void rwatch (ulong address) -> Delay execution of signal function until read access to address - void swatch (float seconds) -> Delay execution of signal function for specified time - void twatch (ulong states) -> Delay execution of signal function for specified number of CPU states - void wwatch (ulong address) -> Delay execution of signal function until write access to address
All of these are very useful to syncronize your debug function with the simulator. Moreover, the debuger provide system variables that are very usefull in case that you need the syncronization: - $ unsigned long represents the program counter. You may use $ to display and change the program counter. For example, $ = 0x4000sets the program counter to address 0x4000. - states unsigned long current value of the CPU instruction state counter; starts counting from 0 when your target program begins execution and increases for each instruction that is executed.