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

Migrating from 18F252 to 18F2620, quick question about ADC!

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



Joined: 04 Nov 2004
Posts: 67

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

Migrating from 18F252 to 18F2620, quick question about ADC!
PostPosted: Fri Mar 17, 2006 8:30 am     Reply with quote

Hey everyone,

I have been using the 18F252 for some time now and am in the process of trying to migrate to the 18F2620 which has more rom/ram/eeprom, etc...

However, when I compile with the new #include <18F2620.h>, it flags the following line as an error:

setup_adc_ports(RA0_RA1_ANALOG_RA3_REF);

I looked through the files for both the 18F252 and the 18F2620 and it shows that tag "RA0_RA1_ANALOG_RA3_REF" as an "!old only provided for compatibility" on the 18F252.

I looked at teh 18F2620.h file and see nothing similar. From the options in the 18F2620 header file, should I use something like:

setup_adc_ports(AN0_TO_AN1 | VREF_VREF); ???

Let me know.

Thanks!
jseidmann



Joined: 04 Nov 2004
Posts: 67

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

PostPosted: Fri Mar 17, 2006 9:30 am     Reply with quote

Hi,

In response to my post above, I have tried the following lines with no luck. Is there anything i'm doing wrong?

setup_adc_ports(AN0_TO_AN1 | VSS_VREF);

setup_adc_ports(AN0_TO_AN1 | VSS_VDD);

setup_adc_ports(AN0_TO_AN1 | VREF_VREF);

setup_adc_ports(AN0_TO_AN1 | VREF_VDD);

I tried compiling 4 times with each of the 4 options above with no luck. Any suggestions?
Mark



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

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

PostPosted: Fri Mar 17, 2006 12:17 pm     Reply with quote

Read the datasheet, specifically on setting up the ADC. Set the values directly in the ADCON registers.
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