Hi!
How should the PIC18F24K20 be set to have all pins digital output?
Is it enough to set the ANSEL register or do you need something else?
CLRF ANSEL
Thanks in advance for your help!
Pins set to analogue will still work as digital outputs when set to output. However, a big gotcha is they always read as zero so RMW operations can produce strange results.
That's not been an issue for a great many years (basically the 16F628), the default now is comparators OFF.
If in doubt, set the pins using the MCC, which the OP is probably using to set the config fuses anyway? (I certainly do) - then either use it 'as is', or cut and paste the parts you want to your main code.