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

The problem with the wizard 4.119 (ADC 18f4410)

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



Joined: 23 Sep 2009
Posts: 55
Location: Ukraine

View user's profile Send private message Visit poster's website

The problem with the wizard 4.119 (ADC 18f4410)
PostPosted: Tue Apr 12, 2011 12:18 pm     Reply with quote

I chose for the new project PIC18F4410 and trying to configure the ADC module.
In the datasheet to the controller about of ADC has been a lot of information. I try use the wizard to correct the code generation settings (I had not previously worked with the PIC18F4410). But instead of setting only got one line:
Code:

setup_adc_ports(AN0);

How to enable ADC (xtall=26 MHz, the input AN0)?
(I think something like that:)
Code:

setup_adc(ADC_CLOCK_DIV_8|ADC_TAD_MUL_16);
setup_adc_ports(AN0);
set_adc_channel(0);

Am I right or have other preferences?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 12, 2011 1:03 pm     Reply with quote

This post has an example of using the ADC in the main() code:
http://www.ccsinfo.com/forum/viewtopic.php?t=40279&start=3
It only needs one change. Change "sAN0" to "AN0".
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