The frequency loop program is an example of changing the chip frequency within a loop. It is important for characterizing the circuit since it enables to do tests with different frequencies. It starts with a specific frequency specified be initializing the control word to a specific value. The frequency is decremented by incrementing the control word. The loop lasts for nine times. The program starts with setting the number of loops in the counter and setting an initial control word. It ends with decrementing the counter and loop if it does not reach zero.
Inside the loop the processor sends the frequency, measure it and read the measured frequency register back to the processor. IP testing has to be done here. If it fails then the control-word is incremented and loops again.
As an example, take the second execution of the loop. The user counter contains the value is 7 and CW contains 10. The measured frequency is calculated from this formula:
Measured Frequency=(FR ×Processor Frequency)/(No.of cycles)
The read frequency register on FR is 0340 which is 832 in decimal.
The processor frequency is 50 MHz.
The number of cycles is (400) which is 1024 in decimal.
So, the measured frequency = (832 ×50MHz)/1024 = 40.62MHz.
Note: The used software is programmed by me for our project in the KFUPM university. The project got a patent by our advisor Dr. M. Elrabaa