Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > ADCINC problem

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



ADCINC problem
Moderator:
ANCY

Post Reply
Follow this topic



ADCINC problem

JimL posted on 26 Feb 2011 2:24 PM PST
Member
2 Forum Posts

 

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)
{
    PGA_1_Start(PGA_1_HIGHPOWER);
    PGA_2_Start(PGA_1_HIGHPOWER);
    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 */
         ADCINC_1_fClearFlag();
     }
 }
}

The general system setup as below:

VC1=sys/3

VC2=VC1/8

VC3=sys/1

 Analog Power: SC on/RefH

RefMax:Vdd/2+/-BandGap

OpAmp bias Low

A-buff_power low

Switch Mode Pump OFF

Trip Voltage LVD4.81V

Including is my project codes.




Re: ADCINC problem

Gautam Das posted on 27 Feb 2011 10:40 PM PST
Cypress Employee
742 Forum Posts

Hi JimL,

 

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

In this space, PSoC5 topics are discussed.

 

Regards,

dasg

 



Re: ADCINC problem

graa posted on 28 Feb 2011 06:20 PM PST
Cypress Employee
275 Forum Posts

JimL,

 

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,

Ganesh






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20