cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

rg
New Contributor II

I walked into a PSOC 5LP design where it was assumed the SAR was running a full 12-bit unsigned resolution in single ended mode. This didn't appear to be the case and after struggling with settings both high level as well as low level register settings I can't seem to make it work as a 12-bit single-ended unsigned ADC. Is this possible with this device? If so, please tell me how to use it that way. Also, please add this question to the list of FAQs for these devices.

0 Likes
1 Solution
odissey1
Honored Contributor II

KyTr,

I see results as expected. When Vinp = Vref, the ADC code is 2048. When Vinp=2xVref, the ADC code is 4096. Note that ADC code is saturating at 4096, so if Vinp > 2Vref, the ADC code is always 4096.

Project attached

/odissey1

ADC_SAR_Vref_01c_B.pngADC_SAR_Vref_01b_ADC.pngADC_SAR_Vref_01b.pngADC_SAR_Vref_01c_KIT-059.png

 

 

View solution in original post

4 Replies
KyTr_1955226
Valued Contributor

The SAR ADC on the PSoC5LP can absolutely do single ended 12-bit (unless there's some parts in the 5LP series that are missing this functionality?).  Here's a snapshot of my settings in Creator to do exactly that on a CY8C5667AXI-LP040 :

KyTr_1955226_0-1611093105316.png

ADC_SAR_GetResult16() will then give me the 12-bit ADC value right justified inside a 16-bit integer

What settings are you using?  How are you setting your configuration (via GUI or programmatically)?  If you aren't getting a 12-bit result, what are you getting instead?

0 Likes
rg
New Contributor II

Thanks for the reply. My settings for the CY8C5868AXI-LP035 are:

rg_0-1611094518415.png

My result is Vin * 2 * 5/4096 instead of Vin * 5/4096. Or i.e. Vin = 5/2048. So I appear to get the positive side of a signed 12-bit SAR. The input does not go negative, which is why I'm looking for 12-bit unsigned single-ended.

I believe I tried your settings as well, but to no avail. I will try them again. The sample mode is free running as the data is DMA'd and averaged over 1000 samples.

0 Likes
odissey1
Honored Contributor II

KyTr,

I see results as expected. When Vinp = Vref, the ADC code is 2048. When Vinp=2xVref, the ADC code is 4096. Note that ADC code is saturating at 4096, so if Vinp > 2Vref, the ADC code is always 4096.

Project attached

/odissey1

ADC_SAR_Vref_01c_B.pngADC_SAR_Vref_01b_ADC.pngADC_SAR_Vref_01b.pngADC_SAR_Vref_01c_KIT-059.png

 

 

View solution in original post

rg
New Contributor II

Thanks for convincing me to look elsewhere. The input is getting divided by 2 somewhere in the HW, so the PSOC is measuring the correct voltage.

Sorry to take up your time, but thank you.

0 Likes