Re: Port settings - 18F4620
Hi,
CMCON = 7 is correct for the 18F4620 but it's also the POR default so it's not REALLY needed.
ADCON1 = 15 is correct if all pins should be digital, if you set it to 0 all 12 inputs will be analog.
ADCON2 doesn't really matter since the ADC is off anyway.
I've never used Darrels AllDigital but remember that when you INCLUDE a file like that the content of the file will be put in at that very spot - just as if it was actually typed in right there. Since you include it first and THEN set CMCON etc manually YOU will overwrite whatever it is IT does to the relevant registers. Had YOU set the registers first and THEN included AllDigital IT would overwrite anything you've set manually - in the register it believes are important only of course.
/Henrik.
Re: Port settings - 18F4620
Thanks Henrik,
I think that I'll remove any manual settings and add the AllDigital include file at the start of all my project that have no analogue requirements - makes things simple
Re: Port settings - 18F4620
You can do that - as long as the chip is "supported" by AllDigital. How do you know if a certain chip is supported? I don't know, you'd need to read the code for AllDigital and compare it to the datasheet for the device - which kind of defeats the purpose of AllDigital.
I guess any chip released prior to AllDigital will be handled and possibly a lot of later chips as well but don't take anything for granted.
Or you can do it manually and learn something in the process - perhaps you get so good at it that you can maintain AllDigital and keep it up to date.
/Henrik.