Reference voltage for A/D inputs - Revisited 16886
Posted: Fri Sep 05, 2008 10:01 am
Reference voltage for A/D inputs - Revisited for 16886
Hi Guys,
The above topic is covered in a previous post but that post is now out of date (for 16F876) and my question is for the 16F886.
A summary of the previous post might be:
If you want Vref then go in to the FCD file, make a copy, call it Device_Vref.fcd and adapt it to change ADCON1 register to use the Vref you require. Also add to the Device field a reminder of the source device. Then use the new fcd file as the device definition file in Flowcode.
I have tried the above with the 16F876 and it works fine (original file name retained), though the fcd code has changed so some adaptation was required.
For the 16F886 two problems arose:
1) Using a new file name (.fcd) and the "ChipName = 16F886" in the device field still stopped the compiler recognising the processor.
Changing the original fcd file and keeping the name the same worked.
How can I find the correct Device Name Phrase (for this and other processors)?
2) Changing the original file and using ADCON1 = 8 (VRef on RA3) did not work in as much as the Vref was not recognised (even though Vref was there and could be read on, say RA1 as a correct value. All the Analaog inputs still stayed referenced to 5v (HP-488 board used, jumpers changed for Analog Inputs). Presumably the Tris register code also needs changing, or something else?
Please suggest what needs changing.
Since the Original post seems the most popular (hits wise) on the whole forum, it would seem that Vref is a good candidate for incorporation into the Flowcode ADC Component itself.
Thanks again,
Mark
Hi Guys,
The above topic is covered in a previous post but that post is now out of date (for 16F876) and my question is for the 16F886.
A summary of the previous post might be:
If you want Vref then go in to the FCD file, make a copy, call it Device_Vref.fcd and adapt it to change ADCON1 register to use the Vref you require. Also add to the Device field a reminder of the source device. Then use the new fcd file as the device definition file in Flowcode.
I have tried the above with the 16F876 and it works fine (original file name retained), though the fcd code has changed so some adaptation was required.
For the 16F886 two problems arose:
1) Using a new file name (.fcd) and the "ChipName = 16F886" in the device field still stopped the compiler recognising the processor.
Changing the original fcd file and keeping the name the same worked.
How can I find the correct Device Name Phrase (for this and other processors)?
2) Changing the original file and using ADCON1 = 8 (VRef on RA3) did not work in as much as the Vref was not recognised (even though Vref was there and could be read on, say RA1 as a correct value. All the Analaog inputs still stayed referenced to 5v (HP-488 board used, jumpers changed for Analog Inputs). Presumably the Tris register code also needs changing, or something else?
Please suggest what needs changing.
Since the Original post seems the most popular (hits wise) on the whole forum, it would seem that Vref is a good candidate for incorporation into the Flowcode ADC Component itself.
Thanks again,
Mark