I assume that you probably have at least used one of the microprocessor or a microcontroller.
OK, so let us see what is the procedure to change the clock speed?
OK, in an MSP before 30, which is also a very popular microcontroller, I guess we in general have
a DCO, OK, or Liscio basically mean our digital controller oscillators.
You get the flexibility of controlling the clock speed by changing the register.
So if you just go.
What we are doing is we are setting certain bits of our digital control oscillator so we have control
registries where we are setting up the clock speed that we are in general.
If we considered to change the clock frequency, we should have a good idea about the registers which
are present in this specific microcontroller architecture and then how you calculate the values of the
bet that should be updated in the register to have a dedicated clock rate and which is not that much
easy, but with a good experience, you can do it very easily.
Right.
So this is how in general we change the clock speed when we work with microcontrollers.
So we have a dedicated controller registers depending on the requirement.
We set the parameters and then finally we get an output.
Croxford Right now, if we want to analyze a seam situation in an FPGA.
OK, so let's assume that we have clock of on board, clock of hundred megahertz.
So this Alred megahertz basically mean the clock period is a ten nanosecond rate.
So this is the clock that we have now.
Let's assume that we want to have a frequency of twenty five megahertz.
Right.
So we want to have a period of 40 nanoseconds.
So if we just go ahead.
So if you divide and hundred megahertz by twenty five megahertz, we get the value of four.
So for basically mean the half value is two.
So here if I just replace this four with one, so why we have replaced it this with one, because we
want to have account value of this account value.
How we are computing account value is it is basically the ratio of the clock frequency that we have
on an FPGA to a desired frequency.
OK, that is a hundred divided by twenty five.
Give us four.
So here cound basically represent the half value that you get when you divide the frequency that you
have on an object to the desired clock frequency.
So for example, in our case we have an on bearclaw frequency of hundred pingers and the desired frequency
is twenty five megahertz.
So if you just take a ratio of this two, it will be getting a factor of four.
So half of it is OK.
So when we say count is less than one, so we are getting to value that is zero nine one.
So that is how we represent the account value inside the second variable.
Now let me just try to perform a simulation and see what happens.
OK.
So here now what I do is first I'll meet you then in frequency.
So this is an input clock and then we have this as an output clock.
So if you measure the period of an input clock.
Right.
Which is very, very simple to do, what we will do is will just measure the rate.
So it is ten nanoseconds or ten nanoseconds basically corresponds to an hundred.
Say this.
We previously discussed ten nanoseconds, hundred megahertz.
OK, and now we have designed a very local to achieve an output frequency of twenty five megahertz.
So it should have a period of 40 nanoseconds just trying to measure the clock output.
OK, so if you just try to measure he'll be noticing it is 14 and a second rate.
So just adding a different count while you can get the output clock frequency.
If the ratio of the clock frequency that you have on an FPGA to the desired clock frequency, give out
an integer.
So, for example, let us assume that, you know, you want to have and desire frequency of ten megahertz.
So in this case, if you divide hundred, we go to ten mega to get the factor of 10 and the half of
Dennis vibrate.
So here, if we just replace one with four and if you just try to again, relaunch a simulation and
now if I just try to measure.
So let me just try to measure the clock period.
So here.
If I just try to measure the clock period, so it is around 100 nanoseconds, so if you and put out
and make out, so here you'll be noticing that we get ten hundred nanoseconds.
So this is how it becomes very easy to get an output desired output frequency.
If the fact that we get when we take the issue of the FPGA clock frequency to the desired clock frequency
as an integer value if we get a fraction.
But let us assume that we want an output frequency of thirty three megahertz right now will be finding
in this situation.
We do not get an integer value.
Instead we get a fractional value.
So in that is what you do, right.
So you can just go to an IP catalogue and then there if you just search for a clocking result.
OK.
And there if you just go to the output clock, so here we can actually specify, let us assume thirty
three megahertz, OK, we just need to go ahead and generate an IP.
So will be finding that now.
With adding an IP, we can also read the clock frequency where the issue is a fraction, right?
So this is how it becomes very easy to generate a desired clock out of an FPGA and then microcontroller.
We generally need to have a good understanding of an architecture and how you configure the registry
as well.
But here we will be finding we just need to work on pure mathematics.
So if we get an integer when we divide our FPGA clock frequency to their desired frequency, then we
can simply replace discount value.
OK, over here, as you change the number, you will be getting a very low frequency.
And whenever you get a fractional part, just go ahead with the locking, with our IP and you will get
the desired frequency out of an.