ADC, with vref bypassed, is only creating approximately 1500 valid samples

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

I have a problem with SAR ADCs on my PSoC 5LP.

I am currently using the following setup where an ADC is supposed to sample 6000 samples from a maximum peak detector.

PeakDetector.PNG

The SAR ADC can sample 6000 samples without any issues as long as I have not set it to vref, bypassed mode.

Now I don't know if this is normal behavior, so I am wondering if I can fix this somehow. Here is an image of my data:

sar_adc_data.jpg

I have two signals that I sample, this one only reaches approximately 1450 before it returns 0 for all other samples.

My other signal goes a bit above 1500 in samples. But if I set it to vref mode it can easily give me more than 1500 valid  samples.

Both SAR ADCs are configured the same way and so are the DMAs. The reason I need vref, bypassed mode is the higher sampling rate.

So is this normal behavior?

Regards, Kasper.

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

According to the datasheet of SAR ADC, when you use Internal Vref, bypassed,

you are expected to place a bypass capacitor on pin P0[2] and/or P0[4].

ADC_DataSheet.JPG

But the Pin in your project suggests otherwise

ADC_Bypass.JPG

May be assigning these Bypass pins to P0[2] and P0[4]

and placing capacitor of 0.01uF~10uF improve the situation.

ADC_Bypass_assigned.JPG

moto

View solution in original post

6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

That is not "normal behavior". Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file. Furthermore: Are you using a Cypress Kit? Which one?? CY8CKIT-XXX??? When not; schematics?

Bob

0 Likes
Anonymous
Not applicable

I am using a CY8CKIT-059

And here is the full source code.

0 Likes
Anonymous
Not applicable

So when I change the SAR ADC to vref mode, rather than vref, bypassed and then sample at 100 ksamples/s it can give me all the samples I want. But when I use vref, bypassed mode it will only give me approx 1500 actual samples.

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

According to the datasheet of SAR ADC, when you use Internal Vref, bypassed,

you are expected to place a bypass capacitor on pin P0[2] and/or P0[4].

ADC_DataSheet.JPG

But the Pin in your project suggests otherwise

ADC_Bypass.JPG

May be assigning these Bypass pins to P0[2] and P0[4]

and placing capacitor of 0.01uF~10uF improve the situation.

ADC_Bypass_assigned.JPG

moto

Kasper,

sorry, can't test your project - the essential component Maximum_Peak_Detector is not included.

P.S. found, here it is:

http://www.cypress.com/documentation/application-notes/an60321-peak-detection-psoc-3-and-psoc-5lp

On the other note: it is not clear why do you need a Peak_Detector - it seems that ADC samples some sensor position and stores it into array. Once 1500 points are accumulated, the acquisition is stopped and the entire array is being parsed by CPU for maximum value and index (time of arrival). I believe that the result will be the same either with or without the Max_Peak_Detector present.

Also check this line, I believe that number of transfer bytes must be DATA_SIZE * 2:

CyDmaTdSetConfiguration(DMA_A_Filter_TD[0], DATA_SIZE, DMA_A_Filter_TD[0], DMA_A_Filter__TD_TERMOUT_EN | CY_DMA_TD_INC_DST_ADR);

Also, I would crank Bus_Clock to 48MHz at least for testing: there is high-speed ADC, four DMA channels, Digital Filter, lengthy computations, UART/SPI etc.

It is better not to disable all interrupts: (CyGlobalIntDisable;). This also kills UART and SPI. It is better to redirect Filter output to another array and continue acquisition while processing data (ping-pong configuration).

/odissey1

Anonymous
Not applicable

Thanks a lot for the response, especially the extra comments you gave.
I am fairly busy until january, but I hope I have time then to try those ideas out.

Regards, Kasper.

0 Likes