18.3.1 Initialization

After Reset, all outputs are tri-stated, and digital input buffers enabled even if there is no clock running.

The following steps are all optional when initializing the PORT operation:

  • Enable or disable the output driver for pin Pxn by respectively writing ‘1’ to bit n in the PORTx.DIRSET or PORTx.DIRCLR register
  • Set the output driver for pin Pxn to high or low level respectively by writing ‘1’ to bit n in the PORTx.OUTSET or PORTx.OUTCLR register
  • Read the input of pin Pxn by reading bit n in the PORTx.IN register
  • Configure the individual pin configurations and interrupt control for pin Pxn in PORTx.PINnCTRL
Important: To achieve the lowest possible power consumption, disable the digital input buffer of unused pins and pins used as analog inputs or outputs. For pins with the digital input buffer enabled, it is recommended to transition between high and low voltage thresholds as quickly as possible.

Pins designated for special functions, such as debugger connections, must be configured according to the requirements of their intended use. For example, for pins that are configured as RESET, disabling the input buffer on this pin will reset the device.