Boyce
Joined: 07 Feb 2010 Posts: 39
|
ADC Reference input pin selection issue |
Posted: Tue Mar 09, 2010 12:34 am |
|
|
Compiler 4.104 16F690
I am trying to find a way to use one of the ADC input pins as a reference voltage input for the other ADC input pins. I don't see how to do it.
This did not work:
Code: |
setup_adc_ports(sAN1|sAN2|sAN3|VSS_REF|sAN0);
|
This does work, but I need a different reference voltage:
Code: |
setup_adc_ports(sAN1|sAN2|sAN3|VSS_REF);
|
How can I use the voltage reference I need to use, like two diode drops?
Thanks,
Boyce
Code: |
This is from the 16F690.h file:
// Constants used in SETUP_ADC_PORTS() are:
#define sAN0 1 //| A0 \\!"K50"
#define sAN1 2 //| A1 \\!"K50"
#define sAN2 4 //| A2 \\!"K50"
#define sAN3 8 //| A4
#define sAN4 16 //| C0
#define sAN5 32 //| C1
#define sAN6 64 //| C2
#define sAN7 128 //| C3
#define sAN8 0x10000 //| C6
#define sAN9 0x20000 //| C7
#define sAN10 0x40000 //| B4
#define sAN11 0x80000 //| B5
#define NO_ANALOGS 0 // None
#define ALL_ANALOG 0xF00FF // A0 A1 A2 A4 C0 C1 C2 C3 C6 C7 B4 B5
// One of the following may be OR'ed in with the above using |
#define VSS_VDD 0x0000 //| Range 0-Vdd
#define VSS_VREF 0x4000 //| Range 0-Vref
|
_________________ boyceg1@gmail.com |
|