ADC returns positive limit everytime

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

cross mob
Anonymous
Not applicable

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?

pastedImage_0.png

0 Likes
1 Solution

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.

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes
Anonymous
Not applicable

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().

0 Likes
Anonymous
Not applicable

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().

0 Likes

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.

0 Likes