View previous topic :: View next topic |
Author |
Message |
jseidmann
Joined: 04 Nov 2004 Posts: 67
|
Migrating from 18F252 to 18F2620, quick question about ADC! |
Posted: Fri Mar 17, 2006 8:30 am |
|
|
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
|
|
Posted: Fri Mar 17, 2006 9:30 am |
|
|
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
|
|
Posted: Fri Mar 17, 2006 12:17 pm |
|
|
Read the datasheet, specifically on setting up the ADC. Set the values directly in the ADCON registers. |
|
|
|