Peripherals: Embedded Systems (UEC513)
Peripherals: Embedded Systems (UEC513)
Embedded Systems
(UEC513)
Accessing of I/O Devices
• More than one I/O devices may be connected through
set of three bus.
• Need to assign an unique address
• Two mapping techniques
– Memory mapped I/O
– I/O mapped I/O
I/O Mapping Techniques
• Two techniques are used to assign addressing to I/O
– Memory mapped I/O
– I/O mapped I/O
• Memory Mapped I/O
• Concept: In memory mapped I/O, the same address space is shared between
memory and I/O devices. I/O devices are assigned addresses within the regular
address space used by the system memory.
• Advantages:
• Simplifies the design, as the same instructions used for accessing memory
(load/store instructions) can be used for I/O operations.
• Provides more powerful and flexible ways to manipulate I/O devices using regular
memory access operations.
• Disadvantages:
• Consumes valuable address space that could otherwise be used for regular memory.
• The design must ensure that certain addresses are reserved exclusively for I/O
devices and not used for memory.
• Usage: Common in systems where ease of programming and flexibility are priorities.
Often used in modern microcontrollers and processors.
• I/O Mapped I/O (Port Mapped I/O)
• Concept: I/O mapped I/O uses a separate, dedicated address space for I/O
devices. This means that I/O devices have their own unique addresses distinct
from the memory addresses.
• Advantages:
• Does not consume the main address space, preserving it for memory use.
• Helps in clear separation of memory and I/O device address spaces.
• Disadvantages:
• Requires special instructions for I/O operations (e.g., IN, OUT in x86 assembly
language).
• May increase the complexity of the CPU design due to the need for separate
instruction sets and address spaces for I/O.
• Usage: Common in older and simpler systems where conserving address space
is critical, or where the hardware architecture inherently supports this method.
Accessing of I/O through polling
• Normally, the data transfer of rate of I/O devices is slower than the
speed of the processor. This creates the need for mechanisms to
synchronize data transfers between them.
• Program-controlled I/O: Processor continuously check the status
flag to achieve the necessary synchronization. It is called polling
• The CPU initializes the DMA controller by setting up the source and destination
addresses, the size of the data block to be transferred, and the type of transfer (e.g.,
read or write).
• Requesting the Bus:
• The DMA controller requests control of the system bus from the CPU. This request is
typically done through a signal called Bus Request (BR).
• Bus Arbitration:
• The CPU grants control of the bus to the DMA controller using a signal called Bus
Grant (BG). During this period, the CPU relinquishes control of the bus.
• Data Transfer:
• The DMA controller performs the data transfer directly between the I/O device and
memory. It uses the system buses to read data from the source and write it to the
destination.
• Completion and Interrupt:
• Once the data transfer is complete, the DMA controller releases control of the bus
back to the CPU.
• The DMA controller may generate an interrupt to notify the CPU that the transfer is
complete, allowing the CPU to proceed with the next operation.
Operation of DMA with CPU
Thanks