Troubles about system clock and the time of executing one step

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Troubles about system clock and the time of executing one step

746件の閲覧回数
feifanji
Contributor I

I generated a blank project, in which only the initialization part is included, 

I just want to test how long time is needed  for the execution of a command, so I write codes below and measure the interval between 0 and 1 o the output PA12.

For the reason that I have config the chip running at 200MHz, as a result, the square wave in the scope should has a frequency of 20Mhz, however, it is 5Mhz...Is there any problem of my configuration?

タグ(1)
0 件の賞賛
返信
1 返信

633件の閲覧回数
Daniel_Popa
NXP Employee
NXP Employee

Hi feifanji‌,

There are a couple of things you should pay attention to:

#1: check the place where that IO toggle code is inserted. You'll see that is called on the STEP function not the INFINITE loop.

#2: check your project settings to configure the Fixed-step size (aka-fundamental time on which the STEP function) is called.

pastedImage_1.png

#3: Use Profiler function to check the number of cycles. There is a simple example about this:simple_profile_pnt.mdl

pastedImage_2.png

So, if you do the IO toggle on each STEP (let's say 1ms) you should see that on oscilloscope. Then using that as a reference you could add a second toggle IO in the same STEP and see on oscilloscope the diff between signals. That should represent how fast the toggle happens.

Then, keep in mind that the toggle actions is translated in multiple assembly instructions. If you have the diff and the number of assembly instructions you can then double check the 200MHz operation. 

Hope this helps!

Daniel

0 件の賞賛
返信