CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ADC Reference input pin selection issue

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Boyce



Joined: 07 Feb 2010
Posts: 39

View user's profile Send private message

ADC Reference input pin selection issue
PostPosted: Tue Mar 09, 2010 12:34 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group