Microcontroller
memory is broken up into three types, namely:
memory is broken up into three types, namely:
·
Control store
Control store
·
Variable area
Variable area
·
Hardware interface registers
Hardware interface registers
CONTROL STORE
The
control store which is also referred to as program store is made up of different
types of Read Only Memory (ROM) use for storing software and table data that do
not change during execution.
control store which is also referred to as program store is made up of different
types of Read Only Memory (ROM) use for storing software and table data that do
not change during execution.
The
program memory is usually made up of four different types of memory, namely:
program memory is usually made up of four different types of memory, namely:
I.
ROM
II.
PROM
III.
EPROM
IV.
EEPROM
EEPROM
All
these types of memory are ‘non volatile’ which means that the content of the
memory is retained even when power has been removed from the microcontroller.
This is due to the fact that the microcontroller does not have any mass storage
(i.e. disk) to load programs from upon boot (like a PC does). This means that
the application code is resident at all times in the microcontroller.
these types of memory are ‘non volatile’ which means that the content of the
memory is retained even when power has been removed from the microcontroller.
This is due to the fact that the microcontroller does not have any mass storage
(i.e. disk) to load programs from upon boot (like a PC does). This means that
the application code is resident at all times in the microcontroller.
During
execution, the program instructions are read from this memory and the
processors instruction decode unit, executes the coded instruction. This memory
cannot be reprogrammed during execution, which means that a microcontroller is
dedicated to an application until this memory is erased (if possible) and
programmed with a new set of instructions
execution, the program instructions are read from this memory and the
processors instruction decode unit, executes the coded instruction. This memory
cannot be reprogrammed during execution, which means that a microcontroller is
dedicated to an application until this memory is erased (if possible) and
programmed with a new set of instructions
One
aspect that should be noted with different microcontrollers is that the bus
width specification (i.e. 8, 16, or 32 bits) is for the data bus.
Microcontroller could have control store widths of 12, 14 or 16 bits.
aspect that should be noted with different microcontrollers is that the bus
width specification (i.e. 8, 16, or 32 bits) is for the data bus.
Microcontroller could have control store widths of 12, 14 or 16 bits.
ROM
Read
Only Memory is the term used when the application code literally built into the
microcontroller during chip manufacturing. To create this type of memory, one
the application program is tested and ‘qualified’ (deemed fit for mass
production) it is given to the chip manufacturer, who then converts the program
into an optical ‘mask’. This mask is used to provide interconnect information
for the chip control store. Because of this process, ROM is also known as ‘mask
programmed ROM’
Only Memory is the term used when the application code literally built into the
microcontroller during chip manufacturing. To create this type of memory, one
the application program is tested and ‘qualified’ (deemed fit for mass
production) it is given to the chip manufacturer, who then converts the program
into an optical ‘mask’. This mask is used to provide interconnect information
for the chip control store. Because of this process, ROM is also known as ‘mask
programmed ROM’
ROM
control store programming is the cheapest method of programming. For high
volume applications, it has some significant downsides that have put it out of
favour in the past few years. These downsides are primarily related tot he
up-front costs required to have the manufacturer develop custom mask for the
part and the time required to build parts with this mask; the whole process
typically takes ten weeks and requires on the order of ten thousand parts to
break even with a field – programmeable ROM (PROM, EPROM or EEPROM). But these
are additional cost, primarily in the area of inventory and handling
control store programming is the cheapest method of programming. For high
volume applications, it has some significant downsides that have put it out of
favour in the past few years. These downsides are primarily related tot he
up-front costs required to have the manufacturer develop custom mask for the
part and the time required to build parts with this mask; the whole process
typically takes ten weeks and requires on the order of ten thousand parts to
break even with a field – programmeable ROM (PROM, EPROM or EEPROM). But these
are additional cost, primarily in the area of inventory and handling
PROM
Programmable
ROM can be programmed once. PROM memory are usually consists of fuses that are
electrically ‘blown’ at programming time. The PROM memories are scarcely seen
now because it has fallen out of favour and very few manufacturers still build
PROM memories.
ROM can be programmed once. PROM memory are usually consists of fuses that are
electrically ‘blown’ at programming time. The PROM memories are scarcely seen
now because it has fallen out of favour and very few manufacturers still build
PROM memories.
EPROM
Erasable
PROM consists of the program memory cells that are electrically programmable
and erasable using an ultraviolet light.
PROM consists of the program memory cells that are electrically programmable
and erasable using an ultraviolet light.
EEPROM
The
Electrically Erasable PROM is made up of memory cells that are not cleared by
ultraviolet light but by providing a switch that connects the floating gate to
ground, allowing the trapped charge to escape.
Electrically Erasable PROM is made up of memory cells that are not cleared by
ultraviolet light but by providing a switch that connects the floating gate to
ground, allowing the trapped charge to escape.
EEPROM
allows a microcontroller to be cleared and reprogrammed without having to
remove the device from the board and exposing it to ultraviolet light. This
allows periodic updates of microcontroller code. EEPROM are somewhat more
expensive than EPROM and dives using EEPROM are somewhat at slower EPROM.
allows a microcontroller to be cleared and reprogrammed without having to
remove the device from the board and exposing it to ultraviolet light. This
allows periodic updates of microcontroller code. EEPROM are somewhat more
expensive than EPROM and dives using EEPROM are somewhat at slower EPROM.
The
biggest advantage of EEPROM is its ability to be reprogrammed repeatedly
without having to be pulled out of the circuit and be cleared before it is
reprogrammed.
biggest advantage of EEPROM is its ability to be reprogrammed repeatedly
without having to be pulled out of the circuit and be cleared before it is
reprogrammed.
Variable area
The variable
area is used for storing temporary values or parameters for use during program
execution.
area is used for storing temporary values or parameters for use during program
execution.
When
one look at a data sheet for a microcontroller, the first thing that will
probably occur to one’s mind is how little RAM is available.
one look at a data sheet for a microcontroller, the first thing that will
probably occur to one’s mind is how little RAM is available.
This
memory ranges from tens to hundreds of bytes. Now the question that arises is;
how can anybody do anything with so little memory? Say 25 bytes for an example.
memory ranges from tens to hundreds of bytes. Now the question that arises is;
how can anybody do anything with so little memory? Say 25 bytes for an example.
The
answer to this question is that, non-changing data is not stored in variables.
Hardware features such as times, index registers, etc are used to avoid using
up available RAM. The means that when preparing to develop an application, care
must be taken with how the memory resources are used in an application. The
application should also be designed so large arrays are not required.
answer to this question is that, non-changing data is not stored in variables.
Hardware features such as times, index registers, etc are used to avoid using
up available RAM. The means that when preparing to develop an application, care
must be taken with how the memory resources are used in an application. The
application should also be designed so large arrays are not required.
Hardware interface register (I/O space)
Like
all computer systems, microcontrollers have a number of registers that are used
for controlling the hardware attached to the processor. These registers can be
the “typical” processor registers (accumulators, status registers (interrupt
control registers, timer control registers,) or I/O control registers (parallel
I/O control register, serial I/O control registers, analogue I/O control
registers and data registers).
all computer systems, microcontrollers have a number of registers that are used
for controlling the hardware attached to the processor. These registers can be
the “typical” processor registers (accumulators, status registers (interrupt
control registers, timer control registers,) or I/O control registers (parallel
I/O control register, serial I/O control registers, analogue I/O control
registers and data registers).
These
register can be access by a number of different ways. The actual method of
accessing the registers can mean a lot in terms of performance to one device
compared to another. Therefore, it is important to understand how registers are
accessed before you can successfully write a program for a microcontroller.
register can be access by a number of different ways. The actual method of
accessing the registers can mean a lot in terms of performance to one device
compared to another. Therefore, it is important to understand how registers are
accessed before you can successfully write a program for a microcontroller.
In
some processors, all registers (often including the accumulators) are given an
explicit address. This allows much flexibility in the operation of the
processor. Another aspect of register accessing is to understand where
registers are located. In some processors, all the registers and RAM are
located in the same memory space. This means that program space is intermingled
with the registers and typically known as “memory mapped I/O”.
some processors, all registers (often including the accumulators) are given an
explicit address. This allows much flexibility in the operation of the
processor. Another aspect of register accessing is to understand where
registers are located. In some processors, all the registers and RAM are
located in the same memory space. This means that program space is intermingled
with the registers and typically known as “memory mapped I/O”.


