Hello.
Welcome back.
As you may know memory holds code and data for the CPI to process and the input output.
Ports are used by the CPI to access input and output devices into the microcontroller.
We have two types of input output.
They are the general purpose inputs outputs also known as TPA 0 and the special purpose input output.
The GPI or the general purpose input output are useful interface and devices such as LCD switches LCD
keypad DC motors etc..
Special Purpose inputs outputs have designated functions functions such as analog to digital conversion
digital to analog conversion time I use sage and universal asynchronous receiver transmitter order you
out to.
We're going to find on our microcontroller the same thing being configured as either a GPI or or a special
purpose IO and would have to tell the microcontroller that we want to use this being for a special purpose
or we want to use it for its normal general purpose right in a microcontroller Ps are grouped into ports
such that we have a port a port to be port C etc. so each port has a number of pins for instance pin
a one stands for being one of port a in the same way.
If you see a pin such as this one pin E3 stands for pin 3 of port E.
So when we access in these pins we've got to tell the the development environment the ports and the
PIN number as well so all microcontrollers have this name in convention.
They've got the pins grouped in ports right.
But when you're using when you're using platforms like that we know and and and that you wouldn't need
to indicate the ports of order the pin d Are we know Raphael the embed wrapper has taken care of all
of that and if renamed these pins into simple names such as P1 through pin thirty P one through P. 30
without indicating whether P 1 through p 5 fall under port E and then P 5 through P 10 fall under.
Port B when you code in an embed or at when you need not worry about all of that.
Now when you are doing bare metal coding you need to know the port as well as the PIN number.
Off the top of the particular pin you want to access.
Now let's talk about buses so moored in the cortex microcontrollers have two types of buses.
They've got the advanced peripheral bus and they've also got the advanced high performance bus the advise
pay for bus is often written us APB and the advanced high performance bus is often written as HP and
we use in the advanced peripheral bus you you will require a minimum of two clock cycles to access a
peripheral but with the advance high performance bus you can use even one clock cycle to access peripherals
and we're going to go into the datasheet of four different cortex microcontrollers four from three different
vendors and we'll see that these buses exist in all the microcontrollers whether it's it's a microcontroller
from an XP whereas from Texas Instruments or whether it's from SD they've all got this.
So let's take a look at the data sheet and locate these buses because one of the purpose of this course
is to enable you to be able to go through the data sheet and the use of manuals of any microcontroller
you're dealing with in order to work with peripherals and deal with things on your own as you improve
your embedded development skills.
Right now let's see how to locate the data sheets of our particular microcontroller and take a look
at the deposit structure in the microcontroller.
So I'm just going to go to Google and just search the name of the microcontroller followed by the word
data sheet.
I'll come over here too.
Let's start with the SDM.
That's to see SDM 32 for 1 1.
R E the version of a microcontroller on my discovery board.
Is this 1 4 4 1 1.
But you can search this or search the F for 0 version.
The information should be the same.
Really.
So I'll just select data sheet here and click here to go to the SD website and decide if called Download
data sheet or what.
Yes I can click here
and this opens right so that there's the data sheet and that's the reference might know the data sheet.
Use a summary of these particular MCU.
It tells us the number of bare floors the the power consumption limits and things like the in the block
diagram.
You can think of the data sheet us the summary and the reference manual as indeed the reference manual.
So the data sheet of a has one hundred and forty nine pages the reference manual often has over a thousand
pages.
Right.
So I'm going to scroll down here.
We should have the block diagram down here somewhere the block diagram of the system okay.
Here we go.
So I'm just going to click here to zoom and over here.
So this the this the diagram of our microcontroller the block diagram and as you can see it's called
HB bus here.
This the HP bus and anything you see connected to this shows that we can connect to these peripheral
use using the HP bus for instance we can connect to for instance PPR you put a can use HP bus port b
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
this one here is an APB bus as you can see the name indicated here APB 1 we've got APB to here.
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
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
the APD bus.
Right.
So this the bus structure of the SDM that's to F4 and we'll be revisiting the the MCU like I mentioned
before one aim of this course is to give you the skills that would allow you to navigate the data sheet
and the reference my law to solve your own problems as you improve your embedded development skills.
So this the SDM board.
Right next we're going to see the three boards or based on the architecture but from different manufacturers
and you see that they've all got the HP an APB bus.
OK.
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..
One two three G It's 6 p.m. and I'm weensy data sheet.
This the TVC bought from Texas Instrument which opened this and it's open over here.
Should I get a data sheet has over a thousand pages by.
Fine.
We still look at what we're looking for.
Often the block diagram is somewhere below the table of contents and the list of figures.
So you just need to scroll down sometimes.
In fact didn't get on quality block diagram.
They've got different names for this one we have search and quickly is to press control and F together
and search the word.
You looking for.
So just a block diagram over here.
Over here it says cortex M for F process or block background.
So the f here means the cortex M4 has a floating point unit as well not all cortex and for floating
point units.
So this the CFMEU block diagram we have over here but we want.
We don't want a block diagram of the process or we want to block diagram of the entire microcontroller.
Remember the process or is just one part of the microcontroller right.
We can come over here to see series overview.
Right under the overview there should be a diagram.
Here you go.
OK so over here.
This is the diagram for the Texas Instrument board.
The team 4C 1 2 3.
As you can see we've got the advanced high performance bus the HP bus here and we've got the advanced
for bus here in the same way.
Only those with the arrow connect into the HP bus can use the HP bus those without the arrow connecting
to the HP bus.
Can we use the HP bus.
So let's see an example of what I mean.
This the HP bus we've got over here.
For instance this payphone on us.
SS I cannot use HP as I can see its arrow is pointing to the APB.
Right.
And this ADC here this on a low comp. here is pointing to AP In the same way the 12th bit ADC is pointing
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
a time here the watchdog time on using just the APB bus.
We'll talk about all of these air force later.
So you need not worry this is just to show you the bus structure that exist in the various microcontrollers.
Okay so let's see the third microcontroller.
Let's try the one from an XP.
I'm going to search and XP the popular LPC 1 7 6 8 microcontroller
on this the embed board.
Yeah but we won the data sheet.
You can see use a manual as well.
Okay.
So open the user manual for LPC 176 exits slash 5 x so search they use a manual for LPC 176.
Okay.
And it's open over here.
This is it right in the same way.
We can just to control F and block that from here.
So this what it means to be an embedded systems developer.
You should be able to work with any microcontroller you provided with.
Often people keep themselves in the comfort zone thinking okay because I work we just SD microelectronics
it's going to be hard to switch to a different vendor.
But that's not a case if you know how to use the data sheet and navigate things like the data sheet
and the user manual.
You'll be equally comfortable working with microcontrollers from different Silicon manufacturers right.
Sure.
OK we've got this.
It says simplified block diagram Nass can see we've got the buses here and this over here.
This bus comes here and this difficult in the air system difficulty mortally at HP matrix.
So this bus here is an APB matrix and as HB 2 APB bridge there's a bridge here.
I can see all of these peripherals used the APB bus hence the are called the APB slave group.
What these peripheral issues the APB as well.
And there is an HB to APB bridge over here.
Right.
So these hard core core text M standards they exist in all core text process source.