Lesson - 12: Direct Memory Access
Lesson - 12: Direct Memory Access
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
Multi-byte data set or burst of data or block of data A DMA is required when a multi-byte data set or a burst of data or a block of data is to be transferred between the external device and system or two systems. A device facilitates DMA transfer with a processing element (single purpose processor) and that device is called DMAC (DMA Controller).
2008 Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 2
Using a DMA controller DMA based method useful, when a block of bytes are transferred, for example, from disk to the RAM or RAM to the disk. Repeatedly interrupting the processor for transfer of every byte during bulk transfer of data will waste too much of processor time in context switching
2008 Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 3
DMAC
System performance improves by separate processing of the transfers from and to the peripherals (for example, between camera memory and USB port)
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
Three modes
Single transfer at a time and then release of the hold on the system bus. Burst transfer at a time and then release of the hold on the system bus. A burst may be of a few kB. Bulk transfer and then release of the hold on the system bus after the transfer is completed.
2008 Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 7
DMA proceeds without the CPU intervening Except (i) at the start for DMAC programming and initializing and (ii) at the end. Whenever a DMA request by external device is made to the DMAC, the CPU is requested (using interrupt signal) the DMA transfer by DMAC at the start to initiate the DMA and at the end to notify (using interrupt signal) the end of the DMA by DMAC.
2008 Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 8
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
Use of DMA Channel for Facilitating the Small Interrupt-Latency Period Sources
Small latency periods can be set when using a DMA channel when multiple interrupt from IO sources exist. The ISR run period from start to end can now be very small, [only short code for programming DMAC and for short code on end of DMA transfer for initiating new data transfer or new task.]
2008 Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 11
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
12
Summary
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
14
We learnt
DMA controller is a device with single purpose processor and used when multiple bytes are to be transferred between memory and IO devices. Data transfer occurs efficiently between I/O devices and system memory with the least processor intervention using DMAC
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
15
We learnt
DMAC facilitates fast direct byte transfers between memory and I/O devices compared of interrupt driven DMA as it has in-built processing element and uses the system buses as and when they are made available by the processor.
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
16
2008
Chapter-4 L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education
17