2 Replies Latest reply on Feb 28, 2011 8:20 PM by MR_41

    ADCINC problem

      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.