View previous topic :: View next topic |
Author |
Message |
oxo
Joined: 13 Nov 2012 Posts: 219 Location: France
|
How to set pins for external vrefh and vrefl? |
Posted: Wed May 27, 2015 12:30 am |
|
|
Hi all,
chip 18F26K80
compiler 5.045
I have analog inputs on AN0 - AN3.
I can't figure out how to select AN8 as VREFhigh and AN10 as VREFlow.
In the 18f26k80.h file it mentions
set_analog_pins(int32 pins, int32 reference);
but I can't find any document or help entry describing what it does. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Wed May 27, 2015 1:04 am |
|
|
You can't.
This is all down to reading the data sheet. Vref+, is pin RA3, Vref- is pin RA2. Fixed. Can't be changed.
You need to move your input signals to a couple of other pins.
Generally 'reference' analog signals can't be moved. Unlike digital signals, where a simple multi-line decoder can be used to move them around, analog signals require a complete multiplexer, and this has a significant impedance. Not too important on the analog inputs, but disastrous on things like reference voltages.... |
|
|
|