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.
Solved! Go to Solution.
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 :
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?
Thanks for the reply. My settings for the CY8C5868AXI-LP035 are:
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.
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.