- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Labels:
-
PSOC5 LP MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.