Brian J Walsh
- 3rd July 2008, 23:57
Does anyone know if ADCIN and its associated DEFINES work with the PIC18F4620?
As part of a migration from a 16F877 I noticed that the adcon registers are more numerous and somewhat different.
To check what was happening, I put in debug statements after the block of DEFINE ADC_.. statements and observed that the contents of adcon0,1 & 2 were all zero as though the DEFINES had had no effect. My DEFINES are genuinely upper case, which I believe is an MPASM requirement.
I have now set these registers directly (adconx = %xxxxxxxx) and the debug confirms that their contents are now as expected.
Subsequent ADCIN statements do not give the expected result and I wondered if I would have to abandon ADCIN and trigger the conversion manually by toggling GO/DONE in adcon0.
Any ideas? TIA,
Brian Walsh.
As part of a migration from a 16F877 I noticed that the adcon registers are more numerous and somewhat different.
To check what was happening, I put in debug statements after the block of DEFINE ADC_.. statements and observed that the contents of adcon0,1 & 2 were all zero as though the DEFINES had had no effect. My DEFINES are genuinely upper case, which I believe is an MPASM requirement.
I have now set these registers directly (adconx = %xxxxxxxx) and the debug confirms that their contents are now as expected.
Subsequent ADCIN statements do not give the expected result and I wondered if I would have to abandon ADCIN and trigger the conversion manually by toggling GO/DONE in adcon0.
Any ideas? TIA,
Brian Walsh.