Log in

View Full Version : Unable to resolve ADC_CH0


p_a_3
02-02-2008, 16:14
I have been unable to locate this. In ifi_frc.h is

#define rc_ana_in01 ADC_CH0

Can someone please tell me where it is defined?

Thanks

Kevin Watson
02-02-2008, 16:43
I have been unable to locate this. In ifi_frc.h is

#define rc_ana_in01 ADC_CH0

Can someone please tell me where it is defined?

ThanksIf you're using the legacy IFI code in ifi_code.c, you should use the values found in mcc18\h\adc.h (e.g., ADC_CH0, ADC_CH1, etc).

If you're using my code, you just pass in a number corresponding to the channel (e.g., Get_ADC_Result(1)).

-Kevin

p_a_3
02-02-2008, 18:06
Please excuse my confusion here.

The base code we used was located in ifi_frc_sensor_30

The reference to ADC_CH0 was in ifi_frc.h of that project. I suspected that these defines were values 0, 1, etc. When I looked at an old mcc18\h\adc.h I found

#define ADC_CH0 0b10000111 // Channel 0

Should I use these values or simple integers?

Thanks,
Paul Alexander

Kevin Watson
02-02-2008, 20:26
Please excuse my confusion here.

The base code we used was located in ifi_frc_sensor_30

The reference to ADC_CH0 was in ifi_frc.h of that project. I suspected that these defines were values 0, 1, etc. When I looked at an old mcc18\h\adc.h I found

#define ADC_CH0 0b10000111 // Channel 0

Should I use these values or simple integers?

Thanks,
Paul AlexanderI'll have a look at it this evening...

-Kevin

Kevin Watson
03-02-2008, 01:42
I have been unable to locate this. In ifi_frc.h is

#define rc_ana_in01 ADC_CH0

Can someone please tell me where it is defined?

ThanksSorry about the confusion. I've written replacement code that has the same functionality as the old IFI code. I'm not sure how I'll incorporate it yet, but you can download it here (http://kevin.org/frc/quick_adc.zip) and drop it into your project.

-Kevin