6 Replies Latest reply on Jul 10, 2017 10:55 AM by user_1377889

    DelSig ADC Problems

    SumatPurewal

      I'm having trouble getting accurate readings from the delsig adc on a CY8CKIT-050 PSoC® 5LP Development Kit. For starters, despite compensating with setting the offset the adc reads a constant 1.3V whereas my multimeter and other CY8CKIT-059 read a constant 0.8V. Furthermore, the readings have sharp spikes in them despite a stable input. I have attached my project below.

        • 1. Re: DelSig ADC Problems
          user_1377889

          Can it be you powered your PSoC with 3.3V (Check board)? In system configuration you set VDD to 5V, this will affect conversion from counts to mV. The spikes may come from the situation that you do not wait  using the ADC_IsEndConversion() API, so picking up intermediate results.

             

           

             

          Bob

          • 2. Re: DelSig ADC Problems
            SumatPurewal

            Thanks for the tip- I measured vdda and changing the value in psoc creator has improved the results but the results are still far from good. For example measuring 5V = 4.81V and 3.3V = 3.42V so there's more than just an offset which I believe I have compensated for. As for the spikes, I am triggering an ISR at the end of each conversion and using that instead of isEndConversion.

               

            My arduino provides better readings which it shoudln't given the resolution of its adc so I don't understand why there is such a large error.

            • 3. Re: DelSig ADC Problems
              user_1377889

              You are using an eoc interrupt, but this does not let your program wait for a value converted. Use IsEndConversion() or read the ADC in interrupt handler.

                 

              In line

                 

                  My_ADC_SetOffset(-35); //measured by shorting ground to input

                 


              where did you get the 35 from? this are counts, not mV

                 

              ADC settings:

                 

              Buffer mode -> Bypass buffer

                 

              Reference: Vdda/4 Bypassed P3.2

                 

              You always can do a fine-tuning by calculating y = aX +B at two different voltages (1V and 4V, not 0 and 5V) and setting offset and gain to match your configuration.

                 

               

                 

              Bob

              • 4. Re: DelSig ADC Problems
                SumatPurewal

                Thanks! I thought eoc would accomplish the same. I also made a huge mistake by blindly looking at the input range when configuring the component and forgot that my analog input should be lower than vdda. As for the setoffset I assumed I was supposed to feed it counts because of point 1 on http://www.cypress.com/knowledge-base-article/adc-errors-and-techniques-compensate-these-errors

                • 5. Re: DelSig ADC Problems
                  david.vanhorn_2575966

                  Am I understanding this correctly, that the End Of Conversion interrupt can go true before the End Of Conversion?

                     

                  It sounds like the correct procedure then is to poll the ADC inside the ISR till the conversion is actually really done?

                     

                  I am just getting started with the PSOC, but I also assumed that the EOC int happened when the data was ready to be collected.  How then does the DMA transfer work if triggered from the EOC output of the DAC?

                  • 6. Re: DelSig ADC Problems
                    user_1377889

                    Am I understanding this correctly, that the End Of Conversion interrupt can go true before the End Of Conversion?

                       

                    No, when eoc happens the interrupt gets fired.

                       

                    Your code handling the eoc interrupt is

                       

                    CY_ISR(adc_done_Handler){
                        newVoltage = 1;//led_pin_Write(1);
                    }

                       


                    There is no read of the conversion result. You do not act on the "newVoltage" flag accordingly.

                       

                     

                       

                    Bob