Hi harish gode,
I don't understand very well your application, to provide a better answer, could you share your schematic?
Also I have a concern about your implementation, the highest current the MCU supports is 25mA (the sum of all pins) if you supply the MCU with 20 mA in a single pin, is highly possible to break it. Be careful with this.
Best Regards,
Alexis Andalon