DMA (Direct Memory Access controller) and Animation


https://embeddedcentric.com/dma-and-animation/

This lab reviews how to transfer data in and out of memory. More specifically, we are able to transfer bitmap frames of a character to the display controller memory region (the OLED screen on the Zedboard). We then were able to manipulate the C code to move the character according to the push buttons.

The DMAC we are utilizing uses the AXI bus to perform transfers between the system memories and the Zynq programmable logic. This lab uses 2 bitmaps that are slightly different, and when showed on the OLED screen sequentially it looks as if the legs of the image are moving, making it animated. There are 12 frames in the all_frames file, which we can upload directly. The DMA controller swaps between the two bitmaps in the frames to make the animation appear to be moving. A Timer is used to time the period of transferring to a new frame.  

To make the animation move, OLED is thought of as a 2-D screen, and each position is given an x and y coordinate. We use the function print_char(char,page,position) where char is the character that it prints, page is y-axis and position is x-axis. If we want to make the animation accessible through the push buttons, we don't need the DMA, so that part of the code was commented out. Now the image will appear to be not animated because we are using one single bitmap. All we are changing in this is the location of the image by the push buttons. We also commented out the timer because we are manually changing the location of the image. To change the position of the animation by pressing the buttons we had to alter the code in Step 10.







General Facts and Definitions Taken Directly From the Tutorial, Lab 6, in the link provided above:

Direct Memory Access (DMA): the task of a DMA controller is to transfer data into or out of memory without processor intervention once the processor has set up the transfer.

There are several DMA controllers available on the Zynq chip, we will be using the DMAC. The DMAC internally has a specialized processor (DMA Instruction Execution Engine) with  flexible instruction set for DMA transfers.

Comments

Popular posts from this blog

Adam Taylor MicroZed Chronicles: Interrupt Latency

Using the XADC Header to Read Voltages

Github