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

Get CPU's machine cicles from the C Scripting interface

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

Parents
  • 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.

Reply
  • 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.

Children