Getting Started Training Module Using MCC: Step 3
Configure Switch Button Pin with External Interrupt Controller (EIC)
The switch button will be configured as per the design schematic of the SAM E51 Curiosity Nano Evaluation Kit.
Select the Pin Settings tab of MPLAB® Code Configurator (MCC) and then scroll down to the Pin Number 32 and configure the PORT pin PA15 as an external interrupt pin for switch functionality. The internal pull-up is enabled to avoid false edge detection as there is no external pull-up on the SAM E51 Curiosity Nano Evaluation Kit.
Select the Project Graph tab.
Under the left side tab, Resource Management (MCC), go to Device Resources and expand Libraries > Harmony > Peripherals > EIC. Click on the green plus symbol beside the EIC to add the EIC module to the project graph.
Configure the EIC block to generate an interrupt every time the user presses the switch SW0 and enable debounce functionality to avoid debouncing on the switch pin.
Configure LED Pin
The user LED will be configured as per the design schematic of the SAM E51 Curiosity Nano Evaluation Kit.
Rename the Default Main File
Note: The name of the default main.c is changed to main_sam_e51_cnano.c to indicate that the referred main.c is for the SAM E51 CNano getting started training module.