Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > ADC problem

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



ADC problem
Moderator:
RKRM

Post Reply
Follow this topic



ADC problem

vgy posted on 21 Nov 2012 4:56 AM PST
Top Contributor
133 Forum Posts

 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




Re: ADC problem

hli posted on 21 Nov 2012 07:13 AM PST
Top Contributor
675 Forum Posts

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


Re: ADC problem

vgy posted on 21 Nov 2012 07:33 AM PST
Top Contributor
133 Forum Posts

 Hi Sir,

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

Thanks 

PRP



Re: ADC problem

Bob Marlowe posted on 21 Nov 2012 07:58 AM PST
Top Contributor
1768 Forum Posts

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



Re: ADC problem

vgy posted on 21 Nov 2012 08:20 AM PST
Top Contributor
133 Forum Posts

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



Re: ADC problem

Bob Marlowe posted on 21 Nov 2012 09:55 AM PST
Top Contributor
1768 Forum Posts

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

 

Bob



Re: ADC problem

vgy posted on 21 Nov 2012 08:09 PM PST
Top Contributor
133 Forum Posts


Re: ADC problem

vgy posted on 21 Nov 2012 08:10 PM PST
Top Contributor
133 Forum Posts

 i am unable to upload the project what to do ?



Re: ADC problem

vgy posted on 21 Nov 2012 08:17 PM PST
Top Contributor
133 Forum Posts


Re: ADC problem

hli posted on 22 Nov 2012 07:46 AM PST
Top Contributor
675 Forum Posts

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?



Re: ADC problem

hli posted on 22 Nov 2012 08:12 AM PST
Top Contributor
675 Forum Posts

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.

 



Re: ADC problem

vgy posted on 22 Nov 2012 08:53 AM PST
Top Contributor
133 Forum Posts

 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



Re: ADC problem

danaaknight posted on 22 Nov 2012 12:27 PM PST
Top Contributor
1773 Forum Posts

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.

 



Re: ADC problem

hli posted on 22 Nov 2012 12:33 PM PST
Top Contributor
675 Forum Posts

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



Re: ADC problem

danaaknight posted on 22 Nov 2012 12:36 PM PST
Top Contributor
1773 Forum Posts

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.



Re: ADC problem

PSoC Rocks posted on 24 Nov 2012 07:27 AM PST
Top Contributor
128 Forum Posts

Have you tried with ADC Continuous mode of operation ?



Re: ADC problem

hli posted on 24 Nov 2012 01:30 PM PST
Top Contributor
675 Forum Posts

I think the TextLCD is not asynchronous. All write commands wait until the LCD is ready. This means that it will slow down the loop to accomodate the LCD speed. But writing so fast means you cannot really ready anything on it...



Re: ADC problem

danaaknight posted on 24 Nov 2012 02:10 PM PST
Top Contributor
1773 Forum Posts

I should have been more explicit on what is asynch and what is not.

 

The 44780 Controller has a busy flag which is the basis of handshake for writes/reads of commands or data. Hence that is a synch interface.

 

What is asynch is the relationship of what is written and when it gets to actual LCD segments, due to an internal controller that is not synced to MPU clock in any fashion. It is possible to write at a rate where one or more internal ram buffer characters does not always get displayed one for one. That is the display self refreshes at its own frame rate, not knowledgeable about how often the data in any given ram location has changed. In other words the controller is dumb, it has no knowledge of what, when, data has changed in the frame buffer. It just simply regurgitates it mindlessly to the segment lines, this then is asynch behavior to the output.

 

Regards, Dana.
 

 

 

 



Re: ADC problem

vgy posted on 25 Nov 2012 01:03 AM PST
Top Contributor
133 Forum Posts

here i am uploading complete work , in which the final output is display of voltage which corresponds to particular glucose level.

test strip interface to psoc:

1) pin 1 refers to working electrode

2) pin 4 refers to reference  electrode

3) pin 3 refers to central electrode

here the default output i am getting is 3.17v but after applying blood to the test strip output voltage going to 0.18v which should not happen.

where i am going wrong , how to correct it can anybody help me in this regard.

thanks

prp



Re: ADC problem

danaaknight posted on 25 Nov 2012 06:07 AM PST
Top Contributor
1773 Forum Posts

If no test strip is attachedPin_1 floating, you should have

 

1) 400 mV at output of TIA

2) 3.2 V at output of PGA

 

This should also be true if you attach test stip with no solution ? I am not an expert

on test strip parameterics.

 

If test strip goes to .18 V Then TIA out should be 22.5 mV, Vout = 22.5 mV = Vref - 40 x Intia,

so Intia (uA) = ( 400 mV - 22.5 ) / 40 =~ 9.4 uA

 

Is this the current you think you should have ?

 

This shows for 100 mV ref time response of current, does this jive with your time response scaled

by your ref voltage ?

 

http://electrochem.cwru.edu/encycl/art-g01-glucose.htm

 

Regards, Dana.

 



Re: ADC problem

danaaknight posted on 25 Nov 2012 06:15 AM PST
Top Contributor
1773 Forum Posts

Some reference material -

 

Regards, Dana.



Re: ADC problem

sachinbvp posted on 25 Nov 2012 06:49 AM PST
Top Contributor
139 Forum Posts

this might help you out in designing of blood glucose meter

http://www.cypress.com/?rid=43661



Re: ADC problem

danaaknight posted on 25 Nov 2012 07:28 AM PST
Top Contributor
1773 Forum Posts

I do not see in your code the drop trigger so that you can generate

the v(t) response as shown ?

 

file:///C:/Users/Dana/Documents/1%20Cypress/Ap%20Notes/Blood%20Glucose/Electrochemistry%20Encyclopedia%20--%20Electrochemical%20blood%20glucose%20test.htm

 

 

 

Regards, Dana.



Re: ADC problem

vgy posted on 25 Nov 2012 07:14 PM PST
Top Contributor
133 Forum Posts

 i didnt understand what is drop trigger?



Re: ADC problem

danaaknight posted on 26 Nov 2012 04:15 AM PST
Top Contributor
1773 Forum Posts

If you look at the reference material you see a time response

of the drop coming into contact with the sensor, as shown in

this graph. Then an exponential decay as the chemistry of the

reaction proceeds. This reference discusses timing of when to

take your measurement. So you have to time your A/D measure-

ment after you detect the contact of the drop. Discussed in the

various ref material I have sent you.

 

http://electrochem.cwru.edu/encycl/art-g01-glucose.htm

 

 

Regards, Dana.



Re: ADC problem

danaaknight posted on 26 Nov 2012 04:25 AM PST
Top Contributor
1773 Forum Posts

You can always consider a peak detector to capture the max

value of the response, then digitizing its output, then resetting

it for the next use.

 

Regards, Dana.



Re: ADC problem

vgy posted on 26 Nov 2012 06:41 AM PST
Top Contributor
133 Forum Posts

 here if using peak detector, voltage levels are scaling down i.e if the input to peak detector is 0 to 4 to 0 . the output should be 4v but the output of peak detector is scaling down to millivolts which is not true.how to over this problem?

Thanks

PRP



Re: ADC problem

vgy posted on 26 Nov 2012 06:41 AM PST
Top Contributor
133 Forum Posts

 here using peak detector, voltage levels are scaling down i.e if the input to peak detector is 0 to 4 to 0 . the output should be 4v but the output of peak detector is scaling down to millivolts which is not true.how to over this problem?

Thanks

PRP



Re: ADC problem

danaaknight posted on 26 Nov 2012 12:38 PM PST
Top Contributor
1773 Forum Posts

If you look at response time to peak all peaks oocur ~ 1 sec, your A/D is running

much faster than that, so easiest method is running the A/D continuously and do the

peak detection in software.

If you use an analog peak detection method thats basically stored charge on

a capacitor subject to discharge via leakage currents. You can calculate droop

on a capacitor Q = C x V, I = C dV/dT, dV = ( I x dT ) / C

www.cypress.com/?docID=38360


Regards, Dana.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20