I / O ports are the primary and only node through which the microcontroller interacts with external devices. Therefore, before writing the first program, you should learn how to configure the I / O ports of the microcontroller. For this purpose there are two registers: DDRx and PORTx. For example, if port B of the microcontroller needs to be set to output, then 0 should be written to the corresponding DDRB bit, and if to input 1. By writing 0 or 1 to the PORTB register, this port pin B is set to high or low potential.