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