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

PIC18 A/D q. select analog

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







PIC18 A/D q. select analog
PostPosted: Thu Feb 03, 2005 2:05 pm     Reply with quote

I must use analog port in PIС18F4320 :
as PIN RA3-Vref+; RA4 - button; RA5 - analog in;
RA0,RA1,RA2-digital i/o ;
How I can do this?
If I can use analog port as
only: A0, or A0 and A1 or A0 and A1 and A2 //etc/
in header file.

PLEASE answ/ me!
Ttelmah
Guest







PostPosted: Thu Feb 03, 2005 3:37 pm     Reply with quote

Read the data sheet for the chip.
You can only configure the port as the _hardware_ allows. What you describe cannot be done.

Best Wishes
Beginner
Guest







PostPosted: Thu Feb 03, 2005 3:41 pm     Reply with quote

So If I use Vref , then I can't use RA0,RA1,RA2 as digital io?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Feb 03, 2005 6:33 pm     Reply with quote

Beginner wrote:
So If I use Vref , then I can't use RA0,RA1,RA2 as digital io?

No, if AN0 is a digital i/o then you don't get any analog inputs. The analogs need to start at AN0 and go up.
Beginner
Guest







PostPosted: Fri Feb 04, 2005 11:14 am     Reply with quote

And about this:
I use PORTA0,1,2 as digital output and can use analog input(RA3 - Vref; RA5-input;) when digital don't use . So I must commutate from analog to digital.


This is too not correct????
Beginner
Guest







PostPosted: Fri Feb 04, 2005 11:17 am     Reply with quote

By communitate with function setup_adc_ports();?????
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