Solved! Go to Solution.
Hello @DevMotorControl,
Thank you for your post!
The explanations provided in the post you mentioned What is the Tick duration while profiling code in PIL ? are valid and the SPLLDIV2 is indeed 20MHz. But the SPLLDIV2 does not mean that the SPLL is automatically divided by 2, is the second divider that could be applied to the SPLL value.
In our default configuration delivered with MBDT, as explained in the referred article, the SPLLDIV2 is actually the SPLL with a division factor of 4. So the PIL/Profiler timer is actually 20MHz, with a tick taking 50ns. I could confirm this, by using a simple program, which sets a pin high, executes a sequence, and then sets the pin to a low state. If we measure the execution time with an external logic analyzer and we also measure the execution time using the profiler block, we could also confirm that the frequency is 20Mhz.
In the FreeMASTER examples coming with the Motor Control, I think indeed that the value of the translation factor between ticks and ns needs to be adjusted to be 0.05 and not 0.025 as it is now. This comes from the early development time, when most likely the profiler had a value of 40Mhz but they were adjusted in a previous release.
Hope this helps,
Marius
Hello @DevMotorControl,
Thank you for your post!
The explanations provided in the post you mentioned What is the Tick duration while profiling code in PIL ? are valid and the SPLLDIV2 is indeed 20MHz. But the SPLLDIV2 does not mean that the SPLL is automatically divided by 2, is the second divider that could be applied to the SPLL value.
In our default configuration delivered with MBDT, as explained in the referred article, the SPLLDIV2 is actually the SPLL with a division factor of 4. So the PIL/Profiler timer is actually 20MHz, with a tick taking 50ns. I could confirm this, by using a simple program, which sets a pin high, executes a sequence, and then sets the pin to a low state. If we measure the execution time with an external logic analyzer and we also measure the execution time using the profiler block, we could also confirm that the frequency is 20Mhz.
In the FreeMASTER examples coming with the Motor Control, I think indeed that the value of the translation factor between ticks and ns needs to be adjusted to be 0.05 and not 0.025 as it is now. This comes from the early development time, when most likely the profiler had a value of 40Mhz but they were adjusted in a previous release.
Hope this helps,
Marius
Hi @mariuslucianand ,
Your post confirms my deductions. Thanks for your reply!