Hi,
I am seeing something strange. I have my uC configured to run at 150MHz. PLLCR = 10, DIVSEL = 2, Oscillator = 30MHz, frequency on XCLKOUT Pin = 37.5MHz.
I would expect that one cycle takes 6.67nS, however I am seeing instructions take much longer to execute than I expect. So I set up a test where I run the following:
for(;;)
{
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
GpioDataRegs.GPBCLEAR.bit.GPIO32 = 1;
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
GpioDataRegs.GPBCLEAR.bit.GPIO32 = 1;
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
asm (" NOT AH");
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
GpioDataRegs.GPBCLEAR.bit.GPIO32 = 1;
}
I am measuring the time between the 2nd & 3rd set of "Set & Clear." I am seeing that this time takes 650ns to execute the 10 assembly instructions which should only take 1 cycle each to execute or 66.7ns. Not sure why each instruction is taking about 10 times longer to execute. What might be the problem?
Thanks,
-Alex