Hello fellas.
Welcome back.
So in this lesson we shall look at another essential components of the embedded system the memory an
embedded system has to have some form of memory to store and execute code.
And when we look up memory we can compare them in terms of price performance and power consumption.
For instance if a memory has to run twice as fast to maintain desired bond with the memory power consumption
requirements may be higher.
This curve depicts the the memory hierarchy.
First you must know that all computer systems have memory arranged in some form of hierarchy.
This graph shows the arm.
The memory trade of the fastest memory is the cache memory and is physically located nearer to the process
of call and the slowest memory system is the secondary storage which is set further away from the processor.
Generally speaking the closer the memory is to the process all the more its costs and the smaller its
capacity the cache is placed between the main memory and the call and its use to speed up data transfer
between the process all and the main memory which all week some into cash on its own later but for now
you only need to remember that the cash provides an overall increase in performance and it comes with
a loss of predictable execution time though.
And this only becomes a problem when when you do it in a real time application the main memory is large.
It's in it's an megabytes mostly and sometimes even an gigabyte depending on the application and and
it may memory is generally a separate chip from the from the process so as we shall see later load and
store instructions access the main memory unless the value have been stored into cash for fast access.
You can think of the young secondary memory as your everyday flash disc your hard disk or your seedy
rom.
Now let's take a look at some parameters we pay attention to when looking up memory.
So let's start with the memory with the memory with is basically the number of bits the memory returns
on each on each access and it comes in the sizes of 16 bit 32 bits and 64 bit memory with us direct
effect on overall performance.
For instance if you have a system without cash memory using 32 bit instructions and 16 bits wide memory
chips to process or have to make to memory fetches pet instruction because each fetch can only carry
sixteen bits load.
This of course has the effect of reducing the system performance but the upside is sixteen bits memory
is less expensive.
In contrast if the call executed 16 bit thumb instructions it will achieve better up to four months
with a sixteen bits memory because the call will make a single fetch to memory to load an instruction
as we shall see in this course.
The ARM processor is capable of executing three instruction sets the instruction sets which has 32 bit
instructions the thumb instruction sets which are sixteen bits instructions and a thumb to instruction
sets which uses both sixteen bits and sets two bits instructions.
Let's see how the arm and thumb instructions compare when using different memory with the ARM instruction
the ARM instruction set is that two bits in size like we mentioned.
So if they're with off the memory is 8 bits the processor would need four cycles to fetch a single instruction
if the width of the memory is 16 bits the process will require two cycles better instruction.
And if the width of the memory is 32 bits then the process will require a single cycle pair instruction.
On the other hand the instruction set has instructions with 16 bits of size.
Therefore we turn 8 bits memory with the process eight uses two cycles to fetch a single instruction
and we have sixteen bits memory with the process or will require a single cycle to fetch a single instruction
with a 32 bit memory with the process will still require a single cycle to fetch a single instruction.
Now let's take a look at some of the commonly used memory types we would find in embedded devices.
The room cannot be reprogrammed and the flush room is a type of from that can return to as well as read
but it is slow to write too so it's not used for hold in dynamic data.
Its main uses for holding the device firm were storing long term data that needs to be preserved.
After the power is off the dynamic random access memory is the most commonly used type of Rob for devices.
It has the lowest cost per megabyte compared with other types of firearm the s ROM which stands for
static random access memory is faster than D D ROM its access time is considerably shorter than the
equivalent do run because s run does not require pauses between data access the SD Iran is a subcategory
of the RAM and it is capable of running at fast faster clock frequencies.
The EP from which stands for the electrically reasonable programmable read only memory is used for program
cold storage most often for saving critical data.
Not all ARM chips have an on chip approach.
Now let's look at a simplified memory space allocation diagram for an armed device typically has four
gigabytes of directly accessible memory space.
Now why is that.
Remember cause it two bits course and you are fit two bits cause because the internal registers of that
two bits the data paths out there's two bits and a boss interfaces off it to bits.
The bits size allows the CPSU to address a memory for an individual a process so an expert can handle
two to the power X byte of memory the higher the bid size the higher the performance.
Therefore a 32 bit can handle approximately 40 get byte of memory.
The memory space can be divided into five sections.
The ownership pair for an eye or register section which can occupy any of the empty areas here.
Depending on the particular silicon manufacturer the s room section which is used for the data variables
and stack the EP section and the Flash section the SFR section indicated up here is for special function
registers.
We should talk about the arm the arm registers in sections.
So this is all there is to it.
To summarize the s Rom is used by the CPI for data variables and stock whereas the EP roms are considered
to be the memory.
You can add externally to the chip the flash from is useful program code while the apron is used most
often for critical system data that must not be lost if power is cut to the system.
This all there is to it and I'll see you in the next lesson.