how to enable and disable external pullup resistor to microcontroller pin because i'm using one port pin for two applications.. For one application need external pullup resistor whereas for the other application pullup not required.
If the second application is also digital (I/O, PWM, etc.), then there's no need to remove it. You might need to make it a "weak" pull-up if the alternate function is an output.