66
F. Firouzi et al.
Table 2.2 Comparison between port-mapped I/O and memory-mapped I/O
Port-mapped I/O
Memory-mapped I/O
Two different address for I/O and memory
Memory and I/O use the same address bus
To access I/O, we need a special class of
instruction
Same instructions can access both I/O and
memory
Intel x86 is implemented based on port-mapped
I/O
Most widely I/O technique in processors
2.4.1.4 Classification by IO
A microcontroller is a group of resources from the perspective of the computer
programmer. Every resource is identified using at least one “address” in an “address
space.” A memory map is a pictorial representation of the way resources related
to addresses. Usually, memory maps are based on the structure of hardware as
generated by the microcontroller and external devices. Changes cannot be made to
the map while a program is being executed. However, in some situations, writing in
“special configuration registers” will allow the user to disable or move resources to
a new part of the address space. Microprocessor generally connects external devices
using two methods (see Table 2.2) [7]:
• Memory-Mapped Input/Output (MMIO) – In this method, I/O devices and ROM
are mapped into the system memory map together. Accessing hardware requires
only reading or writing to their corresponding address using normal memory
access instructions. One of the primary benefits of this method is that each
instruction with the ability to access memory can be utilized to control input
and output devices. One of the main drawbacks is that the whole address bus
must be completely decoded for each device. For instance, a system with a 32bit address bus would need logic gates to process the state of all 32 address
lines and to be able to decode the unique address of any device. This may result
in several overheads such as higher cost and reduced operating frequency (i.e.,
higher delay).
• Port-Mapped I/O (PMIO or Isolated IO) – This method requires the I/O devices
be mapped into distinct address spaces. Most often this is achieved by utilizing a
separate set of signal lines to delineate memory access versus IO access. Address
lines are generally shared between two address spaces (i.e., memory and IO), but
fewer of them are utilized for IO access. For example, a PC using 16 bits of IO
address space may have 32 bits of memory address space. The primary advantage
of this method is that less logic is required to decode an IO address. When it
comes to software development, this method is less advantageous compared to
MMIO because a larger number of instructions are needed to complete the same
task. For example, testing one bit on a memory a single instruction is required.
On the other hand, for IO, we should first read its data to a register before testing
the corresponding bit.
F. Firouzi et al.
Table 2.2 Comparison between port-mapped I/O and memory-mapped I/O
Port-mapped I/O
Memory-mapped I/O
Two different address for I/O and memory
Memory and I/O use the same address bus
To access I/O, we need a special class of
instruction
Same instructions can access both I/O and
memory
Intel x86 is implemented based on port-mapped
I/O
Most widely I/O technique in processors
2.4.1.4 Classification by IO
A microcontroller is a group of resources from the perspective of the computer
programmer. Every resource is identified using at least one “address” in an “address
space.” A memory map is a pictorial representation of the way resources related
to addresses. Usually, memory maps are based on the structure of hardware as
generated by the microcontroller and external devices. Changes cannot be made to
the map while a program is being executed. However, in some situations, writing in
“special configuration registers” will allow the user to disable or move resources to
a new part of the address space. Microprocessor generally connects external devices
using two methods (see Table 2.2) [7]:
• Memory-Mapped Input/Output (MMIO) – In this method, I/O devices and ROM
are mapped into the system memory map together. Accessing hardware requires
only reading or writing to their corresponding address using normal memory
access instructions. One of the primary benefits of this method is that each
instruction with the ability to access memory can be utilized to control input
and output devices. One of the main drawbacks is that the whole address bus
must be completely decoded for each device. For instance, a system with a 32bit address bus would need logic gates to process the state of all 32 address
lines and to be able to decode the unique address of any device. This may result
in several overheads such as higher cost and reduced operating frequency (i.e.,
higher delay).
• Port-Mapped I/O (PMIO or Isolated IO) – This method requires the I/O devices
be mapped into distinct address spaces. Most often this is achieved by utilizing a
separate set of signal lines to delineate memory access versus IO access. Address
lines are generally shared between two address spaces (i.e., memory and IO), but
fewer of them are utilized for IO access. For example, a PC using 16 bits of IO
address space may have 32 bits of memory address space. The primary advantage
of this method is that less logic is required to decode an IO address. When it
comes to software development, this method is less advantageous compared to
MMIO because a larger number of instructions are needed to complete the same
task. For example, testing one bit on a memory a single instruction is required.
On the other hand, for IO, we should first read its data to a register before testing
the corresponding bit.
