Hello, welcome back.
So let's continue, I've just come over here and create a new file, right click menu item at DOT five
and that's going to cost to EFORE artist tbsp then.
It's created and then I've got to add it to my project.
A double click here and then I select all files and then I can find it, it's over here, I double click
to add.
So yes, no, it's part of our project.
So we start by using the if and statement to prevent multiple additions or multiple definition, so
I do this and then.
And if.
Right.
Remember I said we've got a mojos, one of them is the time.
Let's start with I'm going to start by creating handlers for the time as we're going to use time as
two, three, four and five.
I'm just going to keep them here and we're going to have an API to initialize the timer.
Another API to start.
A timer would interrupt and then we're going to have another API to perform the two steps in one show.
I'm just going to bring the APIs to initialize the timer first.
It's as simple as this.
It takes no argument.
It returns no parameter as well.
Like this and then this, which I used to initialize the time, is then we need some APIs to initialize
and start the interrupt.
We shall see how they're implemented.
I know they might look a bit strange at this moment, but don't worry.
So instead of just writing out all the APIs for all modules, how about we do this and then we deal
with the implementation of the time and then we come back to Canada module, then we deal with its implementation.
So I'm going to create the implementation file as well.
I'll come over here at New Item.
I don't see far then I'm going to add the name artist, PZP and the other over here, what I want is
to include the DOT HFA we just created over here.
So I'm going to say include.
Today like this.
I think the age is problematic.
OK, so it cannot identify this is because we've not ordered the estimated 32 hardware obstruction there,
which is provided by Steve Microelectronics.
So to do that, I'm just going to come here, come back here and come to devise.
And come to KUB Hall and I'm just going to include the time out with with just initialise the timer.
And what I'm going to do is I'm going to resolve resolve and then I'm going to select one of these and
the one I'm going to select is the classic.
So come over here and select classic here like this and it's all disappeared.
Meaning it's OK now.
And I click OK.
And then once that is done, I can just.
Right.
Click over here and then see this one here.
And I would include.
And you can see this has disappeared now, if I wish to go everywhere, shall deal with that later.
So let's take a look at the implementation of the timeline module, less populated initialization function
we just spoke about or just break off for initialization such once.
And as you can see, we've got the time in it here, and what we're doing is we initialism this time
to work in milliseconds unit.
And because our clock frequency is 16 megahertz, we use a scale of sixteen thousand and then we use
a period of one, meaning the units is one millisecond or a millisecond.
And they see this one as millisecond as well, but we shall change these parameters later with our experiment,
right.
And also we shall build a function that would help us change the system frequency to 80 megahertz.
And once that is done, we have to come here and update it as well.
But, yeah, this is a if you require more explanation or if you want to build your own time, a drivers,
you can send me a message and I'll take you through that.
So that's the nightfall.
But this not the only thing we need.
We also need the MSP in it and the need for the mouthpiece towers for the microcontroller support package.
We need that as well.
That's required by the system, 32 hardware obstruction there.
So I'm going to grab those as well.
I mean, we could we could actually take the content of the MSB in its function and put it inside the
standard in its function, but that would just make things clutter together.
So this is it.
This just enables the timer to interrupt request.
And we can come over here to change, to interrupt priorities and the priorities.
And this one is used to initialize the timer so we can call this function in case we wanted to initialize
the timer.
So this the D in it, then we have the timer to start this one here.
It's a combination of the pace start interrupt function and the timer to in its function.
And we can call this one function to initialize the timer and then start interrupt rather than start
initialize.
So I'm just going to bring that over here as well.
If there's anything you do not understand.
Don't forget to leave a question or send me a message.
I don't want it to feel like I'm just dropping code on top of your head.
So really, there's a lot to cover in developing and building real time applications.
And to spend time building peripheral modules is a different course.
That's why I'm taking this approach.
But if you disagree or if you need more explanation for any of what I'm doing here, don't hesitate
to send me a message or to leave a question below.
Yeah, right.
Moving on.
So then we've got we've got a C.
Yes, we've got all the time our initialization stuff done.
So what I'm going to do next is bring in the interrupt hunt.
Less of the time is and I'm going to keep the interrupt handlers in the support package file and then
we can copy and paste that interrupt handler into our application file, which is going to be something
like may not see when we start writing the applications, but I'll bring the interrupt handlers here.
And what I'm going to do also is to create some local variables.
I'm going to call them count two, three, four, five.
And later on, when we test in the module, we're going to see whether indeed these counties increment
according to the the period or the frequency we've set for each timer.
So I'm going to bring the local variables here like this.
And I'm going to bring the interrupt handlers all at once again.
You can download a complete board support package at the end of this video, so I don't need you to
be, you know, type in that, I know that's unrealistic.
So we're going to add another function to help us create millisecond delays.
And that's a very simple function.
It's like this.
And this shall complete the the the implementation of the time of my.
So next, we will take a look at the ATC modules and we initialize in just one ATC pen.
And with this, we shall connect our potential meter.
And later on we'll see whether we can connect a different kind of sensor to plot the graph on the LCD
screen.
Hello.
Welcome back.
So let's continue.
I've just come over here and create a new file, right click add new item at each file and there's going
to cost Stamford's to efore Artus tbsp.
Then it's created and then I've got to add it to my project.