1
00:00:00,990 --> 00:00:01,310
Hello.

2
00:00:01,320 --> 00:00:02,280
Welcome back.

3
00:00:02,280 --> 00:00:05,630
So let's test out what you to drive.

4
00:00:06,150 --> 00:00:16,410
I'm gonna create symbolic names for some commonly used keys that um we use keys such as delete space

5
00:00:16,620 --> 00:00:24,000
escape backspace carriage return line feed etc. These aren't keys like ABC.

6
00:00:24,030 --> 00:00:27,460
So um I'll say see are here for carriage return.

7
00:00:27,480 --> 00:00:30,340
These are standard ASCII symbols.

8
00:00:30,570 --> 00:00:41,370
This one is represented by 0 x 0 D and then I'm gonna have P S for backspace to clean something.

9
00:00:41,520 --> 00:00:45,130
This is represented by your ex.

10
00:00:45,310 --> 00:00:45,710
Sure.

11
00:00:45,720 --> 00:00:46,200
8.

12
00:00:46,890 --> 00:00:50,370
And then we going to have Elif for line feed.

13
00:00:50,440 --> 00:00:51,900
You can you.

14
00:00:51,930 --> 00:00:56,110
This is going to be represented by your ex to a.

15
00:00:56,610 --> 00:00:58,410
And we're going to have escape.

16
00:00:58,590 --> 00:00:59,530
Yes.

17
00:00:59,700 --> 00:01:01,830
See you can.

18
00:01:01,860 --> 00:01:06,000
This is going to be represented by your ex one beat.

19
00:01:06,560 --> 00:01:09,390
Then we're going to have this space.

20
00:01:09,570 --> 00:01:15,130
This is going to be represented by 2 x 2 0.

21
00:01:15,990 --> 00:01:33,260
And then we're going to have delete which we should represent by E Q You sure x 7 f Okay 7 F right.

22
00:01:33,570 --> 00:01:33,860
So.

23
00:01:33,860 --> 00:01:35,520
To Rome to go to the new line.

24
00:01:35,520 --> 00:01:38,430
We need to send carriage return and line feet.

25
00:01:38,460 --> 00:01:40,410
So we need to send two characters.

26
00:01:40,470 --> 00:01:49,290
I'm going to create I'm going to create Tom I'm gonna create a label or a subroutine for new line cause

27
00:01:49,620 --> 00:01:51,930
it takes two characters to send a new line.

28
00:01:51,950 --> 00:01:55,600
Wanna come over here and just put a label here.

29
00:01:55,650 --> 00:01:58,110
You line.

30
00:01:58,260 --> 00:02:00,470
This which we'll use to send you lines.

31
00:02:00,480 --> 00:02:04,090
We start off by saving and down the link register.

32
00:02:04,170 --> 00:02:04,680
Push

33
00:02:07,520 --> 00:02:07,900
LR

34
00:02:11,690 --> 00:02:14,250
And then we start off by.

35
00:02:14,620 --> 00:02:19,380
And then we move or courage return into register our hero.

36
00:02:21,260 --> 00:02:21,520
Yeah.

37
00:02:21,530 --> 00:02:22,550
Carriage return.

38
00:02:22,550 --> 00:02:24,010
And then once we've moved it.

39
00:02:24,050 --> 00:02:27,380
Remember Irish euro is like the variable speed.

40
00:02:27,410 --> 00:02:30,470
I just thought I heard the argument for a while.

41
00:02:30,500 --> 00:02:33,370
You are to write character subroutine.

42
00:02:33,560 --> 00:02:40,400
So then once we've moved this into our issue we can branch to the subroutine to send it.

43
00:02:41,750 --> 00:03:00,800
And then once we've done that we don't move our 0 line feet and then yell out you at the right character

44
00:03:01,220 --> 00:03:01,950
and then.

45
00:03:03,250 --> 00:03:11,060
Okay so when we push link register we got to pop the program counter register which is P.C. and then

46
00:03:12,920 --> 00:03:21,470
over here we pop APC in our you know uh you add in net we started by pushing link register and then

47
00:03:21,470 --> 00:03:23,900
we pop the program counter register.

48
00:03:23,990 --> 00:03:24,420
Okay.

49
00:03:24,440 --> 00:03:27,710
If I get also we forgot to a line.

50
00:03:27,770 --> 00:03:34,300
This is the last subroutine does the end of the far end of a here and then I'm going to clean the space.

51
00:03:34,310 --> 00:03:35,210
We created

52
00:03:40,250 --> 00:03:41,600
goodness.

53
00:03:41,600 --> 00:03:44,750
Anyway I'm gonna go up there now.

54
00:03:44,810 --> 00:03:47,450
We've got this new line so we can try this out.

55
00:03:50,330 --> 00:03:57,140
We can simply um we start off by initialize in a way you UT and then um we can.

56
00:03:58,580 --> 00:04:00,400
We can send a character a.

57
00:04:00,440 --> 00:04:03,080
And see what we get.

58
00:04:03,080 --> 00:04:04,810
I'm gonna come over here.

59
00:04:07,820 --> 00:04:17,930
I'm gonna do a hobo rather than send a we're going to send a B C D E to C out send a C so I don't move

60
00:04:17,930 --> 00:04:21,070
our for over here.

61
00:04:21,080 --> 00:04:32,170
There should be a b o here or to move R for the character a.

62
00:04:32,730 --> 00:04:39,800
And then once that is done I'm gonna take orders in our form and put into our shoe move

63
00:04:44,610 --> 00:04:45,510
into our ask.

64
00:04:45,580 --> 00:04:47,130
What is in order for.

65
00:04:47,170 --> 00:04:48,400
And then once they stand.

66
00:04:48,400 --> 00:04:50,110
I'm going to write it.

67
00:04:50,560 --> 00:04:53,770
Oh you're.

68
00:04:56,000 --> 00:04:56,540
Right.

69
00:04:56,560 --> 00:04:57,420
Correct.

70
00:04:57,410 --> 00:04:59,600
Uh right.

71
00:04:59,600 --> 00:05:06,220
And once that is done I'm going to add one to what is in order for it to go to the next character in

72
00:05:06,220 --> 00:05:07,880
the alphabet.

73
00:05:07,930 --> 00:05:18,700
I can simply do it for our add 1 2 our 4 and store the results back into our for like this and then

74
00:05:18,760 --> 00:05:21,430
I'll check what the character is see.

75
00:05:21,490 --> 00:05:29,740
I want to stop at outsourcing so I can do simply R for compare what is an R for with the characters.

76
00:05:35,980 --> 00:05:39,490
If so skip complete.

77
00:05:39,580 --> 00:05:44,430
If it's not easy then we can keep growing it.

78
00:05:44,490 --> 00:05:46,930
I'm gonna use cup to see LDP Ellis

79
00:05:50,840 --> 00:05:53,280
B less well p zero.

80
00:05:53,490 --> 00:05:57,090
Okay we'll come back to the top here.

81
00:05:57,120 --> 00:05:58,170
This is LP 0.

82
00:05:58,380 --> 00:05:58,760
Okay.

83
00:06:03,250 --> 00:06:03,720
Then

84
00:06:07,680 --> 00:06:09,490
once we are done we can.

85
00:06:10,050 --> 00:06:16,170
Yeah we can go to a new line if we want to peel branch.

86
00:06:16,200 --> 00:06:19,370
We created a label for new lines so we can simply see a new line.

87
00:06:19,740 --> 00:06:23,390
And then we do move our 0.

88
00:06:23,460 --> 00:06:35,220
I'm gonna write exclamation SIGN HERE LIKE THIS AND THEN WE CAN BE ABLE TO COME TO YOU AT

89
00:06:39,060 --> 00:06:40,540
A Scott rights character

90
00:06:46,470 --> 00:06:51,160
and then yeah I think

91
00:06:55,150 --> 00:06:58,500
we can pull a loop somewhere and try this out.

92
00:07:00,190 --> 00:07:00,800
Okay.

93
00:07:00,940 --> 00:07:03,880
So let's see how this operates.

94
00:07:03,910 --> 00:07:05,950
You start from here.

95
00:07:05,950 --> 00:07:10,610
Come over here and then we run to the end.

96
00:07:11,620 --> 00:07:13,180
Okay so let's put and see.

97
00:07:13,180 --> 00:07:17,690
I suspect we may have a number of arrows over here.

98
00:07:17,710 --> 00:07:18,580
We have two arrows.

99
00:07:18,580 --> 00:07:30,780
Symbol not defined to which symbol is this you at zero f or register K as should be on equal sign here.

100
00:07:30,880 --> 00:07:33,110
Come on missin.

101
00:07:33,880 --> 00:07:36,010
Okay.

102
00:07:36,210 --> 00:07:41,660
Click here to build it SPRO successfully system control our CTC GPI.

103
00:07:41,770 --> 00:07:51,020
On the score are not defined RC GC GPA you are unless you want a name what name would give the register

104
00:07:51,590 --> 00:07:56,160
I GC GP who is from the word CIS control.

105
00:07:56,220 --> 00:07:57,510
No problem.

106
00:07:58,230 --> 00:08:00,710
Um I'll just copy it and bring it over here.

107
00:08:05,420 --> 00:08:08,200
Uh this should be r c No.

108
00:08:09,240 --> 00:08:10,350
Our GC.

109
00:08:10,370 --> 00:08:10,700
Okay

110
00:08:13,490 --> 00:08:15,000
our GC okay.

111
00:08:15,150 --> 00:08:16,310
Build.

112
00:08:16,470 --> 00:08:19,020
Now let's download onto our board and see what we have

113
00:08:21,930 --> 00:08:26,130
actually before we download onto a board to a number of things we need to take care of.

114
00:08:26,650 --> 00:08:27,160
Um.

115
00:08:27,300 --> 00:08:28,380
Come to your.

116
00:08:28,680 --> 00:08:29,460
Come over here.

117
00:08:29,460 --> 00:08:30,110
Device.

118
00:08:30,150 --> 00:08:33,980
And then start up the S S file in the Reset handler.

119
00:08:33,990 --> 00:08:37,170
I'd like you to comment all these uh these two lines.

120
00:08:37,170 --> 00:08:42,960
There was something in the system in it that interferes with I want you to drive us it is currently.

121
00:08:43,200 --> 00:08:46,280
So we need to combine these two instructions.

122
00:08:46,380 --> 00:08:48,960
These two lines from the reset handler.

123
00:08:48,960 --> 00:08:53,290
Once you've done the um less Inspector code again.

124
00:08:53,590 --> 00:08:54,310
Um.

125
00:08:54,360 --> 00:08:57,630
Over here I realized there was an anomaly over here.

126
00:08:58,050 --> 00:09:02,290
When we came in we looked at the line control register and I did.

127
00:09:02,650 --> 00:09:06,940
Um I'd ask you are sure you hear this word here.

128
00:09:06,960 --> 00:09:09,560
I suspect initially it was an end.

129
00:09:09,570 --> 00:09:11,690
It has to be at mistyped.

130
00:09:12,150 --> 00:09:22,680
And then over here we use in line control word land underscore H plus FIFO and enable so verify that

131
00:09:23,040 --> 00:09:26,480
you have this corrected over here like this.

132
00:09:26,850 --> 00:09:27,150
Right.

133
00:09:27,180 --> 00:09:36,990
So this has to be done and over here to the p c t r l Well we when we did a configuration remember to

134
00:09:36,990 --> 00:09:39,810
store it back into the register store.

135
00:09:39,810 --> 00:09:46,250
STATEMENT HERE AND OVER HERE IN OUR you at our read character in right.

136
00:09:46,250 --> 00:09:49,530
Correct a subroutine the end here has an s at the end.

137
00:09:49,560 --> 00:09:53,250
S and s and end s over here.

138
00:09:53,250 --> 00:09:53,960
Right.

139
00:09:54,000 --> 00:09:58,010
So once you've verified all of these changes then we can build again.

140
00:10:00,210 --> 00:10:06,450
And then once it's built successfully we can download onto a board to download.

141
00:10:08,130 --> 00:10:13,370
I'm going to open my serial program com 8 and then okay.

142
00:10:13,650 --> 00:10:21,270
Then I'll come to set up serial port and then I'll set a speed to one hundred and fifteen thousand two

143
00:10:21,270 --> 00:10:25,170
hundred and then okay and then I'll press to reset my port.

144
00:10:25,200 --> 00:10:27,410
And as you can see this is what we said.

145
00:10:27,420 --> 00:10:33,300
We said we're right in a through z and then exclamation sign and a new line.

146
00:10:33,300 --> 00:10:34,360
So this is it.

147
00:10:34,520 --> 00:10:40,470
You are the driver is working just like we've configured it so in the next lesson what we're going to

148
00:10:40,470 --> 00:10:47,860
do is we going to make our U S driver accessible from the from a c file.

149
00:10:47,880 --> 00:10:49,980
I think that is much more practical.

150
00:10:49,980 --> 00:10:56,340
It's much more practical to have the drivers initialization and subroutines written in assembly and

151
00:10:56,340 --> 00:11:02,650
then calling them in C so in C language we're going to test print FS can't f we see both.

152
00:11:02,700 --> 00:11:07,780
We'll see bi directional you at you know communication essentially we'll be able to read and write characters

153
00:11:07,810 --> 00:11:08,350
there.

154
00:11:08,730 --> 00:11:09,360
Right.

155
00:11:09,390 --> 00:11:14,220
So this order is for this lesson and I'm going to attach my project to the to the video.

156
00:11:14,220 --> 00:11:20,960
So if you face any arrows or yours it's not working like mine you can simply download a project attach

157
00:11:20,970 --> 00:11:23,880
to the video and try it out right.

158
00:11:23,880 --> 00:11:26,630
So this all there is and I shall see you in the next lesson.
