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

18f4550 Analog Vref

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



Joined: 27 Jan 2009
Posts: 19

View user's profile Send private message

18f4550 Analog Vref
PostPosted: Mon Feb 16, 2009 6:58 pm     Reply with quote

Hi,

I started a project on a 16f877a and I was using a 3.3V Vref for the analog port.
I could set A0 to A2 as analog input and A3 as a Vref !

How can I right that for the 18f4550 ?
Can I still do it ?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 16, 2009 7:06 pm     Reply with quote

Look in the ADC section of the 18F4550.h file. It tells how to do it.
It lists the constants to be used with setup_adc_ports().
Quote:
c:\Program Files\picc\Devices\18F4550.h
boily



Joined: 27 Jan 2009
Posts: 19

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 7:55 am     Reply with quote

yeah I look into that but can't find how to set the Vref :

Code:
//////// Standard Header file for the PIC18F4550



++++++++++++++++
Header File removed.
Reason: Forum Rule #10

10. Don't post the CCS example code or drivers, or ask for such code
and drivers. Please do NOT copy this code into the forums.
This includes header files for devices (example 18f452.h).

-- Forum Moderator
++++++++++++++++
boily



Joined: 27 Jan 2009
Posts: 19

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 8:44 am     Reply with quote

Answer: setup_adc_ports(AN0|VSS_VREF);
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