And this lesson we are going to learn how to program the 32 bit by 64 bit time is.
Remember we said our cortex and bought that team for one two three TVC Launchpad has 12 timers.
Six of these timers are 16 bit by 32 bits timers and the other six are 32 bit by 64 bits timers.
And we also said the 32 bit by 64 bit time is known as the wide timers get given the they are given
this name to differentiate them from the first group and then the very last lesson we learnt how to
program our sixteen bit by 32 bit time to behave in it 32 bit mode by concatenate INTO A and B of the
timer.
And this lesson we are going to use the wide timer to do that.
Two bit timing programming and we are going to create a delay function and we wouldn't need to concatenate
time or time a B.
So I've created a new folder and created a new project and this is where I.
I'll wait for you.
Just post a video and create a new folder.
Name it.
Why to time and create a new project right.
I suppose you're here now.
So we set out what target option 16.
And then at the bar guys the still areas ICD I had over here we'd reset and run.
Check this here again.
Okay.
And our target is Team 4C One two three one two three.
And the source group here we just put application when you're writing big up programs you might have
about three or four for this you might want the application and one for that.
Dick Dreyfus in another folder and perhaps the libraries in that third folder over here we just have
one for that where we are storing our application and we're right click here and we come here at New
item to group and this item is a c file and we name it main empty.
And then we've got it right.
So the first thing to do is to at the head of file of microcontroller like this.
And yeah we start with our main function a main function is.
Yeah.
Got it.
And like we did for the previous lesson this creates a symbolic name to to manipulate the LCD.
And we did this with the blue just like this.
Yeah.
Quickly define you e when you said blues two excellent
so let's perform the standard initialization is we stop by activating the clock source of port F and
then we set a direction register and then the digital enabled register right.
So now that we've done this we have to go and write to a new function using the y to timers before we
do that.
Let's put it while loop here.
1 show let's call our function.
Deputy 1.
Like we named the previous time a function is just this function has to start with a w a there's a name
I've given it to call the Y timer and it's taken an argument t time could just change this to SEC and
we start by oh shit activates in the we use in time a one here.
So we activate the clock full time the one y time of one and it's the RC Casey w timer to this to here
indicate 0 0 2 because it's time one we use in white time a zero is the time one module and like we
did for the first group of timers the rules are the same over here as well before you make any changes
you have to disable the timer from the control register
then you can use the configuration register to tell the timer the operation mode.
In this case we are operating in 32 bit mode and remember 32 bit mode for this for the wait time is
the default mode if we want to operate in the 64 bit mode we would have to change this year to 0 but
I'll leave that for you as homework because you saw us do it for the first group of time as to the next
thing is to to set the T A NMR register right.
It's as simple as this we want to let's just change this I mean instead of doing the one shot example
and then the periodic example let's just run a periodic example I know and I trust you can do the one
shot mode on your own.
So we just changed this to a periodic mode like this.
The next step is to set the timer into while load register and we know 60 million gives us one second
because I run frequency sixteen megahertz
this we just saw the interrupt.
Claire register and then we said configuration register we activate the timer display by setting it
to 1.
Like this.
So as you can see it's just the same as the first group of time that we we dealt with the other differences.
Over here we've got W. before the word timer.
We've got WD starting with it and our like we did with create the for loop to enable us to have the
acumen save us the number of seconds we want to delay start by creating the local variable here.
We just create a local variable before it's ready to call it into I.
And then I just come here no place to loop like this and I can get what's changed sic.
So we use this and everything looks good or we have to do next we have to do next is just tested out
like we did.
We can move ahead
really chuck a.
And then we can use our newly created function.
I'll just put a prototype up here like this and I can call the time a one time a one touch it one day
I could delay or just delay ten seconds.
Okay.
It looks good.
Let's compile and see zero errors as download on top board.
Yes it's working.
Yeah.
So this is a it's very straightforward very simple.
So you can see you have twelve timers at your disposal.
You can do whatever you want with them and you can create perfectly accurate delays in the next in the
next lessons we're going to learn how to count events using a timer and how to mesh shot deep Karen's
the time between the parents of two events.
So see you in the next lesson.
Yeah.