TOP

How to set ADC port before the chip enter sleep mode?

As AD input signal is analog signal, in order to prevent leakage current, user can set P4CON register in I/O port initialization, such as use P4.1 as fixed AD port, set P4CON.1 to 1, and do not need to change it before or after sleep mode, but should note that when P4CON.1 sets to 1, P4.1 port can only be used as pure analog input port and can not as a digital I/O port. 
In addition, before entering sleep mode, user should disable AD function (ie ADENB = 0) to reduce sleep mode current and enable AD after system wake-up (ie ADENB = 1), and delay 100us for AD sampling (whether under any conditions, user should make a delay of at least 100us for AD sampling after enable ADC function).