11 Replies Latest reply on Jan 9, 2015 5:45 PM by dakn_263916

    Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off

    tovac_285016

       Hi,

         

      I did some work on a circuit board to convert a load cell output (0-15mV) into a force that is transmitted to a PC.  The software worked fine, and then I lost it, and recreated it.  Now nothing seems to work.  There are a few things that stick out:

         

      -The load ADC does not read accurately at all, and bounces around a lot.  If I set it up as it is in the file, it reads off when given a 10mV signal.  It reads off about 40%, and bounces around.  If I set it up as a level shift buffer in order to maximize the resolution it actually reads negative.

         

      -There is an error by my first interrupt handler that I do not understand.

         

      -A lot of the 'smart completion' selections are missing entirely.  I try to type 'UART_PutString' and it never appears under the smart completion options.

         

      Any ideas are greatly appreciated.

         

      Thank you,

         

      Tom

        • 1. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
          tovac_285016

           Not sure how to delete double post, sorry...

          • 2. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
            dakn_263916

            First consider bypassing the internal Vref, check off and choose the

               

            preassigned pin for that purpose.

               

             

               

            Take a look at this - www.google.com/url

               

             

               

            At 20 bits, a Vref of 1 V, one lsb is ~ 1 uV. Look at your power supply

               

            and you will see 200 or more mV of noise, divide that by CMR at the

               

            input buffer and you will start to see how much input referred noise

               

            you have. Same applies to PSRR, errors additive for worst case peak

               

            sampling error.

               

             

               

            Most load cells are preconditioned with an IA.

               

             

               

            Some useful info attached on IA's.

               

             

               

            Regards, Dana.

            • 3. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
              tovac_285016

               Hi,

                 

              Thank you for the feedback.  I read through the PDF, which is very applicable.  The thing that bothers me is that this very silicon was working just fine before I lost my original program and started over.

                 

              I understand that most power supplies are not that reliable to the third digit of voltage.  This is a high precision programmable supply, and my higher precision multimeter confrimed that the voltage was not drifting as the PSOC was saying, and that indeed 10mV was actually 10mV, not the 6mV reported by the microcontroller.  I am going to have to see how my load cell behaves (since I do not have one with me unfortuantely).

                 

              What I do not understand about thgis is if the other software abnormalities (see above) have anything to do with this, or are a complete red herring.  I am guessing the latter.

                 

              Any other ideas or feedback are greatly appreciated.  I am working on this project for a friend, and would rather not let him down if I do not have to.

                 

              Thank you,
              Tom

              • 4. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                JoMe_264151

                One reason for your problems will be that you do not wait for a completed ADC conversion done. At first you read after a delay with GetResult32(). There might be a conversion in progress. Later in your main() you again read with GetResult32() without a prior IsEndConversion(uint8 retMode).

                   

                 

                   

                Bob

                   

                 

                   

                BTW: To make things easier you may use an isr_StartEx(Handler) instead of isr_SetVector(Handler) and an isr_Enable();

                • 5. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                  dakn_263916

                  For setting up C interrupts (page 13) -

                     

                      

                     

                           

                     

                  http://www.cypress.com/?rID=38267     AN54460 - PSoC® 3, PSoC 4, and PSoC 5LP Interrupts

                     

                   

                     

                   

                     

                  Other issues -

                     

                      

                     

                           

                     

                  http://www.cypress.com/?rID=39677     AN57821 - PSoC® 3, PSoC 4, and PSoC 5LP Mixed Signal Circuit Board Layout Considerations

                     

                  http://www.cypress.com/?rID=40247     AN58827 - PSoC® 3 and PSoC 5LP Internal Analog Routing Considerations

                     

                  http://www.cypress.com/?rID=39974     AN58304 - PSoC® 3 and PSoC 5LP – Pin Selection for Analog Designs

                     

                   

                     

                  Do you have a target resolution and accuracy you want for design ? Datasheet for the load cell....?

                     

                   

                     

                  Regards, Dana.

                  • 6. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                    tovac_285016

                     Hi,

                       

                    Thank you both once again for the suggestions.  

                       

                    The analog pins I am using are in the 'ideal' pin location in the P0 bank.  

                       

                    I started using Read32() instead of GetResults32().  Read32() waits for conversion to complete.  I will need to get my hands on a load cell to see if indeed this works.

                       

                    I am using the StartEx, but there is still an error in the software interface saying that 'expected function body after function declaration'.  It does build, however.

                       

                    I am still having the very annoying problem of the software not doing any sort of auto complete when I type, so that if I start typing a variable that I have delcared earlier, it will not auto complete and give me options, and it will also not give me a flag if I type the wrong name in so that i do not find out if all my syntax is correct until I build the program.  Also if I start typing a component name, for example, the pin 'TARE', it does not show me the functions associated with it at all, and I have to try to remember all of the pin functions or open the datasheet for each component.

                       

                    Can someone please download my project (attached to this post) and let me know if this is also a problem on a different PC/program.  It is not fatal, but is very annoying and time consuming.  

                       

                    Thank you,

                       

                    Tom

                    • 7. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                      dakn_263916

                      With your program it compiles w/o any significant warnings.

                         

                       

                         

                      I type "TARE" it does show me the functions, I type "Tare(" and shows me nothing.

                         

                      Also tried typing several other variables, like buffer[], could not find that either.

                         

                       

                         

                      I did a clean and build, that changed nothing.

                         

                       

                         

                      Your program is ":haunted", alien life force in it. You got me, no idea whats going on.

                         

                       

                         

                      Creator 3.1 SP1

                         

                       

                         

                      Maybe a uninstall/reinstall necessary of Creator ?

                         

                       

                         

                      Regards, Dana.

                      • 8. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                        JoMe_264151

                        I suggest you to upgrade to Creator 3,1 using the update manager. Not perfect for PSoC3, but significantly better than 3.0

                           

                        I cannot recommend Read32() because it starts and stops the ADC which is fine as long as you want a single read, but you are reading continuosly, so better use IsEndConversion() and GetResult32().

                           

                         

                           

                        Bob

                        • 9. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                          dakn_263916

                          One other observation, the search process was very very slow when

                             

                          attempting an autocomplete on your project, but "normal" on other

                             

                          projects. Maybe dupe your project from scratch by cutting and pasting

                             

                          code and re-drawing schematic....?

                             

                           

                             

                          Regards, Dana.

                          • 10. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                            tovac_285016

                             Hi,

                               

                            I have the same problems with Creator 3.1.  As soon as I add a CY_ISR line, it does not give an error like Creator 3.0, but will not do any sort of autocompletes at all, which is very frustrating.  When I delete the CY_ISR, it works as normal.  This happens even when I start a new program from scratch.

                               

                            Any ideas?

                               

                            Thank you,

                               

                            Tom

                            • 11. Re: Major Problems with Software (and hardware?)  ADC Delta Sigma Reading Way Off
                              dakn_263916

                              It autocomed for me, but in lower case, which I thought odd.

                                 

                               

                                 

                              I typed         cy_isr; and no error showed up, until I compiled.

                                 

                               

                                 

                              Sure seems that your installation is somehow hosed. Painful as it

                                 

                              is reinstall, but before you do erase all directories. You could also file

                                 

                              a CASE to see if there is a registry cleaning script available from

                                 

                              Cypress.

                                 

                               

                                 

                                  

                                 

                                        

                                 

                              To create a technical or issue case at Cypress -

                                 

                               

                                 

                              www.cypress.com

                                 

                              “Support”

                                 

                              “Technical Support”

                                 

                              “Create a Case”

                                 

                               

                                 

                              You have to be registered on Cypress web site first.

                                 

                               

                                 

                              Regards, Dana.