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?
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.
#3: Use Profiler function to check the number of cycles. There is a simple example about this:simple_profile_pnt.mdl
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