1 2 Previous Next 28 Replies Latest reply on Nov 26, 2012 2:38 PM by dakn_263916

    ADC problem

    userc_42486

       Hi to all,

         

                    I am  doing work on blood glucose measurement with PSoC 3 , in that a current from test strip taken and converted to voltage and calibration if that interms of glucose.but as a sample i am giving current from IDAC component that is converted to voltage. this voltage i am giving to ADC to display it in volts , here upto PGA i am getting voltage but after giving to ADC i am getting Garbage value output on LCD.i think the problem here is with ADC ,can anyone help me regarding this.

         

      thanks

         

      PRP

        • 1. Re: ADC problem
          helic_263931

          To make sure it really is an ADC problem, some debug ideas:

             
                
          • debug your code to see what you get as a result from the ADC (your LCD write code might also be wrong)
          •     
          • use an external value as ADC input to check that it is working correctly
          •     
          • route the connection between IDAC and ADC to an external pin and measure the voltage there
          •    
          • 2. Re: ADC problem
            userc_42486

             Hi Sir,

               

                      Upto PGA working and ADC also working properly individualy but when i am cascading both,i am not getting anything .

               

            Thanks 

               

            PRP

            • 3. Re: ADC problem
              JoMe_264151

              Route the output of the PGA to a pin to observe it is within the input-range of the ADC, watch it with oscilloscope.

                 

               

                 

              Bob

              1 of 1 people found this helpful
              • 4. Re: ADC problem
                userc_42486

                i Did that i got output from PGA with 4v and my ADC input range is 0 to Vdd which is 5v but still i am facing problem

                • 5. Re: ADC problem
                  JoMe_264151

                  There are some critical settings with ADC, can you post at least the settings of the ADC when not the complete zipped project.

                     

                   

                     

                  Bob

                  1 of 1 people found this helpful
                  • 6. Re: ADC problem
                    userc_42486
                    • 7. Re: ADC problem
                      userc_42486

                       i am unable to upload the project what to do ?

                      • 9. Re: ADC problem
                        helic_263931

                        When I open this project with Creation 2.1, it complains about outdated devices to be used. Do you use a PSoC3 Engineering Silicon? If yes, which one?

                           

                        Can you update to the newest version of creator?

                        1 of 1 people found this helpful
                        • 10. Re: ADC problem
                          helic_263931

                          One thing to note in your project is that the TIA output can get negative when the IDAC writes to the full values (31.875µA * 40kOhm gives 1.28V which is way larger than the reference voltage).

                             

                          Also, is there a reason why you read the ADC result 4 times, and discard the first 3 readings?

                             

                          Btw: since you don't change the IDAC - what is the result you see on the LCD? When I calculated correctly, it should 1.4V (4*(0.4-1.5µA*40kOhm), and it should be stable.

                          1 of 1 people found this helpful
                          • 11. Re: ADC problem
                            userc_42486

                             Hi hli,

                               

                                      actually i am doing this project on glucose so there first we get transients so we eliminate those . in this uploaded project as a sample i am giving a constant 1.25uA , and the version i am doing is ES2 040 PSoC ,which supports only 2.0

                               

                            thanks

                               

                            PRP

                            • 12. Re: ADC problem
                              dakn_263916

                              Basically your TIA output ranges from 400 mV to Vss per your settings.

                                 

                              There is a spec missing in TIA datasheet, and also the OpAmp datasheet in the main part

                                 

                              spec, and that is common mode ranges for various power level settings of the TIA. So I

                                 

                              would start using TIA set to high power for initial debug. Then feed a SW ramp from 0 uA

                                 

                              to 10 uA and verify you get a ramp from .4 to Vss out of the TIA. Ramp from PGA should be

                                 

                              1.6V to 0 V.

                                 

                               

                                 

                              I norticed you typed

                                 

                               

                                 

                              Vin = (float) ADC_DelSig_1_CountsTo_Volts(ADCResult);

                                 

                              The cast is un-needed as the function returns a float.

                               

                              Regards, Dana.

                              1 of 1 people found this helpful
                              • 13. Re: ADC problem
                                helic_263931

                                We still don't know what the problem is: what do you mean by 'garbage values'?

                                1 of 1 people found this helpful
                                • 14. Re: ADC problem
                                  dakn_263916

                                  One othjer issue, when you write the ADC inside a fast looping structure, you

                                     

                                  get a lot of screen jitter due to noise, and display is a little unreadable. Keep

                                     

                                  in mind LCD has its own controller refreshing the LCD and fast updates to this

                                     

                                  asynch interface cause visual issues even if no charaxcter is changing.

                                     

                                   

                                     

                                  Two approaches -

                                     

                                   

                                     

                                  1) Delay the loop so screen update not so frequent

                                     

                                  2) Build a buffer for the display. When you go to write display you check buffer,

                                     

                                  character for character, what you want to write, and only write those LCD characters

                                     

                                  that have changed compared to whats in the buffer, updating buffer with the new

                                     

                                  character after. This makes a very stable display. Prefered method by far.

                                     

                                   

                                     

                                  You will still get jitter, but now only the digits/characters that are changing, not the

                                     

                                  whole LCD display line.

                                     

                                   

                                     

                                  Regards, Dana.

                                  1 of 1 people found this helpful
                                  1 2 Previous Next