0
\$\begingroup\$

Not really a problem, just curious.

I'm using a PIC18LF13K22 and the datasheet mentions that I can disable the digital input buffer for a pin by setting its corresponding bit in the ANSEL register.

Since I'm using some pins as digital outputs only, would I gain anything (less power usage?) by disabling their digital input buffers?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

No, don't disable the digital inputs when using the pin in digital mode. The digital input circuit doesn't really consume power as long as the pin voltage is solidly high or solidly low. You don't save anything by turning it off, and it might cause trouble.

All pins that can be analog inputs wake up that way because it is most tolerant of the external circuit. If a pin is held near the middle of its voltage range, then the digital input circuit in the PIC could draw unnecessary power and possibly even oscillate. So the PIC starts out in the most tolerant mode and the firmware then switches specific pins to other modes as only it knows how the micro is being used.

\$\endgroup\$
0
\$\begingroup\$

With an ANSEL bit set the pin is in Analogue Input mode.

This consumes less power than in digital input mode when idle. This is why they default to analogue input at power up.

It has no effect when the pin is set to output.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.