- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been developing an embedded system for some time using the CyBle-143A development kit on a custom carrier card. Among other things, the systems uses the SAR ADC to take some measurements at a relatively low rate. So far this has worked to my satisfaction.
I just received our new full custom card with the same PSoC4 device on it (CY8C4248LQI-BL583). The hardware on the new PCB is nearly identical to the old platform we merged the schematics for the CyBle-143A kit with our carrier card schematic to eliminate the connectors to reduce manufacturing cost. I loaded the same code on the new card and every other function appears to work except the ADC always returns the maximum value (0xFFFF). One small difference between the old and new cards is that I omitted the 1uF bypass cap on the VREF pin for the new card but documentation seems to indicate that this is optional. I checked the voltage on the ADC input pin (P4.0) and it's nominally close to zero.
Below shows how the ADC is configured. In my code, I initialize the ADC using 'ADC_Start()' and I read it periodically using 'ADC_GetResult16(0)'.
What could be some reasons for getting these results? What are some things I can check to debug this issue?
Solved! Go to Solution.
- Tags:
- sar adc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you tried to use the ADC_IsEndConversion() API before calling ADC_GetResult16().
There is a chance that you might be reading the results while the conversion is in process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the project.
The majority of the project has nothing to do with the ADC, but you'll see that code down in the body of main().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I noticed that I get reasonable readings when the ADC input is not close to zero volts. I also noticed that when I turn off averaging, it sometimes correctly reads 0x0000 for 0 volts. When it is zero, however, I still get the 0xFFFF returned from ADC_GetResult16().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you tried to use the ADC_IsEndConversion() API before calling ADC_GetResult16().
There is a chance that you might be reading the results while the conversion is in process.