- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sir,
Upto PGA working and ADC also working properly individualy but when i am cascading both,i am not getting anything .
Thanks
PRP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some critical settings with ADC, can you post at least the settings of the ADC when not the complete zipped project.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i am unable to upload the project what to do ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We still don't know what the problem is: what do you mean by 'garbage values'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried with ADC Continuous mode of operation ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not see in your code the drop trigger so that you can generate
the v(t) response as shown ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i didnt understand what is drop trigger?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.