I am trying to use the delta sigma converter but it fails in coming to an end of conversion. The program hangs using (read32) or end of conversion. It appears that the 'status' variable in the delsig.c has been optimized out.

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

cross mob
EdPo_1556871
Level 1
Level 1

I have not had any luck in using the delta sigma ADC in the PSOC5-050 kit. I am using creator 4.2. I am using a 12 channel mux ahead of the ADC to select inputs.

I have tried two different attempts and they fail at the same place, one using (read32) and the other using start convert and then waiting for the result. In reviewing

the code in the delsig.c file it is hung up waiting for completion but has optimized out the 'status' variable. The global interrupt is enabled and the call to initialize done.

Any help?

0 Likes
1 Solution

After the ADC_SelectConfiguration(1,0) you need an additional ADC_DelSig_1_Start(); See description of the API.

There is a newer version of the ADC. Consider updating the components using Creator -> Project -> ...

Bob

View solution in original post

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

The global interrupt is enabled and the call to initialize done

And did you issue the StartConvert() API?

Bob

0 Likes

I have called the start conversion:

The initialization code is:

CyGlobalIntEnable; /* Enable global interrupts. */

AMux_1_Init(); // disable all input channels

ADC_DelSig_1_Start(); // initialize AD converter

The code I am using is:

ADC_DelSig_1_SelectConfiguration(1 , 0); // configuration 1 (1-4)

AMux_1_FastSelect(1); // select this channel (1 - xx)

ADC_DelSig_1_StartConvert();

/* Wait until the ADC conversion is complete */

ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_WAIT_FOR_RESULT);

/* Since the ADC conversion is complete, stop the conversion */

ADC_DelSig_1_StopConvert();

InVolt = ADC_DelSig_1_GetResult32();

Getting hung up on (IsEndConversion)

uint8 ADC_DelSig_1_IsEndConversion(uint8 retMode)

{

uint8 status;

do

{

/* Check for stop convert if conversion mode is Single Sample with

  • resolution above 16 bit

*/

if(ADC_DelSig_1_stopConversion != 0u)

{

status = ADC_DelSig_1_convDone;

}

else

{

status = ADC_DelSig_1_DEC_SR_REG & ADC_DelSig_1_DEC_CONV_DONE;

}

}while((status != ADC_DelSig_1_DEC_CONV_DONE) && (retMode == ADC_DelSig_1_WAIT_FOR_RESULT)); ****Hangs at this line ****

Ed

return(status);

0 Likes

Can you please post your complete project 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

Here is the archive... All help appreciated ..

Ed

0 Likes

After the ADC_SelectConfiguration(1,0) you need an additional ADC_DelSig_1_Start(); See description of the API.

There is a newer version of the ADC. Consider updating the components using Creator -> Project -> ...

Bob

0 Likes

Thank you I missed the point of having to restart it. I have not fully tested it but it seems to work now.

Thanks for all the help!

Ed

0 Likes