1
00:00:04,150 --> 00:00:05,440
So welcome back.

2
00:00:05,980 --> 00:00:11,120
Let's take a look at the steps to a program called Texas end timers for counting events.

3
00:00:11,140 --> 00:00:11,810
I'm still here.

4
00:00:11,810 --> 00:00:12,060
Cool.

5
00:00:12,060 --> 00:00:18,700
Text him dot com look another same blog post we were looking at just this last bit and then we go to

6
00:00:18,700 --> 00:00:21,380
new vision to start the code show.

7
00:00:21,550 --> 00:00:23,970
The steps are very straight forward.

8
00:00:23,980 --> 00:00:27,800
Step number one is to enable clock to the time block.

9
00:00:28,060 --> 00:00:33,970
And then after that you need to disable the timer while making any changes to the configuration.

10
00:00:33,970 --> 00:00:36,870
This is just like the examples we looked at.

11
00:00:37,000 --> 00:00:42,300
Then you select the time a mode whether 16 bits of that to bits.

12
00:00:42,300 --> 00:00:49,030
You know when using time is two kinds of event the mode of the timer with a 16 bit of 32 bit actually

13
00:00:49,450 --> 00:00:53,730
decides how much event or how many events.

14
00:00:53,890 --> 00:00:55,930
The time I will be able to count.

15
00:00:55,930 --> 00:01:03,050
So it's very important here the size step four is to select what you want the time to okay.

16
00:01:03,170 --> 00:01:12,310
I saw one shot sporadic up down or fallen edge of both here in our example could we go into his art

17
00:01:12,960 --> 00:01:14,430
right next to it.

18
00:01:14,470 --> 00:01:21,870
We've been selecting just periodic and one shot but we're going to make this new selection and it's

19
00:01:21,880 --> 00:01:24,900
that five we the counter limit.

20
00:01:25,000 --> 00:01:29,350
After that we clear the timeout flag and enable the timer and liquidate.

21
00:01:29,380 --> 00:01:34,090
We wait for a timeout flat to be set and then we'd read a problem.

22
00:01:34,090 --> 00:01:39,730
The standard steps required to set up the time which we talked about in the previous lesson.

23
00:01:39,790 --> 00:01:47,080
There are two more steps we need to take in order to configure that time to count edges in the time

24
00:01:47,090 --> 00:01:47,990
unmoored register.

25
00:01:48,010 --> 00:01:51,260
We have to configure it as a capture mode.

26
00:01:51,310 --> 00:01:58,300
We'll look at a time a mode register very soon and then cleared a time a capture mode register when

27
00:01:58,300 --> 00:02:03,240
this is done the time account when about the input pin it's triggered.

28
00:02:03,250 --> 00:02:09,150
Details of this can be found in the data sheets of the particular cortex and microcontroller.

29
00:02:09,270 --> 00:02:16,150
You're using however would provide an example for Team foresee a C launch pad in the time of control

30
00:02:16,150 --> 00:02:16,720
register.

31
00:02:16,720 --> 00:02:27,090
We have to select whether we want to count on a fallen edge a urge age both so before we move on less

32
00:02:27,150 --> 00:02:30,020
elaborate a bit more on what we've covered.

33
00:02:31,050 --> 00:02:34,100
So we said right an age versus fallen search.

34
00:02:34,290 --> 00:02:40,870
This is war right and age means this is on this a very standard wave form.

35
00:02:40,870 --> 00:02:47,410
This is a square wave and as you can see it comes this way and then goes up.

36
00:02:47,410 --> 00:02:52,770
This is known as the right and aging goes up and then comes down the fallen edge.

37
00:02:52,780 --> 00:02:56,810
The rise in the ages from low to high the fallen edge high.

38
00:02:56,820 --> 00:02:57,370
Too low.

39
00:02:58,240 --> 00:03:01,420
So that is what we mean by rising and falling ash.

40
00:03:01,450 --> 00:03:04,580
Now onto today's lesson.

41
00:03:04,720 --> 00:03:06,110
So we're talking about it.

42
00:03:06,250 --> 00:03:14,210
Time out a mortgage register and a here could as well us as well be time a be more to register.

43
00:03:14,230 --> 00:03:20,050
Course we program in with time I most of the time we have the e the so the time up mode.

44
00:03:20,080 --> 00:03:27,310
Register gives us these following options what we want one shot versus periodic counter versus down

45
00:03:27,310 --> 00:03:35,760
counter inputs edge time mode inputs age count mode or real time clock mode or P.W. M..

46
00:03:35,800 --> 00:03:36,570
Right.

47
00:03:36,580 --> 00:03:41,500
So we use this to select the configuration of the time what we want.

48
00:03:41,500 --> 00:03:48,970
So in this new lesson or in this new section we count in edges of of an event.

49
00:03:48,970 --> 00:03:54,830
So obviously we are going to select the input age time mode as well.

50
00:03:55,030 --> 00:04:03,190
These options together are known as the cop child compare P.W. M. which is the CCP these option is put

51
00:04:03,190 --> 00:04:10,090
together it's abbreviated as CCP to capture compare PDB M and time.

52
00:04:10,210 --> 00:04:15,300
A has this CCP 0 in time a B has the CCP won.

53
00:04:15,400 --> 00:04:17,960
So if we are dealing with time.

54
00:04:18,030 --> 00:04:19,780
A Remember time.

55
00:04:19,810 --> 00:04:30,150
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

56
00:04:30,400 --> 00:04:35,560
it is connected to the T or CCP Xu close this time as you.

57
00:04:35,590 --> 00:04:44,800
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

58
00:04:44,800 --> 00:04:57,060
the cup Chow compare pedo IBM 0 like this and time of 0 is connected to PBS here on our Launchpad board

59
00:04:57,080 --> 00:05:04,400
and PSU time a one off time is connected to this in fact when you take a look at this table you would

60
00:05:05,120 --> 00:05:08,300
you would understand the arrangement of made here.

61
00:05:08,390 --> 00:05:14,930
This is just to summarize the on how the time is connected to the various pins on the microcontroller

62
00:05:14,990 --> 00:05:16,430
the same thing here.

63
00:05:16,490 --> 00:05:24,200
This one here talks about time a B time a b is connected to the CCP one we are talking about the CCP

64
00:05:24,410 --> 00:05:33,760
register because we would need to access the CCP register to net it to selected us the inputs edge mode.

65
00:05:33,800 --> 00:05:40,280
We need to choose whether we want it to run in the PDB mode or capture mode or compare mode.

66
00:05:40,400 --> 00:05:48,680
That's why I'm pointing out these characteristics show let's look on example let's take an example.

67
00:05:48,680 --> 00:05:56,660
So let's say time a serious CCP zero which is connected to PBS six and PDB zero to use this for a capture

68
00:05:56,660 --> 00:06:04,250
mode we could just we have two sets zero x 4 zero the cell register alternates functions select register

69
00:06:04,850 --> 00:06:13,490
of PSU we have to set this value in the keep f alternate to function register and so on and so forth

70
00:06:13,910 --> 00:06:16,810
for more details you can check the data sheets.

71
00:06:16,820 --> 00:06:22,520
Page one thousand three hundred and fifty one there is a full list that you don't need to memorize the

72
00:06:22,520 --> 00:06:29,930
list you don't even need it often you just need it once when you need to access a particular peripheral

73
00:06:30,250 --> 00:06:38,560
to you know audit more examples here and after we've made the changes in the alternate function select

74
00:06:38,580 --> 00:06:47,450
register we have to also make changes in this register that P C T L register and it has its own values

75
00:06:47,780 --> 00:06:53,000
that you put depending on their PIN you are using right.

76
00:06:53,030 --> 00:06:59,290
This is also available in the data sheet page one thousand three hundred and fifty one F.

77
00:06:59,480 --> 00:07:07,040
If you still have questions and you need further elaboration please leave your question in the comments

78
00:07:07,040 --> 00:07:07,880
section below.
