Understanding how a digital pin of a microcontroller is configured took me lot of time. Because of, lack of proper material. Most of the articles found on the internet are incomplete. And they talk only from one point of view i.e., either as inputs or as output. Some other articles do not compare and differentiate between both of them. So in this post I am putting some effort to make the topic simple to understand for everyone. Following are the slides from my notebook.