View previous topic :: View next topic |
Author |
Message |
pom
Joined: 25 Nov 2004 Posts: 30 Location: Germany
|
AD-Converter with external reference |
Posted: Thu Nov 25, 2004 3:46 am |
|
|
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 |
Posted: Thu Nov 25, 2004 4:19 am |
|
|
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
|
Thank you. |
Posted: Thu Nov 25, 2004 10:49 am |
|
|
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. |
|
|
|