Skip to main content

What Is Direct Memory Access (DMA)?

 

Direct Memory Access (DMA) is a feature of computer systems that allows hardware subsystems to access main system memory (RAM) with minimal intervention from the Central Processing Unit (CPU).

The Direct Memory Access (DMA) hardware peripheral on PIC® microcontrollers (MCUs) allows for direct memory-to-memory and peripheral-to-memory transfers and concurrent operation of the DMA and the CPU (while sharing system bus resources). This enables more flexible usage of eXtreme Low Power (XLP) technologies through core-independent movement of data in low-power modes and improvements in data throughput and latency.

 


 

Why Is DMA Used?


Most CPU operations in MCU-based systems involve the movement of data. In many cases, this can significantly limit the throughput and responsiveness of a system. For example, an interrupt can cause the CPU to stop what it is currently doing to service the interrupt. In low-power applications, this can significantly increase overall power consumption.

The DMA provides a method of offloading data movement operations from the CPU, allowing for concurrent execution of data transfers and CPU processing in a pipelined manner. This reduces CPU load and interrupt overhead, thereby improving system responsiveness and power efficiency. The DMA peripheral can move data through two methods:

  • Moving data while the CPU clock is disabled (e.g. low-power modes and XLP technology, depending on device capabilities)
  • Utilizing available bus cycles when the CPU is idle or waiting for an event

How Is DMA Used?


Configuration Context Switching

Having multiple configurations of peripherals can greatly expand the functionality of a device and lowers unit costs as well as overall BOM cost. However, changing configurations can be CPU intensive as the registers and configuration bits for peripherals need to be altered, which could bring about performance issues in some applications.

The DMA allows for more efficient context-based configuration through a combination of software- and hardware-based triggers that permit automated updates of peripheral registers with reduced CPU involvement.

System Automation

The DMA peripheral can be used to automate system processes involving data transfer. This includes interaction with state-machine-like implementations and reconfiguration of other Core Independent Peripherals (CIPs), providing an efficient method of using a single peripheral in a variety of ways in response to hardware- or software-defined triggers.

Additionally, loop-based processes can be automated through repeated or circular DMA transfers, increasing throughput and reducing CPU intervention.

Arbitrary Waveform Generation

Many applications require arbitrary waveform data, which can be difficult to manage with a software-centric system. Arbitrary waveforms are traditionally generated using Digital Signal Processing (DSP) techniques that require significant computation and code complexity.

The DMA can be used to create these same arbitrary waveforms by reading data sequentially from memory in the form of a lookup table and feeding this to other peripherals such as a Pulse-Width Modulator (PWM) or Digital-to-Analog Converter (DAC).

 

Comments

Popular posts from this blog

Industrial Internet Use-Cases

The potential for the Industrial Internet is vast with opportunities spread over wide areas of productivity, such as logistics, aviation, transportation, healthcare, energy production, oil and gas production, and manufacturing. As a result, many use-cases will make industry executives wake up and consider the possibilities of the IIoT. After all, industry only requires a minimal shift in productivity to deliver huge revenue, an example is that even an increase of 1% of productivity can produce huge revenue benefits such as aviation fuel savings. In order to realize these potential profits, industry has to adopt and adjust to the Industrial Internet of Things. However, spotting, identifying, and then strategically targeting the opportunities of the IIoT is not quite as easy as it might seem. It is important, therefore, to create use-cases that are appropriate to vertical businesses. For instance, the requirements of manufacturing differ from logistics, which also differs to healthcare....

Heating with Electric Radiators

You want to heat your small garage using a couple of electric radiators. The power and voltage requirements for each radiator are 1200 W, 240 V. But you are not sure how to wire the radiators to the power supplied to the garage. Should you use the wiring diagram on the left or the one on the right? Does it make any difference?

How to program 8051 based MCU using Ptroteous Schematic capture and Source code editor to use timers using AT892051 + project files

 This tutorial is dedicated to use a 8051 based Microcontroller core and program it using keil's C51 tools on the Proteus Source code editor.  1- Brief History of 8051 one of the first microprocessors 4004 was invented by Intel Corporation as well as  8085 and 8086 microprocessors back in 1981,shortly after Intel introduced an 8-bit microcontroller called the 8051 . It was referred to as system on a chip because it had 128 bytes of RAM, 4K byte of on-chip ROM, two timers, one serial port, and 4 ports (8-bit wide), all on a single chip. When it became so widespread, Intel allowed other manufacturers to make and market different flavors of 8051 with its code compatible with 8051. It means that if you write your program for one flavor of 8051, it will run on other flavors too, regardless of the manufacturer. This has led to several versions with different speeds and amounts of on-chip RAM. 2- Features of AT892051 Microcontroller Compatible with MCS®-51Products 2K ...