Might help.
I think she's said it several times, here's one of them.
At least the sorting part.
http://www.picbasic.co.uk/forum/showthread.php?t=134 <-- 134
<br>
Might help.
I think she's said it several times, here's one of them.
At least the sorting part.
http://www.picbasic.co.uk/forum/showthread.php?t=134 <-- 134
<br>
DT
Many Thanks to everybody for their supports,
Yes Alain, it may be impedance problem or Offset voltage drift in Op-Amps but it is not.
As I said before, I tried many techniques and schemes, I used OP27 (very low offset) with symmetrical power supply and I always precisely check that kind of voltage drifts. Then I used MAX6241 (4096mV ref with a single supply). Sometimes I used a series resistor(1-4,7k) in analog inputs and/or/not capacitors (100-470 nF) between these pins and GND.
May I ask you, did you ever precisely measure the voltages with a 1 mV (or lower) resolution voltmeter? If everything is okay may I see the summarized ADC section of your
code (if it is in PBP)? Because I'll be insane soon.
Thanks Darrell Taylor, I know, this code was one of the test code combinations.
I read the manual's A/D section and desperately tried many clock setting parameters and
also ADCIN command. These definition lines should be forgotten to be deleted.
Staistical sort method is the last way, I used this technique only on the Maxim's high speed
(100-200 kHz) 12-16 bits A/D converters. There was no need to use in 18F252.
There must be a structural difference between 18F252 and 2520 to affect their using technique and resulting difficulties.
BrianT, you are right, analog ground distribution is very important to prevent the voltage drops. I use protoboard for now but 18F252 was direct working in every condition. I don't understand this.
Namely, I compare everything with 18F252 comfort and then getting angry.
Can anybody write me a simple summarized code including definitions, settings and ADCIN usage. (I don't need high speed conversions. I want slow but stable and true results )
(for 2520,4520, 2550 or 4550, all they have same A/D structure).
And talk about differences between 18F252 or F452 and other new versions of these chips?
Then, once again, I will try it on a PCB.
Thank you
Selim
Hi, Selim
First, I'd like to raise the problem data ...
- Your scale is 1 - 4.096v with 10 bits resolution.
- You want to read 10-20 mV
That means you read with 4 mV per Bit ...
The ADC count is always +/- 1 LSB ( rollover error ) ...
So, your result is 1 to 5 +/- 1 ... I do not think you want to seriously regulate something with a +/ 20% input data error...
Now, generally speaking, I always use a mean value - Nb of samples are a function of the measuring allowed time - and, to get rid of the rollover ... I then swap the LSB ...
Moreover, when tracking the mV ... Ground Guard rings around the PIC inputs are to be used ( remember the inputs are "not so far" from the Xtal ... ).
You'll notice the input leakage current has been reduced from +/- 500 nA ( '252) to +/- 100 nA ('2520) ... which means a much greater noise sensitivy ...
I'd lead you to use a ground plane on the component's side, ADC section ...
It would be interesting to know exactly what you want to do ... and how you do it ( input data range, sensors used, ...).
I do not want to be rude ... but tracking 0 -20 mV with a 4v reference is a nonsense without "superior" PCB design skills ... as BrianT told.
" May I ask you, did you ever precisely measure the voltages with a 1 mV (or lower) resolution voltmeter? "
My multimeter is a 4.5 Digits ... so, 1 mV resolution.
I really do not think the solution is in the code lines ...
Regards
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Thanks Alain,
You analyzed all situations. Thank you. Let me try to explain all story.
I'm a physics researcher at University. I study on polymer physics. I also graduated from Electronics technical high school, from now on, electronics is a hobby for me. I'm trying to make some controller devices to use in our polymer lab. We have a special hand made oven to anneal some polymer thin films at some constant temperatures (0-500 C). I transformed its "antique" (from 1990's) controller to a modern pic circuit. An E-Type (chromel-constantan) thermocouple is embedded in the oven, thermocouple temperature-voltage conversion table is loaded in the pic18F252. Approx. 60 uV/C x 100 times with OP27 opamps = 6 mV/C *500 =3500 mV max. Voltage reference is 2048 mV, so 1 step=2 mv. Resolution is approx. 2/6=0.3 C/step. At 500 C, Tcouple voltage is about 3700 mV. Namely, I can't reach the temps. above 2048 mV(approx.280 C) and my resolution is 0,3. If my ref. voltage was 4096 mV (with a 12-bit ADC), my resolution would be 1/6=0.16 C/step and also one can measure beyond 500 C.
İncreasing the resolution is important for fast detecting of changes in temp. to keep the desired oven temperature.( I have written a "smart" code to fix it.). Data appears on the 6x led-displays and also transferred to a PC via RS232. It has many more features (clock, timer, alarm, statistics, scrolling menus, user programmable tcouple tables...30kB of 32kB is Full). I've attached the photos. I did specially not designed it with LCD screen and USB communication. My aim was produce a cheap, easy-to-make device for distrubute it other experimental workers. I successfully designed similar circuits with Maxim's 12-16 bit ADCs. But they are expensive and hard to be made.
PIC18F2523 is a 12-bit pic. It's ADC module is same with 18F2520 or other new USB pics (18F2550, 4550..). First, as a beginning, I replaced the 18F252 with 18F2520 and changed the ADC code, but there's always a non-linear difference (10-20 mV at best condition), then I tried other new pics on a protoboard with many additions (filters etc.) and many different combinations in AD registers' parameters in the code, did not work.
Anyway, I think I'll give up.
I hope you understand my English. Thanks everybody.
Selim
Bookmarks