1
00:00:01,600 --> 00:00:02,180
Hello.

2
00:00:02,230 --> 00:00:02,890
Welcome back.

3
00:00:02,890 --> 00:00:07,120
So let's write to a driver.

4
00:00:07,480 --> 00:00:10,060
I'm gonna start off by putting my directives

5
00:00:13,200 --> 00:00:15,110
just pitch them here like this.

6
00:00:15,610 --> 00:00:16,090
And

7
00:00:19,490 --> 00:00:21,650
it just creates a bit of space on here.

8
00:00:23,510 --> 00:00:28,820
And on the score on the score Main and we start off by

9
00:00:32,800 --> 00:00:44,000
enabling know what GPL you Bill GPL you win it and then what I'm gonna do is um could you post the video

10
00:00:44,060 --> 00:00:48,930
and try to implement the GPL you in its subroutine on your own.

11
00:00:49,100 --> 00:00:54,050
And once you are done you can on post it and we do it together.

12
00:00:56,120 --> 00:00:56,730
Okay.

13
00:00:56,840 --> 00:00:58,270
Now let's see how that is done.

14
00:00:58,280 --> 00:01:01,350
We've done this on multiple occasions.

15
00:01:01,790 --> 00:01:07,250
So this is the name of the subroutine.

16
00:01:07,400 --> 00:01:09,200
I'm gonna start off by

17
00:01:12,290 --> 00:01:24,930
by enabling DRM the clock access to Q You f first would do this and then think I'm gonna do this faster.

18
00:01:25,050 --> 00:01:25,530
Load

19
00:01:29,780 --> 00:01:35,290
as you are one and then we perform all

20
00:01:38,350 --> 00:01:56,110
our zero hours zero then GPL you F E N and then we store our 0 0 1 and then we wait for a while by using

21
00:01:56,110 --> 00:01:56,930
n o p.

22
00:01:57,640 --> 00:02:02,650
Once that is done the direction register we're gonna use GPL U.

23
00:02:02,950 --> 00:02:09,520
Um I'm gonna use the red LCD here so I'm gonna do a load of the line.

24
00:02:09,530 --> 00:02:09,940
This would be

25
00:02:16,890 --> 00:02:18,360
when I do load R 1

26
00:02:24,420 --> 00:02:27,570
GPL you f d I register the

27
00:02:31,040 --> 00:02:37,990
and then load r 0 are 1 and then all

28
00:02:41,840 --> 00:02:43,190
hours you 5 0

29
00:02:46,860 --> 00:02:47,560
Libby red

30
00:02:53,980 --> 00:03:00,920
and then store a zero hour one like this.

31
00:03:02,240 --> 00:03:11,690
So this was said the red pen as output next week and digitally enabled a pin load.

32
00:03:15,150 --> 00:03:15,980
Load one

33
00:03:19,580 --> 00:03:24,560
next we do digital in April by access and the digital enabled register.

34
00:03:25,840 --> 00:03:26,600
And on this score.

35
00:03:26,600 --> 00:03:27,080
Ah.

36
00:03:27,110 --> 00:03:29,120
And then load

37
00:03:33,300 --> 00:03:41,270
our zero hour one and then all our zero hours zero

38
00:03:43,870 --> 00:03:48,940
the only Democrat pin and then we store

39
00:03:51,970 --> 00:03:55,430
our zero hour one.

40
00:03:55,550 --> 00:03:59,620
Then this is done we can return from the subroutine

41
00:04:04,690 --> 00:04:05,180
right.

42
00:04:05,810 --> 00:04:06,440
So next.

43
00:04:06,460 --> 00:04:08,850
Well we have to do is implement the.

44
00:04:08,850 --> 00:04:13,270
They cannot function to initialize the cystic timer.

45
00:04:13,300 --> 00:04:13,590
Okay.

46
00:04:13,620 --> 00:04:24,600
So once we once we enable what you call you would enable our system timer so we branch to be a

47
00:04:31,320 --> 00:04:34,440
stick on us go in it.

48
00:04:34,440 --> 00:04:38,640
So I'm gonna copy this then come here.

49
00:04:38,670 --> 00:04:40,680
So stick in it.

50
00:04:40,740 --> 00:04:46,350
So first what we do is we um what you say about a cystic timeout before we change anything.

51
00:04:46,350 --> 00:04:49,740
It is advisable to disable it so I'm gonna do.

52
00:04:49,770 --> 00:04:59,100
Load our one and then I'm going to so uh select the cystic control register that is where we enable

53
00:04:59,100 --> 00:05:02,960
and disable the.

54
00:05:03,010 --> 00:05:05,590
I'm gonna move zero into our zero

55
00:05:09,330 --> 00:05:17,890
and then I'm gonna put that into the system control register by saying install our 0 are 1 like this.

56
00:05:18,490 --> 00:05:18,850
Right.

57
00:05:18,850 --> 00:05:25,870
Once we've disabled it we going to load the maximum value to devalue into the um the reload register.

58
00:05:25,930 --> 00:05:30,760
D you x 0 0 f f f f so I'm gonna do it.

59
00:05:30,760 --> 00:05:36,670
Load R 1 course and Vic

60
00:05:40,760 --> 00:05:41,560
t reload

61
00:05:48,990 --> 00:05:59,330
and then I'm gonna load r 0 and there's just going to be the constant s one over here.

62
00:05:59,490 --> 00:06:07,730
Put this into our 0 and then I'm gonna do store r zero R 1.

63
00:06:09,210 --> 00:06:15,950
Okay so once that is done we need to clear a cystic current register and to clear this as the car register

64
00:06:15,960 --> 00:06:21,990
we will need to write a new value into that register so we can simply write C with the m gonna do load

65
00:06:22,820 --> 00:06:31,500
R 1 and Vic SD current score R then move

66
00:06:34,240 --> 00:06:42,410
our 0 Number 0 and then store our 0 r 1 right.

67
00:06:42,470 --> 00:06:49,930
So once that is done we can enable our cystic timer to load by 1.

68
00:06:50,000 --> 00:06:58,790
I'm gonna go back to the cystic control register by doing n fake SD c t RL on a score R and then

69
00:07:01,760 --> 00:07:08,160
I'm going to select a clock source as well as enable it all in this block.

70
00:07:08,240 --> 00:07:12,350
Gonna do move our 0.

71
00:07:13,310 --> 00:07:21,200
I'm gonna do with a constant for enabling this one here.

72
00:07:21,200 --> 00:07:26,780
It's like performing an operation twice a C plus then I'm gonna do a clock source

73
00:07:32,230 --> 00:07:38,530
like this once this is done I'm gonna do move r 0

74
00:07:42,280 --> 00:07:44,430
now I've already done move of store

75
00:07:47,280 --> 00:07:56,930
our 0 r 1 and then B x A law okay.

76
00:07:56,950 --> 00:07:57,830
Looks good.

77
00:07:57,840 --> 00:08:03,420
So in the next lesson we going to implement the cystic weight subroutines.

78
00:08:03,450 --> 00:08:06,240
These are what DeLay subroutines will see in the next.
