Now we understood how you in washed up time, so let it just proceed for utilizing the timer, which
is pressing with the zinc processing system that is the private 32bit timer that we have with zinc processing
system right now.
Instead of creating a new project, what we could do is here it will be creating a new application project
because I housing file remain common for both washed up time where as well as the timer.
Right.
So we'll go ahead and we'll create a new application project.
We'll just be naming this chamber.
OK, we will be working with the sea and we'll be utilizing in Hallowell template right now when we
see the system, right?
OK.
That has been created for our time.
OK, so you could clearly see that the table that we required for usage of the 32 bit timer is MCU time,
right?
So we go to the gamer folder, OK?
And then the two things that will be including here is that it follows statics, parameters, storage.
Right?
This will give us all the information related to any hardware.
And then we will be proceeding for adding the driver, which are specific to our 32 bit timer radius
x fcu timer.
So these are the two main thing.
Now we'll explore the API is that we have right?
So it consists of normal mode and reload mode and an intramural again, three modes are their normal
mode and automobile mode will be targeting in this specific section, and introverts will be understanding
when we cover fundamental love and interest rate again, a few.
See the EPA so we have to structure when, for instance, and one for conflict structure, right?
Then we also have an EPA to check whether time is expired or not.
We also have an EPA if we start the timer, OK, a low timer.
These are very similar to what we have in an Vostok.
Namely, we could also take out the value, the current value that our time would have.
OK, then we have an hour to reload.
This will be covering later on when we first discuss the timer without an author.
Great.
And first we'll just be disabling in a little later on, we will be enabling it and trying to see the
effect that we get with an to look great in trouble or be covering over here.
So we have look up config see of judicial circuit straight and then EPA to start and stop, right?
So we also have a peace killer.
We will be separate separately for initiating a peace killer so this could be used to control the clock
frequency.
Right?
So let me just follow a normal procedure for us to initialize our time, or it will again be performing
the cell test for this intermediate pacing rate.
So the new structure that we required is the first one that is the.
Instant structure.
So this will just be naming as.
As Sue Time and then we have a conflict structure, right, so we'll just be declaring it.
This will be again a pointer, so sue dmaa and then we have a conflict, right?
This will be declaring again as a pointer, so we proceed with the light.
And this will be our timer in it.
OK, so let me just go ahead and try to add a look up country first.
This again returned the conflict structure, which will be connecting to our a seal team config structure
that we have our data.
We have Rachel S.U. time conflict.
This will be equals to look of conflict.
And here we just need to specify the device A.D. So we go to experimental dotage.
Look for the timer.
So here we have a sea, you right?
This is the device that we need to specify to our look up config function.
Let me just go ahead and take over here.
Right.
So this is the first thing that we do.
Then we call CFD, initialize rate targeting this rate and the status, which will be used to verify
whether initialization is successful or not.
Right.
So in status and it should be equal to CFD initialize, we need to pass an instance structure, which
is this you dmaa in orchestrating the config structures so you DMA config.
And the last thing that we do is to specify the visitors to see you.
You mark config and then be set straight.
So here we'll just be verifying whether initialization is successful or not, so we could just copy
the code from my previous project rate.
This both the thing we will be performing.
So we'll just be copying this and see that since we have both the files with the same name, as soon
as you copy anything from our previous code, you just need to close it.
Okay, so you do not.
Modify the code from a previous application rate, so we'll just be copying whatever thing that we require
and then we'll be immediately closing it, so this will avoid a confusion in the keys if you have the
main file with the scene, right?
So if you do this access, we'll just be mentioning that timer and it is successful and stammering again,
then will again be performing a self-test so far.
So we do have a dedicated API, right?
So we'll just be copying.
It will be adding it over here and that we just need to pass an instance structure.
So did a see you TMA right and will again be checking whether this is successful or not?
Right.
This complete our initialization code for our timer will just be calling it over here.
So for us, the function is dmaa and it will just be calling it over here and then we will be performing
the.
Verification of disclosure.
So let me just go ahead and try to force program and if you.
Squad's programming is successful, will just be clearing up, and so in fact, we will, because disconnecting
it and then we will begin connecting it at scene.
Right now, we need to select this folder, OK, that we want to execute.
So right click here, unless your end configuration.
Right now, you'll be finding you do have an existing configuration over here, which belongs to our
previous application.
OK, so you could delete it, or you could keep it as it is, and then right click run as long as you
want.
So this will create the new launch configuration and that will be executed, right?
So now you will see that timer initialization is successful and self-test is also right to be correctly
able to initialize a timer, as well as we able to perform the self-test.
Now that it just prosody and try to explore the API that we have, right?
So we first need to disable our reload mode since that is not what we wanted to do here.
So let it just go and use disable auto reload, right?
Will be understanding the meaning and usage of it.
As we progress for right here, we just need to pass an instance.
So this is the first thing that we do.
Then the next thing is to load account great again.
Let's assume that we want to have a delay of five second rate.
Does it again work at half of the frequency?
So for us, the timer count will be latest as you are already low.
Five second is three three three three three three three three three three three three three megahertz
and multiply by fight rate.
This will give us a delay of five second and we'll go ahead and load this value into our timer, right?
So to do that, we do have an EPA.
So we have a little time where it will just be copying this will be adding here and then here we need
to pass an instance and along with this, we need to parcel value, right?
This will load our time right.
Before starting our time when we first need to purposefully call the stop.
And then.
We will be starting our time, right, so here.
Just go ahead.
And then we will be calling the stock great.
Now, what are we going to do is?
So litigious, proceed with utilizing dysfunction right now.
This will notify by the time where it expired or not, so true if time has expired, so we will just
be waiting until timer right the white.
So this will continuously routine falls, OK, to the time counter reaches to the specified rate that
its timer expired, so we'll just be adding another tool here, right?
And then we'll be adding this function.
We just need to pass an instant.
So it's you know, what this will do is this will be continuously waiting until the timer expired and
in-between with the small delay.
Right.
So let me just add a delay of two hundred microsecond right, and will be randomly printing the value
that we are having on the counter right.
So will also be our understanding where the country is going up and down, where those counters going
down.
And then we, as we come out of the white look, we'll just be mentioning that our.
Timer, ex-spy, right, that is you basically reach to the delay of a delay of five seconds.
This is what we're going to do over here.
So let me just go ahead and try to randomly pick up the value for our counter and for that, we do have
an EPA.
So we have a good counter value and this basically rate and utility rate.
So we shouldn't just be hiding one variable.
So just go ahead and add one variable and count value, right with visualising it to a zero.
To count value will be equal to the function that we have, and here we just need to pass an instance,
so it is absolutely right.
And along with this will also be printing this value, right?
So this will happen in an interval of two hundred microseconds, right?
So two hundred microsecond is very low, period, that's compared to five second.
They just go it like two thousand to 1000 microsecond basically mean it is two millisecond rate.
Two will add one more zero.
This will be 20 milliseconds.
And then or instead of, we could just walk around with ten millisecond rate.
So we'll just look whether this function is still not.
So a year we'll just be adding the is that it will.
A blue light as a delay of two hundred milliseconds, so the three zero that will be basically converting
micro to me and then two hundred millisecond rate.
So when we reach to five second, we'll be finding less number of the reportings off in there on the
con. Let it just go and try to bring the value right to the account value.
I've seen 0d.
OK, and we will be printing the value of count value, right?
So this will be our entire logic.
What we are doing is we are waiting for our timer to expire.
So this will be continuously running till the counter reaches to the ground that we specify.
OK.
Again, it is in down counter.
So as soon as we expect soon as a timer expired, we'll just be displaying this message.
So we'll just go ahead and try to perform an execution of a call so things will become much more easier
to understand, right?
So we already programmed refugee while checking whether initialization is successful or not.
So we just need to perform the same configuration.
OK, on to a refugee.
So now you could see the counter values.
OK, so we started at a maximum 32 bit value again, then we are coming down so you could actually see
the values I decree my dog again.
This interval is.
All.
Two hundred millisecond rate, so we will do find out so if you can see the one second.
We have five values right to five.
Values should be printed within one two to one two three four five.
Right.
So this represent one taking one two three four five two second one two three four five three second
one two three four and five four second one, two, three, four and five.
Then you could clearly see that count or expired, and we get time where right, so this is working
as expected.
So this is how you'll be operating a counter.
You go ahead first.
So we learn how to load more now as we progress and listen in and to learn more.
So depending on an application, you could actually utilize an auto reload more.
OK.
And this will keep a track of the timing, so you could measure whether the specific timing is made
by an EPA is or would you be utilizing this to?
Use for timing applications.
So what we did is we found the specific time that we weren't great and that count we have loaded into
a timer.
Then usually when we start working with the timers, we first stop a timer purposefully and then we
started right.
We are waiting for timer to expire and in-between what we are doing is we are getting the random count
to evaluate that specific instance.
We are bringing that value and this we are doing in an interval of two hundred milliseconds.
And as soon as we.
A reach to zero, we basically print timer, right?
So this is our to work from this.
Also, it is clear, it is clear that our timer is going in and out.
We are right.
So let me just go ahead and try to exclude the other thing that we have not covered here that is pre-schooler
as well as the auto reload.