王工您好:
我使用tms570LC4357芯片,时钟配置如下,我想问一下,执行一次asm(" NOP");需要化多长时间?谢谢。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
王工:
之前我在别的帖子里看到过是1个CPU周期,但是我就是不知道1个CPU周期怎么计算。
您看按照我上面的时钟配置,一个cpu cycle是多久啊,谢谢。
1 CPU 周期是1个GCLK周期: 1/300 us
You can measure the execution time by toggling a GIO pin or using PMU. To make the measurement more accurate, to execute the instruction as many time (for example 100 times) you can between two GIO toggle actions, for example,
Pull-high GIOA[0]
delay
pull-LOW GIOA[00]
asm(" NOP");
asm(" NOP");
... ...
asm(" NOP");
Pull-high GIOA[0];
From your oscilloscope, measure the duration between GIA[0] falling edge and rising edge. The execution of "NOP" is measured duration/100.