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

AD-Converter with external reference

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



Joined: 25 Nov 2004
Posts: 30
Location: Germany

View user's profile Send private message

AD-Converter with external reference
PostPosted: Thu Nov 25, 2004 3:46 am     Reply with quote

Hello everybody,

I have a huge problem with using an external reference for AD-converter.

I try to programm a 18F258 to detect a voltage on the PINs A0 and A1. As reference I want to use PIN A3 with a voltage of 2.5V.

The help of the PICC-Compiler says, that I shall use the line:

setup_adc_ports( A0_RA1_ANALOGRA3_REF );

But the compiler doesn't work with this line. Lines which are similar to the first one also don't work:

setup_adc_ports( RA0_RA1_ANALOGRA3_REF );
setup_adc_ports( RA0_RA1_ANALOG_RA3_REF );

I don't know what to do. Please help me.
Ttelmah
Guest







Re: AD-Converter with external reference
PostPosted: Thu Nov 25, 2004 4:19 am     Reply with quote

pom wrote:
Hello everybody,

I have a huge problem with using an external reference for AD-converter.

I try to programm a 18F258 to detect a voltage on the PINs A0 and A1. As reference I want to use PIN A3 with a voltage of 2.5V.

The help of the PICC-Compiler says, that I shall use the line:

setup_adc_ports( A0_RA1_ANALOGRA3_REF );

But the compiler doesn't work with this line. Lines which are similar to the first one also don't work:

setup_adc_ports( RA0_RA1_ANALOGRA3_REF );
setup_adc_ports( RA0_RA1_ANALOG_RA3_REF );

I don't know what to do. Please help me.

The best way to find the syntax, is to look in the include file for the chip. The correct form, is the last one you give (RA0_RA1_ANALOG_RA3_REF), which should work. You need to be including the file 18F258.h, before you can use these text macros.

Best Wishes
pom



Joined: 25 Nov 2004
Posts: 30
Location: Germany

View user's profile Send private message

Thank you.
PostPosted: Thu Nov 25, 2004 10:49 am     Reply with quote

Thank you for helping me. It was a very good hint to look it up in the 18F258.h. I didn't realize this possibility.
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