I'm working right now on a PIC project that involves reading voltage output from an AD595 (thermocouple amplifier). I've made PIC projects in the past but very few involved using the ADC.
I'm using PIC16F1519, for no particular reason... I bought a bunch a while ago because 1. they were cheap 2. they had 10bit ADC 3. they had lots of pins (DIP40) and 4. they have lots of flash memory. I've used a few of these with led matrixes, uart etc.
I've not yet tested this on the breadboard but I'm going to do it tomorrow or when I have more time, at the moment I'm writing the code in MPLAB X.
So I'm checking the datasheet (which is
here) and in particular the ADC chapter (page 135+).
I've set the internal voltage reference to 4.096v, I've configured the ADC to use the internal voltage reference. I'm planning to use the internal oscillator at the default 16 Mhz so I've set the conversion clock to Fosc / 32, because it gives a reasonable value of 2us in that table on page 137.
Next, I looked on page 140 at ADC conversion procedure and I noticed something ... they turn on the adc and wait the required acquisition time, for the sampling capacitor to charge. Only then, I'm supposed to set GO to 1 and then wait until it becomes 0 again.
Am I right to assume that this wait period only happens once, when the adc is turned on? Or, also when I change the channel (because sampling cap could be discharged due to nothing connected on previous channel) ? If only when turned on, then if I start the ADC at "boot" when I initialize the ports and everything, most likely there's going to be a few ms wasted initializing the PIC so no need to add code/ delays each time i do an adc read, I can then just set the GO bit and wait for the conversion to finish, I don't have to turn on and off the adc after every conversion.
Besides saving power (I suppose), is it wrong to leave the adc on (but without doing conversions) all the time? Can it affect other parts of the PIC (heating the chip, noise etc)?
I suppose if I measure the voltage of a battery for example, I would want to disable the ADC or change the channel at least so the battery wouldn't be discharged the adc, right?
There's also a mention of the adc needing low impedance, maximum being 10kohm. The AD595 chips just says it has low impedance output of 10mV/C but I don't see any actual value for the impedance in the specifications... being the output of an opamp it should be fine, right? Am I missing something here?
Thanks in advance for clearing this up and sorry if the write style is confusing