pic microcontroller discussion list <> wrote on Friday, May 16, 2003 1:36 PM: > AVcc = Power source pin of the analog section > AVss = GND pin of the analog section > Vref = Input pin of reference voltage > (These pins can be tied to internal source or externally) > > My question is: > 1) If my external analog signal(-5V to 5V) is using a different power > supply, how shall I connect these 3 pins? You need to level-shift and attenuate your analog signal so it falls within the range 0V to Vref. AVcc should be a clean 5V supply, AVss should be analogue ground, probably connected to digital ground under or near the processor. Vref is whatever you need the full scale voltage to be, typical values might be 2.5V or 5V, depending on what the processor can cope with. > 2) The manual claims that the analog input voltage can range from 0 > to AVcc. How can I detect the presence of a negative voltage (there > is no sign bit in the result register). You can't, all ADC inputs have to be shifted to positive voltages, and it's worth using something like a Schottky diode to ensure the input can never go more than a fraction of a volt negative. > 3) I intend to pass the analog voltage through an op-amp configured > as a voltage follower. This op-amp is power using the same source as > my microcontroller. Will there be any problem with my configuration. Apart from the above, I don't think so. > 4) Since I have only 1 AVss pin, does that mean that I cannot have > more than 1 analog voltage pin using different power source? No, the AVdd is just the power for the internal analog circuitry, as long as your input signal falls between AVss and Vref it should be OK. However, for noise reasons, it is important to lay out the grounds carefully, but that is a topic best learnt from a book or website, and experience, rather than in a brief email. Nigel -- Nigel Orr, Design Engineer nigel@axoninstruments.co.uk Axon Instruments Ltd., Wardes Road,Inverurie,Aberdeenshire,UK,AB51 3TT Tel:+44 1467 622332 Fax:+44 1467 625235 http://www.axoninstruments.co.uk -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu