bearpawz,
I think you need to rethink your approach a "bit":
All the names you want to use like ADFM, ADCS1, ADCS2, etc., are already predefined as constants in the required .inc file. I am not sure of the implications of renaming them. Others might know.
ADCON0.6 datasheet name is ADCS0 ' (not ADCS2)
ADCON0.7 datasheet name is ADCS1
ADCON1.6 datasheet name is ADCS2
You actually need to control all three together (not just two bits) to control the TAD time, remembering that two are in ADCON0 and the other is in ADCON1
I know of no PBP shorter way to assign bits than the method you show at the bottom of your post. I think you could “use” a full 8 bit variable to hold the three separate bit values but would still have to distribute them to two other variables (ADCON0 and ADCON1).
Something tells me you could set this up to be automated in a manner similar to that shown here
http://www.picbasic.co.uk/forum/showthread.php?t=3891
using Darrel's excellent trick/secret but some ASM would be required. I have not fully explored as of yet.
Lastly, Joe pointed you to an excellent link on dealing and tracking bits using arrays - you should look here too.
Let us know ...
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks