1
00:00:00,360 --> 00:00:00,710
Hello.

2
00:00:00,720 --> 00:00:01,710
Welcome back.

3
00:00:01,710 --> 00:00:08,280
As you may know memory holds code and data for the CPI to process and the input output.

4
00:00:08,280 --> 00:00:14,570
Ports are used by the CPI to access input and output devices into the microcontroller.

5
00:00:14,580 --> 00:00:17,470
We have two types of input output.

6
00:00:17,580 --> 00:00:25,890
They are the general purpose inputs outputs also known as TPA 0 and the special purpose input output.

7
00:00:25,890 --> 00:00:35,760
The GPI or the general purpose input output are useful interface and devices such as LCD switches LCD

8
00:00:36,050 --> 00:00:39,560
keypad DC motors etc..

9
00:00:39,780 --> 00:00:48,150
Special Purpose inputs outputs have designated functions functions such as analog to digital conversion

10
00:00:48,180 --> 00:00:56,730
digital to analog conversion time I use sage and universal asynchronous receiver transmitter order you

11
00:00:56,840 --> 00:00:58,550
out to.

12
00:00:58,680 --> 00:01:06,870
We're going to find on our microcontroller the same thing being configured as either a GPI or or a special

13
00:01:06,870 --> 00:01:14,220
purpose IO and would have to tell the microcontroller that we want to use this being for a special purpose

14
00:01:14,490 --> 00:01:23,820
or we want to use it for its normal general purpose right in a microcontroller Ps are grouped into ports

15
00:01:24,420 --> 00:01:34,650
such that we have a port a port to be port C etc. so each port has a number of pins for instance pin

16
00:01:34,710 --> 00:01:39,830
a one stands for being one of port a in the same way.

17
00:01:39,870 --> 00:01:47,130
If you see a pin such as this one pin E3 stands for pin 3 of port E.

18
00:01:47,520 --> 00:01:54,390
So when we access in these pins we've got to tell the the development environment the ports and the

19
00:01:54,390 --> 00:01:59,130
PIN number as well so all microcontrollers have this name in convention.

20
00:01:59,190 --> 00:02:02,500
They've got the pins grouped in ports right.

21
00:02:02,700 --> 00:02:09,690
But when you're using when you're using platforms like that we know and and and that you wouldn't need

22
00:02:09,690 --> 00:02:18,030
to indicate the ports of order the pin d Are we know Raphael the embed wrapper has taken care of all

23
00:02:18,030 --> 00:02:27,180
of that and if renamed these pins into simple names such as P1 through pin thirty P one through P. 30

24
00:02:27,420 --> 00:02:35,900
without indicating whether P 1 through p 5 fall under port E and then P 5 through P 10 fall under.

25
00:02:35,910 --> 00:02:40,940
Port B when you code in an embed or at when you need not worry about all of that.

26
00:02:41,060 --> 00:02:46,260
Now when you are doing bare metal coding you need to know the port as well as the PIN number.

27
00:02:46,260 --> 00:02:50,030
Off the top of the particular pin you want to access.

28
00:02:50,070 --> 00:02:58,200
Now let's talk about buses so moored in the cortex microcontrollers have two types of buses.

29
00:02:58,200 --> 00:03:05,340
They've got the advanced peripheral bus and they've also got the advanced high performance bus the advise

30
00:03:05,340 --> 00:03:13,260
pay for bus is often written us APB and the advanced high performance bus is often written as HP and

31
00:03:13,260 --> 00:03:19,530
we use in the advanced peripheral bus you you will require a minimum of two clock cycles to access a

32
00:03:19,530 --> 00:03:26,860
peripheral but with the advance high performance bus you can use even one clock cycle to access peripherals

33
00:03:27,190 --> 00:03:34,270
and we're going to go into the datasheet of four different cortex microcontrollers four from three different

34
00:03:34,270 --> 00:03:41,320
vendors and we'll see that these buses exist in all the microcontrollers whether it's it's a microcontroller

35
00:03:41,320 --> 00:03:47,010
from an XP whereas from Texas Instruments or whether it's from SD they've all got this.

36
00:03:47,020 --> 00:03:53,050
So let's take a look at the data sheet and locate these buses because one of the purpose of this course

37
00:03:53,050 --> 00:04:00,490
is to enable you to be able to go through the data sheet and the use of manuals of any microcontroller

38
00:04:00,490 --> 00:04:07,240
you're dealing with in order to work with peripherals and deal with things on your own as you improve

39
00:04:07,240 --> 00:04:09,770
your embedded development skills.

40
00:04:09,940 --> 00:04:17,020
Right now let's see how to locate the data sheets of our particular microcontroller and take a look

41
00:04:17,020 --> 00:04:20,570
at the deposit structure in the microcontroller.

42
00:04:20,700 --> 00:04:26,530
So I'm just going to go to Google and just search the name of the microcontroller followed by the word

43
00:04:26,770 --> 00:04:28,450
data sheet.

44
00:04:28,560 --> 00:04:30,440
I'll come over here too.

45
00:04:30,490 --> 00:04:31,690
Let's start with the SDM.

46
00:04:31,700 --> 00:04:34,970
That's to see SDM 32 for 1 1.

47
00:04:34,990 --> 00:04:40,570
R E the version of a microcontroller on my discovery board.

48
00:04:40,570 --> 00:04:42,720
Is this 1 4 4 1 1.

49
00:04:43,450 --> 00:04:48,480
But you can search this or search the F for 0 version.

50
00:04:48,520 --> 00:04:50,020
The information should be the same.

51
00:04:50,050 --> 00:04:50,860
Really.

52
00:04:51,010 --> 00:05:00,940
So I'll just select data sheet here and click here to go to the SD website and decide if called Download

53
00:05:00,940 --> 00:05:01,900
data sheet or what.

54
00:05:01,910 --> 00:05:02,950
Yes I can click here

55
00:05:07,660 --> 00:05:12,850
and this opens right so that there's the data sheet and that's the reference might know the data sheet.

56
00:05:12,850 --> 00:05:15,580
Use a summary of these particular MCU.

57
00:05:15,580 --> 00:05:22,540
It tells us the number of bare floors the the power consumption limits and things like the in the block

58
00:05:22,540 --> 00:05:23,280
diagram.

59
00:05:23,410 --> 00:05:30,730
You can think of the data sheet us the summary and the reference manual as indeed the reference manual.

60
00:05:30,730 --> 00:05:37,060
So the data sheet of a has one hundred and forty nine pages the reference manual often has over a thousand

61
00:05:37,060 --> 00:05:37,910
pages.

62
00:05:38,140 --> 00:05:38,790
Right.

63
00:05:38,830 --> 00:05:41,010
So I'm going to scroll down here.

64
00:05:41,080 --> 00:05:47,250
We should have the block diagram down here somewhere the block diagram of the system okay.

65
00:05:47,250 --> 00:05:49,170
Here we go.

66
00:05:49,170 --> 00:05:53,030
So I'm just going to click here to zoom and over here.

67
00:05:53,190 --> 00:06:00,630
So this the this the diagram of our microcontroller the block diagram and as you can see it's called

68
00:06:01,000 --> 00:06:03,060
HB bus here.

69
00:06:03,180 --> 00:06:10,470
This the HP bus and anything you see connected to this shows that we can connect to these peripheral

70
00:06:10,570 --> 00:06:20,190
use using the HP bus for instance we can connect to for instance PPR you put a can use HP bus port b

71
00:06:20,250 --> 00:06:29,490
you can use it HP as well but C put D port H can use HP right but it's not always the same for all peripherals

72
00:06:31,990 --> 00:06:40,660
this one here is an APB bus as you can see the name indicated here APB 1 we've got APB to here.

73
00:06:40,660 --> 00:06:50,080
So when coding we would keep in mind that we cannot initialize let's say the U UT on a U S too and try

74
00:06:50,080 --> 00:06:58,810
to initialize a using the HP bus because you say it hasn't got a HP bus we work with a user to use and

75
00:06:58,810 --> 00:07:00,220
the APD bus.

76
00:07:00,220 --> 00:07:01,090
Right.

77
00:07:01,120 --> 00:07:08,110
So this the bus structure of the SDM that's to F4 and we'll be revisiting the the MCU like I mentioned

78
00:07:08,110 --> 00:07:14,860
before one aim of this course is to give you the skills that would allow you to navigate the data sheet

79
00:07:15,100 --> 00:07:20,920
and the reference my law to solve your own problems as you improve your embedded development skills.

80
00:07:21,190 --> 00:07:23,060
So this the SDM board.

81
00:07:23,170 --> 00:07:29,920
Right next we're going to see the three boards or based on the architecture but from different manufacturers

82
00:07:30,280 --> 00:07:34,490
and you see that they've all got the HP an APB bus.

83
00:07:34,950 --> 00:07:35,450
OK.

84
00:07:35,470 --> 00:07:45,730
So I'm going to come over here and I'm gonna go to Google and I'm going to search T and for C..

85
00:07:45,890 --> 00:07:50,730
One two three G It's 6 p.m. and I'm weensy data sheet.

86
00:07:50,740 --> 00:07:59,020
This the TVC bought from Texas Instrument which opened this and it's open over here.

87
00:07:59,040 --> 00:08:02,810
Should I get a data sheet has over a thousand pages by.

88
00:08:02,830 --> 00:08:03,600
Fine.

89
00:08:03,610 --> 00:08:05,270
We still look at what we're looking for.

90
00:08:06,040 --> 00:08:11,630
Often the block diagram is somewhere below the table of contents and the list of figures.

91
00:08:11,710 --> 00:08:14,430
So you just need to scroll down sometimes.

92
00:08:14,470 --> 00:08:17,160
In fact didn't get on quality block diagram.

93
00:08:17,170 --> 00:08:23,290
They've got different names for this one we have search and quickly is to press control and F together

94
00:08:23,710 --> 00:08:24,810
and search the word.

95
00:08:24,820 --> 00:08:25,490
You looking for.

96
00:08:25,490 --> 00:08:27,840
So just a block diagram over here.

97
00:08:30,180 --> 00:08:35,310
Over here it says cortex M for F process or block background.

98
00:08:35,640 --> 00:08:43,350
So the f here means the cortex M4 has a floating point unit as well not all cortex and for floating

99
00:08:43,350 --> 00:08:44,650
point units.

100
00:08:44,850 --> 00:08:49,000
So this the CFMEU block diagram we have over here but we want.

101
00:08:49,080 --> 00:08:54,810
We don't want a block diagram of the process or we want to block diagram of the entire microcontroller.

102
00:08:54,810 --> 00:09:00,850
Remember the process or is just one part of the microcontroller right.

103
00:09:01,380 --> 00:09:05,270
We can come over here to see series overview.

104
00:09:05,270 --> 00:09:07,990
Right under the overview there should be a diagram.

105
00:09:08,000 --> 00:09:08,760
Here you go.

106
00:09:09,340 --> 00:09:11,090
OK so over here.

107
00:09:11,090 --> 00:09:14,380
This is the diagram for the Texas Instrument board.

108
00:09:14,450 --> 00:09:16,420
The team 4C 1 2 3.

109
00:09:16,490 --> 00:09:22,190
As you can see we've got the advanced high performance bus the HP bus here and we've got the advanced

110
00:09:22,270 --> 00:09:25,120
for bus here in the same way.

111
00:09:25,310 --> 00:09:33,040
Only those with the arrow connect into the HP bus can use the HP bus those without the arrow connecting

112
00:09:33,040 --> 00:09:34,040
to the HP bus.

113
00:09:34,040 --> 00:09:35,680
Can we use the HP bus.

114
00:09:36,080 --> 00:09:40,440
So let's see an example of what I mean.

115
00:09:40,610 --> 00:09:43,560
This the HP bus we've got over here.

116
00:09:43,670 --> 00:09:45,550
For instance this payphone on us.

117
00:09:45,600 --> 00:09:52,200
SS I cannot use HP as I can see its arrow is pointing to the APB.

118
00:09:53,210 --> 00:09:53,960
Right.

119
00:09:54,080 --> 00:10:03,420
And this ADC here this on a low comp. here is pointing to AP In the same way the 12th bit ADC is pointing

120
00:10:03,420 --> 00:10:14,140
to AP and we have the DME the DMA is able to use both the HP bus and the AP bus right and we've got

121
00:10:14,140 --> 00:10:18,980
a time here the watchdog time on using just the APB bus.

122
00:10:19,090 --> 00:10:21,120
We'll talk about all of these air force later.

123
00:10:21,130 --> 00:10:27,990
So you need not worry this is just to show you the bus structure that exist in the various microcontrollers.

124
00:10:28,290 --> 00:10:31,540
Okay so let's see the third microcontroller.

125
00:10:31,540 --> 00:10:33,820
Let's try the one from an XP.

126
00:10:34,000 --> 00:10:41,860
I'm going to search and XP the popular LPC 1 7 6 8 microcontroller

127
00:10:45,150 --> 00:10:47,210
on this the embed board.

128
00:10:47,570 --> 00:10:51,470
Yeah but we won the data sheet.

129
00:10:51,620 --> 00:10:53,590
You can see use a manual as well.

130
00:10:54,810 --> 00:10:55,400
Okay.

131
00:10:56,340 --> 00:11:07,220
So open the user manual for LPC 176 exits slash 5 x so search they use a manual for LPC 176.

132
00:11:07,370 --> 00:11:08,030
Okay.

133
00:11:08,240 --> 00:11:09,650
And it's open over here.

134
00:11:09,650 --> 00:11:12,640
This is it right in the same way.

135
00:11:12,650 --> 00:11:15,760
We can just to control F and block that from here.

136
00:11:18,600 --> 00:11:21,350
So this what it means to be an embedded systems developer.

137
00:11:21,360 --> 00:11:24,970
You should be able to work with any microcontroller you provided with.

138
00:11:24,990 --> 00:11:32,160
Often people keep themselves in the comfort zone thinking okay because I work we just SD microelectronics

139
00:11:32,550 --> 00:11:36,600
it's going to be hard to switch to a different vendor.

140
00:11:36,810 --> 00:11:42,630
But that's not a case if you know how to use the data sheet and navigate things like the data sheet

141
00:11:42,630 --> 00:11:43,880
and the user manual.

142
00:11:44,040 --> 00:11:51,240
You'll be equally comfortable working with microcontrollers from different Silicon manufacturers right.

143
00:11:51,250 --> 00:11:51,580
Sure.

144
00:11:51,620 --> 00:11:52,820
OK we've got this.

145
00:11:52,830 --> 00:11:58,880
It says simplified block diagram Nass can see we've got the buses here and this over here.

146
00:11:58,890 --> 00:12:05,470
This bus comes here and this difficult in the air system difficulty mortally at HP matrix.

147
00:12:05,520 --> 00:12:11,740
So this bus here is an APB matrix and as HB 2 APB bridge there's a bridge here.

148
00:12:11,860 --> 00:12:17,610
I can see all of these peripherals used the APB bus hence the are called the APB slave group.

149
00:12:17,630 --> 00:12:21,270
What these peripheral issues the APB as well.

150
00:12:21,600 --> 00:12:25,290
And there is an HB to APB bridge over here.

151
00:12:25,290 --> 00:12:25,790
Right.

152
00:12:25,800 --> 00:12:32,000
So these hard core core text M standards they exist in all core text process source.
