So welcome back.
Let's take a look at the steps to a program called Texas end timers for counting events.
I'm still here.
Cool.
Text him dot com look another same blog post we were looking at just this last bit and then we go to
new vision to start the code show.
The steps are very straight forward.
Step number one is to enable clock to the time block.
And then after that you need to disable the timer while making any changes to the configuration.
This is just like the examples we looked at.
Then you select the time a mode whether 16 bits of that to bits.
You know when using time is two kinds of event the mode of the timer with a 16 bit of 32 bit actually
decides how much event or how many events.
The time I will be able to count.
So it's very important here the size step four is to select what you want the time to okay.
I saw one shot sporadic up down or fallen edge of both here in our example could we go into his art
right next to it.
We've been selecting just periodic and one shot but we're going to make this new selection and it's
that five we the counter limit.
After that we clear the timeout flag and enable the timer and liquidate.
We wait for a timeout flat to be set and then we'd read a problem.
The standard steps required to set up the time which we talked about in the previous lesson.
There are two more steps we need to take in order to configure that time to count edges in the time
unmoored register.
We have to configure it as a capture mode.
We'll look at a time a mode register very soon and then cleared a time a capture mode register when
this is done the time account when about the input pin it's triggered.
Details of this can be found in the data sheets of the particular cortex and microcontroller.
You're using however would provide an example for Team foresee a C launch pad in the time of control
register.
We have to select whether we want to count on a fallen edge a urge age both so before we move on less
elaborate a bit more on what we've covered.
So we said right an age versus fallen search.
This is war right and age means this is on this a very standard wave form.
This is a square wave and as you can see it comes this way and then goes up.
This is known as the right and aging goes up and then comes down the fallen edge.
The rise in the ages from low to high the fallen edge high.
Too low.
So that is what we mean by rising and falling ash.
Now onto today's lesson.
So we're talking about it.
Time out a mortgage register and a here could as well us as well be time a be more to register.
Course we program in with time I most of the time we have the e the so the time up mode.
Register gives us these following options what we want one shot versus periodic counter versus down
counter inputs edge time mode inputs age count mode or real time clock mode or P.W. M..
Right.
So we use this to select the configuration of the time what we want.
So in this new lesson or in this new section we count in edges of of an event.
So obviously we are going to select the input age time mode as well.
These options together are known as the cop child compare P.W. M. which is the CCP these option is put
together it's abbreviated as CCP to capture compare PDB M and time.
A has this CCP 0 in time a B has the CCP won.
So if we are dealing with time.
A Remember time.
It has time is 0 through 5 time a P has its own time Miss 0 through 5 to 4 timer a timer a time of zero
it is connected to the T or CCP Xu close this time as you.
That's why we have t or hit time one has t one here time to T2 and D ones the timer is connected to
the cup Chow compare pedo IBM 0 like this and time of 0 is connected to PBS here on our Launchpad board
and PSU time a one off time is connected to this in fact when you take a look at this table you would
you would understand the arrangement of made here.
This is just to summarize the on how the time is connected to the various pins on the microcontroller
the same thing here.
This one here talks about time a B time a b is connected to the CCP one we are talking about the CCP
register because we would need to access the CCP register to net it to selected us the inputs edge mode.
We need to choose whether we want it to run in the PDB mode or capture mode or compare mode.
That's why I'm pointing out these characteristics show let's look on example let's take an example.
So let's say time a serious CCP zero which is connected to PBS six and PDB zero to use this for a capture
mode we could just we have two sets zero x 4 zero the cell register alternates functions select register
of PSU we have to set this value in the keep f alternate to function register and so on and so forth
for more details you can check the data sheets.
Page one thousand three hundred and fifty one there is a full list that you don't need to memorize the
list you don't even need it often you just need it once when you need to access a particular peripheral
to you know audit more examples here and after we've made the changes in the alternate function select
register we have to also make changes in this register that P C T L register and it has its own values
that you put depending on their PIN you are using right.
This is also available in the data sheet page one thousand three hundred and fifty one F.
If you still have questions and you need further elaboration please leave your question in the comments
section below.