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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 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

0 Likes
11 Replies
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

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

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 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

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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();

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 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

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 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

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

   

   

 

   


 

0 Likes