ADC_IsEndConversion(0) is wrong, valid values start at 1
You do not wait for a conversion done, you stop before it is done.
Use the given constants ADC_WAIT_FOR_RESULT or ADC_RETURN_STATUS. Maybe a typo in the name? Check in generated file ADC.h
Thanks, Bob, for your continuous help over the past few years.
I have updated my PSoC creator to 4.2 Beta 2 and came to know that the PDL of the ADC has been changed. So, or CY_SAR_RETURN_STATUS or CY_SAR_WAIT_FOR_RESULT are required as retMode. But the problem still persists with the ADC results i.e., I still get the toggled signal, though I have grounded both input terminals to ADC. Also, how can I watch my variable 'Is' in PSoC Creator?
My updated code is given below and I have also attached my project:
__enable_irq(); /* Enable global interrupts. */
if (Is>2) //A check for the ADC values
PWM2.cydsn.rar 13.0 MB
I do not want to overload my pc with uneeded programs, Can you lplease use the Creator to make a project archive.
To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
And I even can't find any code example of illustrating Scanning ADC in PSoC 6.
Well, somehow it is working now as I have changed the input pin.
There are two examles listed in the datasheet, whith and without using an interrupt.
Having a look into the board schematics reveils that there is no connection to a port, but to an internal capacitor on port P7_7