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?
Solved! Go to 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
The global interrupt is enabled and the call to initialize done
And did you issue the StartConvert() API?
Bob
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);
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
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
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
Ed, you are always welcome.
Bob