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 support@ccsinfo.com

sAN0 and sAN2 adc conversion setup

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



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

sAN0 and sAN2 adc conversion setup
PostPosted: Wed Jul 28, 2004 1:28 pm     Reply with quote

May I setup port A0, A1, A3 and ADC port in 16f675 as
Code:

setup_adc_ports(sAN0|sAN1|sAN2);
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 1:51 pm     Reply with quote

Quote:
May I setup port A0, A1, A3 and ADC port in 16f675 as
setup_adc_ports(sAN0|sAN1|sAN2);


Yes, that's the way it works, except that you specified A0, A1, and A3,
so you should use sAN3 as the last parameter, and not sAN2. Example:
Code:
setup_adc_ports(sAN0|sAN1|sAN3);
young



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 2:02 pm     Reply with quote

Thank you PCM:
How about if I want to set A0, A1, A2 as ADC port, A3 as digital input A4, A5 as output?

Is it like

Code:

set_tris_a(0b00001111);  setup_adc_ports(sAN0|sAN1|sAN2);


first set a0-a2 as output then set it as adc input right?
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 2:26 pm     Reply with quote

You can't always do all combinations. The place to look is the chip's data sheet. It will tell you what is possible.
_________________
The search for better is endless. Instead simply find very good and get the job done.
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