I'm using MPC5777c and setup clock speed of core 0 to be 264Mhz, which I've tested via measuring the ENGCLK on evaluation board. Then I try to test the actual main loop performance. But when I toggle a pin inside main loop and measure the pin using oscilloscope, the frequency only around 1.4 MHz, which is pretty slower compared with its core clock. I've checked that my main loop only contains like 5 instructions (write 1 to a pin, write 0 to a pin, that's all), and it doesn't contain anything else. The activation of cache doesn't cause any change of this.
Hi,
You are talking about 2 different things.
Core clock is the clock used for core instruction execution (for example 1 instruction is usually 5 core clocks)
Of course you will measure your pin - pin time much much slower as it contains many instructions. That's correct.
Peter
I've found the program that I'm calling a function to set the GPIO pin, instead of write 0 or 1 to the corresponding register straightly, which causes extra unnecessary clock cycles. After I write value straightly to the pin, it will generate pin toggle frequency around 20Mhz, which is what I expected under a 264MHz core clock (Before it just too slow since it's only 1Mhz toggle frequency under a 264MHz clock, so that's why I feel weird).
Thanks for you help.