1
00:00:00,660 --> 00:00:01,720
Hello, welcome back.

2
00:00:02,190 --> 00:00:09,870
In this lesson, we go in to develop the GPA, you extend or interrupt driver, I'm going to come to

3
00:00:09,870 --> 00:00:11,490
my source folder here, right.

4
00:00:11,490 --> 00:00:14,100
Click New Hour Select.

5
00:00:15,260 --> 00:00:17,620
Sourcefire, I'll call this t'ai.

6
00:00:19,160 --> 00:00:19,690
Lozzi.

7
00:00:20,960 --> 00:00:21,550
OK.

8
00:00:22,800 --> 00:00:23,760
We have this file.

9
00:00:24,000 --> 00:00:30,100
OK, I'm going to create the head of our include folder, right click new head of file.

10
00:00:31,540 --> 00:00:32,020
Quota's.

11
00:00:34,070 --> 00:00:34,600
Dorridge.

12
00:00:36,450 --> 00:00:37,020
OK.

13
00:00:39,660 --> 00:00:42,760
So we're going to have one function.

14
00:00:42,780 --> 00:00:47,640
Remember, on our nuclear board, the push button is connected to PC 13.

15
00:00:48,750 --> 00:00:53,040
Pottsy, been 13, has the the push pushbutton.

16
00:00:54,830 --> 00:00:58,780
So to start off, I'm going to include our whole lot each over here.

17
00:01:00,920 --> 00:01:04,490
And once that is done, I'm going to create a function here.

18
00:01:06,270 --> 00:01:08,910
Void this 13.

19
00:01:11,730 --> 00:01:17,910
Entrapped in it, and this time I'm not going to show how to ride this driver, I'm just going to explain

20
00:01:17,910 --> 00:01:22,140
line by line, because this course is not for developing bedmate or driver's.

21
00:01:23,220 --> 00:01:32,340
OK, so we're going to start off by enabling access to your ports seat to do that, we need to access

22
00:01:32,340 --> 00:01:38,250
the HP one enable register and then when we write four, it would correspond to bits.

23
00:01:38,260 --> 00:01:41,280
Number two, that corresponds to Port C.

24
00:01:43,340 --> 00:01:46,640
Four equals binary number.

25
00:01:48,270 --> 00:01:53,130
Zero one zero zero, so it's No zero bids, no one bids, no two bids, No.

26
00:01:53,130 --> 00:02:00,930
Zero is for Porti, this one is for Port B, this is for Port C, OK, so that is why I write for OK,

27
00:02:01,320 --> 00:02:03,960
every now and then I'm tempted to explain more.

28
00:02:05,450 --> 00:02:11,540
OK, also because we want to enable, extend or interrupt, and what extend or interrupt means is that

29
00:02:11,540 --> 00:02:16,060
we're not going to be checking the Penn State to see whether someone has pressed it or not.

30
00:02:16,640 --> 00:02:21,130
When someone presses the pin, we're going to be told automatically that's what this means.

31
00:02:21,500 --> 00:02:28,880
So because we're going to we want this functionality, we have to enable the system config, which is

32
00:02:28,880 --> 00:02:31,940
another module that handles our external interrupts.

33
00:02:32,330 --> 00:02:37,840
So our Anabasis config over here, that is part of the APB to bus.

34
00:02:37,850 --> 00:02:41,780
So I go to AP to enable and this hexadecimal code.

35
00:02:41,780 --> 00:02:48,230
When I expand it to its binary form, it would correspond to the bit that enables this config for us.

36
00:02:49,810 --> 00:02:56,680
So once that is done, we go into Configure PC 13, which is where our push button is connected.

37
00:02:57,080 --> 00:03:00,460
We're going to set PC 13 to its alternate function mode.

38
00:03:28,170 --> 00:03:29,850
We're going to configure it for its.

39
00:03:31,520 --> 00:03:33,170
It's input's mood.

40
00:03:34,660 --> 00:03:38,530
Inputs in Robert mode, essentially, so to do that.

41
00:03:39,590 --> 00:03:44,690
Let's go to our reference manual, because this bits I need to point it out to you.

42
00:03:46,990 --> 00:03:53,970
I'll come up here and I'll search you, and then I'm going to scroll down.

43
00:03:55,210 --> 00:03:56,940
OK, I jumped over here.

44
00:04:01,510 --> 00:04:02,900
GPA, you must register.

45
00:04:03,310 --> 00:04:06,430
So for input, we have to set this particular bit.

46
00:04:07,590 --> 00:04:14,160
We have to set a particular pin to zero zero, remember, in the Mod Register, two bits are used for

47
00:04:14,160 --> 00:04:15,070
a single pin.

48
00:04:15,360 --> 00:04:18,780
So we're dealing with PIN 13 pieces, 13.

49
00:04:18,810 --> 00:04:21,270
So we're looking for Modder 13.

50
00:04:22,430 --> 00:04:23,800
Over here, so we have to set.

51
00:04:24,470 --> 00:04:27,490
Twenty six and bid twenty seven to zero.

52
00:04:28,890 --> 00:04:33,840
OK, what we can do is use the end operator to disable just these bits.

53
00:04:34,920 --> 00:04:37,440
Right, so I can simply do that.

54
00:04:38,630 --> 00:04:39,620
By using this.

55
00:04:40,920 --> 00:04:48,900
If I expand this hexadecimal number, it corresponds to bits number twenty six and twenty seven, the

56
00:04:48,900 --> 00:04:51,200
bits we are interested in, right.

57
00:04:51,840 --> 00:04:59,310
And if I put a two day here and then I put an end here, it means sets between twenty six and twenty

58
00:04:59,310 --> 00:05:02,360
seven in mode register to zero zero for me.

59
00:05:02,410 --> 00:05:03,640
So that's what this means.

60
00:05:04,140 --> 00:05:10,290
OK, once that's done we're going to play the part selection for our external interruptive 13 because

61
00:05:10,290 --> 00:05:11,840
we're using PK 13.

62
00:05:12,690 --> 00:05:14,250
So this is what we do.

63
00:05:14,250 --> 00:05:17,370
We access this as config register and then we select this.

64
00:05:17,970 --> 00:05:21,810
Once we've cleared it, then we're going to select PK 13.

65
00:05:22,110 --> 00:05:24,700
Like I said this bit, I'm not going to elaborate.

66
00:05:25,310 --> 00:05:31,710
OK, and then once that is done, we unmask PK 13 like this.

67
00:05:33,450 --> 00:05:40,620
And then we're going to see that we want to detect falling trigger, we can detect in a rising age or

68
00:05:40,620 --> 00:05:43,440
a fall in edge, we want to say we want to detect fall in edge.

69
00:05:44,700 --> 00:05:48,200
So we said this are with this value.

70
00:05:48,630 --> 00:05:52,200
Once that is done, we can set the priority of this interrupt.

71
00:05:52,680 --> 00:06:00,150
I'm going to set it to priority six and I'm going to enable the interrupt over here again.

72
00:06:00,150 --> 00:06:02,730
If you want to learn more about this, there's a specialized course.

73
00:06:02,730 --> 00:06:09,750
I don't want you to come to me in the review or comment section telling me that I didn't explain this

74
00:06:09,750 --> 00:06:10,050
bit.

75
00:06:10,380 --> 00:06:10,800
Yes.

76
00:06:11,250 --> 00:06:14,460
Before this lesson, I said I wasn't going to explain this bit thoroughly.

77
00:06:14,880 --> 00:06:15,260
Right.

78
00:06:15,270 --> 00:06:16,800
Because there is a dedicated course.

79
00:06:16,800 --> 00:06:17,400
What a bit.

80
00:06:18,080 --> 00:06:25,470
OK, so traditionally or ordinarily, what I should have done is just uploaded of the file here called

81
00:06:25,820 --> 00:06:29,490
I don't see and told you download this file in order to a project.

82
00:06:29,490 --> 00:06:31,620
But I think that is more cryptic.

83
00:06:31,860 --> 00:06:38,000
Initially we went to the reference module to develop the the ATC one a bit.

84
00:06:38,310 --> 00:06:44,010
So now we need no go and look at each and every register and I need to explain each and every value

85
00:06:44,250 --> 00:06:47,150
because this is not a bare metal peripheral development course.

86
00:06:47,490 --> 00:06:49,940
So just bear with me, OK?

87
00:06:50,280 --> 00:06:52,260
After this runs, we can proceed.

88
00:06:52,650 --> 00:06:55,410
So we have to expose this to our.

89
00:06:56,340 --> 00:06:59,940
We have to expose this in a vault, so I'll copy this.

90
00:07:01,640 --> 00:07:02,950
And paste this over here.

91
00:07:06,910 --> 00:07:16,440
OK, controllers to save, controllers to save, and then let's build and see if there are any errors,

92
00:07:16,450 --> 00:07:20,530
I'm going to include adults age as well as adequate age.

93
00:07:20,550 --> 00:07:23,620
Yeah, you know, I may not see faults also include.

94
00:07:26,210 --> 00:07:27,140
XDA.

95
00:07:28,790 --> 00:07:29,370
The rich.

96
00:07:32,280 --> 00:07:35,550
Include ADC storage.

97
00:07:40,030 --> 00:07:41,770
OK, we have a bit of error.

98
00:07:42,050 --> 00:07:42,460
See?

99
00:07:43,780 --> 00:07:47,170
It's located in our ADC, Forelady Sidoti.

100
00:07:50,400 --> 00:07:51,270
What does it say?

101
00:07:51,300 --> 00:07:54,150
It says these are undeclared.

102
00:07:56,010 --> 00:07:58,800
It cannot locate the ADC data register.

103
00:07:59,960 --> 00:08:06,080
Of course, I forgot the arrow head as the arrow operator supposed to be, so let's click to build.

104
00:08:09,430 --> 00:08:14,740
OK, so it's built it's built successfully in the next lesson, we're going to test the drivers, we're

105
00:08:14,740 --> 00:08:18,960
going to test the ADC and the external enwrapped together.

106
00:08:19,270 --> 00:08:20,200
So I'll conclude you.

107
00:08:20,290 --> 00:08:21,010
I'll see you later.

108
00:08:21,010 --> 00:08:24,190
If you have any questions, leave them in the questions and answers area.

109
00:08:24,220 --> 00:08:24,670
See you.
