You are here

Direct Digital Synthesis with an Indexed DMA | Cypress Semiconductor

Direct Digital Synthesis with an Indexed DMA

If any of you have cracked open the Technical Reference Manual for PSoC 3 and looked at the DMA section, you would have noticed that there are many different supported modes.  The mode that was used for my previous post by the nameof Intro to DMA on PSoC 3 and PSoC 5 is called “Auto Repeat DMA”.  There is another mode that is labeled “Indexed DMA”.  That mode appears that it could be powerful, but you might wonder how it is actually done.  In this mode a hardware component is used to generate either a source or destination address for a DMA transaction.  This capability can be used to generate a sine wave like the Auto Repeat mode did, but in this case a hardware component is used to generate a sine wave of varying frequency that is controllable in small increments at run time.

The implementation of an indexed DMA uses one or more DMA Transaction Descriptors (TDs) to transfer an address from a component to another TD that performs the transaction of interest.  In this example 3 TDs are used as shown:

The first two TDs read the address from the Phase Accumulator component.  The third TD reads from that address and sends it to the DAC.

The Phase Accumulator is a custom hardware component that was built for this example and is included with the design.  It uses the programmable digital logic in the UDB array to generate the address needed by the DMA.  The implementation of this Phase Accumulator uses a 16 bit counter and a programmable increment value.  The upper ten bits are used as the index into a 1,024 entry sine wave SRAM lookup table.  The lower 6 bits allow for finer increments in the generated frequency.  The result is a Direct Digital Synthesis implementation.  The focus of this blog entry is the Indexed DMA functionality.  Details about building hardware components will be addressed in future blog entries.

This example brings together the unique combination of capabilities of PSoC 3 and PSoC 5 (programmable digital, programmable analog and flexible DMA engine) resulting in a design that is fully controllable by the processor, but also fully offloads the processor. 

You can see PSoC in action here and the design is attached for you to experiment further with the power of PSoC: IndexedDMA.zip
 

 

Comments

santia9086's picture

Maybe you have a updated version?... I'm using now the PSoC 5LP and PSoC Creator 2.2 and the example is not working. I don´t have a long experience in PSoC, so at the moment I don't know how work with PSoC Design and APIs.
Very good contribution, is the only example that I've found about "Indexed DMA". Thank you very much!

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.