libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Fri Feb 18, 2005 10:39 am |
|
|
You can use the SETUP_ADC_PORTS(AN0_AN1_VREF_VREF) command to set up two analog input channels, and have two VREFs supplied from pins AD3 and AD4 when measuring Ch1.
To use Ch 2 sensor with a full range of 0 - 5V you have to switch off the outside reference sources and use VSS VDD (0 - 5 V) as reference when measuring Ch2, You can do it with SETUP_ADC_PORTS(AN0_AN1_AN3) command before switching to Ch2.
However if your Ch2 sensor is in the VREF range, you can also leave the references permanently on for both channels. (you can also decide it in your code, and switch to VREFs only if the sensor is out of VREF limits. (be careful, the input voltage cannot outside the Vref limits more than 0.3 V, look it up in the datasheet)
Be sure to let enough time between switching channels (and VREF mode) for the ADC to settle.
Do you really need the increased resolution on Ch1 so you need the VREFs ? |
|