Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > 16-bit ADC Data Buffering Using DMA example, using a larger array issues

Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



16-bit ADC Data Buffering Using DMA example, using a larger array issues

Summary: 8066 Views, 1 Replies, Latest reply by bjbu on 12 Nov 2010 02:13 PM PST

Verified Answers: 0

Post Reply


ch701builder posted on 09 Nov 2010 6:31 AM PST
Senior Member
12 Forum Posts

All,

I am using the CY8CKIT-001 PSoC-5 demo board and have been able to get the 16-bit ADC example to work in "diff" mode, and then send the data out using the USBUART example. I use the original switch routine to start the conversion, then I turn on an LED showing the the DMA is done, then use another switch to dump the data out the USBUART portion.....BUT.... when I try to setup my array to bigger than 2,000 and do an ADC sample, I end up with a bunch of 0's in the reset of the array. Example, if I wanted to make my array 20,000 samples, only about the first 2000 samples are actual data, while the rest are all 0's. (it varies from acquire to acquire)

the uint16 should be 0 -- 65535 values so that should be ok.  The code is exactly as the original Cypress example. I have just changed the NO_OF_SAMPLES to a larger number.

#define NO_OF_SAMPLES 2000

uint16 ADC_sample[NO_OF_SAMPLES]={0};

The array of 2,000 works fine, along with a sample rate of upto 100,000Sps. Verified with sig-gen and Excel. I don't understand why changing the array won't work. Even changing it to 3,000 samples doesn't work. Why / Where is the array/DMA transfer limitation?


Any ideas????

Keith

 



 

bjbu posted on 12 Nov 2010 02:13 PM PST
Cypress Employee
24 Forum Posts

The problem is with the DMA.  The maximum Transfer Count for both PSoC 3 and PSoC 5 is (4K - 1) bytes.  For 2,000 uint16's you are transferring 4,000 bytes.  That works just fine.  This parameter is just put into the TD memory in a 12-bit field, so if you provide a number greater than that you are just going to get the lower 12-bits and therefore strange results.

The solution to this is pretty simple.  You'll need to create multiple TDs and configure them in a chain where each will transfer an amount that is within the (4K - 1) limit.

Brad Budlong
PSoC Sensei

 



 

Post Reply






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.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 06/15/20