Micro Eng wrote... >To read and store takes two functions, S&H then convert right? Yes, sort of; first you allow the ADC's input capacitor to charge up to the voltage at the input pin, then you start the conversion. When the conversion is complete, you read the result from the result registers. >So reading the 877 data sheet, it takes on the average 19.27uS to capture >the analog data. Yes, that's how long it takes for the voltage on the sampling capacitor to charge up to the pin's input voltage to within 1/2 LSB, **IF** the input is held steady during this period. >Now if this is a sine wave and you are looking for the >peak value, the switch will close, the cap will charge for the 19.27 uS then >the switch opens. The value holds there, so then you run the conversion >which depends on the speed of the clock and what you choose to use. True, provided you time the acquisition phase to coincide with the sine wave's peak, and that the sine wave isn't of such a high frequency that its value changes significantly during the sampling interval. >Question is....when the sample & hold circuit is running, its not a snapshot >of any particular time (less you use a flash A/D I suppose)but essently will >be the peak value of the sine wave even if the aquisition time occurs prior >to and after the peak. Not true. It **IS** a snapshot. The sampling circuit is not a "peak detector" or "peak hold" circuit: it's merely a sampler. The ADC knows absolutely nothing at all about sine waves or peak values; all it knows is what voltage was left on the sampling capacitor at the instant the sampling switch opened at the end of the sampling interval. And that is the voltage it will convert. >Its not going to drain the cap once the negative >quadrant of the peak occurs, but simply hold the peak charge that it was >given (thats the question). Again, not true. It will not hold the peak, but rather will follow (or attempt to follow, with varying degrees of success) the current input value. >Elsewise, if you want to sample the peak, you >have to know exactly when the switch closes and be sure the peak occurs >right before the switch opens, and that is also going to depend on >temperature, etc. I don't know what temperature has to do with it, but basically yes: if you want to measure the peak value of the sine wave you'd have to know when the peak occurs and time the acquisition and conversion accordingly. Or, insert a peak detector/peak hold circuit ahead of the ADC; but those things are slightly tricky to design. Hope this helps more than it disappoints... :) Dave -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.