You are here

ADCINC problem | Cypress Semiconductor

ADCINC problem

Summary: 2 Replies, Latest post by graa on 28 Feb 2011 08:20 PM PST
Verified Answers: 0
Last post
Log in to post new comments.
JimL's picture
1 post


I want to test a very simple code, insamp (with two PGA and one ADC). When I run the code, it stop in the line:

if (ADCINC_1_fIsDataAvailable() != 0);

Below is the code, can anyone tell me what wrongs, thankks a lot in advance!

#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules
#include "PSoCGPioInt.h"

int  iResult;

void main(void)
    ADCINC_1_Start(ADCINC_1_HIGHPOWER); /* Turn on ADC power */
    ADCINC_1_GetSamples(0);            /* Sample forever */
    while(1) {
     if (ADCINC_1_fIsDataAvailable() != 0) /* If ADC sample is ready... */
         iResult = ADCINC_1_iGetData() + 2048; /* Get result, convert to unsigned and clear flag */

The general system setup as below:




 Analog Power: SC on/RefH


OpAmp bias Low

A-buff_power low

Switch Mode Pump OFF

Trip Voltage LVD4.81V

Including is my project codes.

dasg's picture
Cypress Employee
730 posts

Hi JimL,


Can you please repost the question in PSoC1 topics of the forum?

In this space, PSoC5 topics are discussed.





graa's picture
Cypress Employee
223 posts



You  need to enable Global Interrupts for the ADC to work.  Add the code "M8C_EnableGInt;" in main.  See if this fixes the problem.  Also, check out my blog post PSoC1 ADCs - The Five Golden Rules that talks about best practices to get the ADC working without any problem.

Best Regards,


Log in to post new comments.