You understood 100%. I am doing this with 10 pinns, giving 10 different sensors and using two pinns for the control. 1 pin for discharge through a 300 Ohm resistor and one pin directly connected to capacitor for sensing. As I've said, i got remarkably good results, but I think I can do better... I think I'll try a smaller cap as you suggest. I can then also shrink the number of bits from 24 to 16. This will give me 20% more cycles pr second as I reduce the loop from 10us to 8us. I've simply been stupid not to include a filter cap at the power-rails. I do have a zener making sure I don't get over-voltage. (5.1v) KreAture ----- Original Message ----- From: "Richard Prosser" To: Sent: Wednesday, February 19, 2003 2:56 AM Subject: Re: [PIC]: [EE]: NTC sampling via R/C-network and jitter... > I'm sorry - bu t I don't fully understand what you are doing. > My best interpretation is that you are using a PIC pin to charge a > capacitor via a NTC resistor and timing the point at which a different pin > changes state to derive a value for the resistance - and then the > temperature. The whole lot being powered from a PC's RS232 port via a > resistor/diode network of some sort. > > If this is the case, then a 10uF cap seems excessive making the time > constant involved something like 100mS. > If you are using a 10uF cap then it seems likly it is an electrolytic. Not > a good choice for this as amoungst other effects (such as wide tolerances, > temperature effects, aging & leakage) , they can regain a small amount of > charge after a "full" discharge - I forget the correct term for the effect > but polyprop. caps are a lot more satisfactory - but you'll be stuck with > lower capacitance. > > If you are powering the whole shebang from a serial port - or if you're > not, a filter cap on the power suppply would be mandetory. > > Hope this helps - I may have misinterpreted the problem but it may help > anyway. > > Richard P > > > > > > > Kyrre Aalerud > NET> cc: > Sent by: pic Subject: [PIC]: [EE]: NTC sampling via R/C-network and jitter... > microcontrolle > r discussion > list > A.MIT.EDU> > > > 19/02/03 13:50 > Please respond > to pic > microcontrolle > r discussion > list > > > > > > > I'm using a R/C-network to read the resistance of some thermistors with a > PIC16F627. > I'm currently using a 10uF cap and a 10k(@25c) thermistor and have a 24 bit > counter-loop taking 10us pr loop. I was under the impression that as long > as I discharged the cap really good before recharge, I should get fairly > equal consequtive readings. It turns out I get a 13 bit jitter! > This jitter only translates to about 0.03c but still... > > The transformation to temperature from time-reading is done in the > computer, > instead of the PIC. This allows for the use of floatingpoint math and > exp/log functions. I use the correct curve for the NTC resistors and have > noticed av very close match to "real-world". Doing a comparison between > two > analog thermometers and two of my sensors in a glass of water revealed no > observable deviations across 60 to 13c! I calibrated the sensor-loop once > at 22c as it was room-temp. (As read of the analog thermometers.) > > I'm using the internal 4 MHz oscillator of the 16F627. Can this be the > source of the jitter, or is it parhaps that I run the circuit from the DTR > and RTS signals fo the serial-port. > I am running the power through diodes and a resistor, but a capacitor may > not be a bad idea? > > All ideas welcome. Except adding a ADC, I'm trying to keep this simple and > cheap! > > KreAture > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.